diff options
| author | Lorenz <ESs95s3P5z8Pheb> | 2022-07-08 16:12:55 +0200 |
|---|---|---|
| committer | Lorenz <ESs95s3P5z8Pheb> | 2022-07-08 16:12:55 +0200 |
| commit | 8b010e26f2c70f53b2d288c4348caf8638f20093 (patch) | |
| tree | 9245b4eed7f410f1c168688a77eeda6bfd55c994 /src/main/java/com/thatgravyboat/skyblockhud/textures/TextureObject.java | |
| parent | c8b5138a20b12abb22567928b3c1485636a888e0 (diff) | |
| download | SkyHanni-8b010e26f2c70f53b2d288c4348caf8638f20093.tar.gz SkyHanni-8b010e26f2c70f53b2d288c4348caf8638f20093.tar.bz2 SkyHanni-8b010e26f2c70f53b2d288c4348caf8638f20093.zip | |
code cleanup
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/textures/TextureObject.java')
| -rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/textures/TextureObject.java | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/textures/TextureObject.java b/src/main/java/com/thatgravyboat/skyblockhud/textures/TextureObject.java deleted file mode 100644 index 6403e18bc..000000000 --- a/src/main/java/com/thatgravyboat/skyblockhud/textures/TextureObject.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.thatgravyboat.skyblockhud.textures; - -import com.google.gson.JsonObject; -import java.util.Arrays; -import net.minecraft.util.ResourceLocation; - -public class TextureObject { - - public String displayName; - public ResourceLocation bars = resource("bars.png"); - public ResourceLocation mines = resource("mines.png"); - public ResourceLocation playerStats = resource("playerstats.png"); - public ResourceLocation stats = resource("stats.png"); - public ResourceLocation dungeon = resource("dungeon.png"); - public ResourceLocation dialogue = resource("dialogue.png"); - - public TextureObject(String displayName) { - this.displayName = displayName; - } - - public static TextureObject decode(JsonObject json) { - TextureObject textureObject = new TextureObject(json.get("displayName").getAsString()); - Arrays - .stream(textureObject.getClass().getDeclaredFields()) - .filter(field -> field.getType().equals(ResourceLocation.class)) - .forEach(field -> { - try { - field.set(textureObject, new ResourceLocation(json.get(field.getName()).getAsString())); - } catch (Exception ignored) {} - }); - return textureObject; - } - - private static ResourceLocation resource(String path) { - return new ResourceLocation("skyblockhud", path); - } -} |
