aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerObject.java
diff options
context:
space:
mode:
authorLorenz <ESs95s3P5z8Pheb>2022-07-08 16:02:54 +0200
committerLorenz <ESs95s3P5z8Pheb>2022-07-08 16:02:54 +0200
commitc8b5138a20b12abb22567928b3c1485636a888e0 (patch)
tree6e874e1c5b74a522d6acca08dd6b64c808ddbbbe /src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerObject.java
parent1a3c4ef12590cfa7d463fc34cf23f95581eef8ee (diff)
downloadSkyHanni-c8b5138a20b12abb22567928b3c1485636a888e0.tar.gz
SkyHanni-c8b5138a20b12abb22567928b3c1485636a888e0.tar.bz2
SkyHanni-c8b5138a20b12abb22567928b3c1485636a888e0.zip
remove old stuff
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerObject.java')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerObject.java194
1 files changed, 97 insertions, 97 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerObject.java b/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerObject.java
index 1c6e54d43..0f827c6c3 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerObject.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerObject.java
@@ -1,97 +1,97 @@
-package com.thatgravyboat.skyblockhud.tracker;
-
-import com.google.gson.JsonObject;
-import com.thatgravyboat.skyblockhud.location.Locations;
-import java.util.EnumSet;
-import java.util.Locale;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTBase;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.util.ResourceLocation;
-
-public class TrackerObject {
-
- private final ItemStack stack;
- private final String internalId;
- private final EnumSet<Locations> locations;
- private final boolean isEntity;
- private int count;
-
- public TrackerObject(JsonObject jsonObject, EnumSet<Locations> locations) {
- this.stack = decodeToItemStack(jsonObject);
- this.internalId = jsonObject.get("id").getAsString();
- this.isEntity = jsonObject.get("id").getAsString().contains("entity:");
- this.locations = locations;
- }
-
- public static ItemStack decodeToItemStack(JsonObject jsonObject) {
- jsonObject = jsonObject.getAsJsonObject("displayItem");
- int meta = jsonObject.get("meta").getAsInt();
- ResourceLocation itemid = new ResourceLocation(jsonObject.get("item").getAsString());
- ItemStack stack = new ItemStack(Item.itemRegistry.getObject(itemid), 0, meta);
- if (jsonObject.has("displayName")) stack.setStackDisplayName(jsonObject.get("displayName").getAsString());
- if (jsonObject.has("skullData") && itemid.getResourcePath().equals("skull") && meta == 3) {
- stack.setTagInfo("SkullOwner", getSkullTag(jsonObject.getAsJsonObject("skullData")));
- }
- if (jsonObject.has("enchanted") && jsonObject.get("enchanted").getAsBoolean()) {
- stack.setTagInfo("ench", new NBTTagList());
- }
- if (!jsonObject.get("id").getAsString().contains("entity:")) {
- NBTTagCompound extraAttributes = new NBTTagCompound();
- extraAttributes.setString("id", jsonObject.get("id").getAsString());
- stack.setTagInfo("ExtraAttributes", extraAttributes);
- }
- return stack;
- }
-
- public static NBTBase getSkullTag(JsonObject skullObject) {
- NBTTagCompound skullOwner = new NBTTagCompound();
- NBTTagCompound properties = new NBTTagCompound();
- NBTTagList textures = new NBTTagList();
- NBTTagCompound value = new NBTTagCompound();
-
- skullOwner.setString("Id", skullObject.get("id").getAsString());
-
- value.setString("Value", skullObject.get("texture").getAsString());
- textures.appendTag(value);
-
- properties.setTag("textures", textures);
-
- skullOwner.setTag("Properties", properties);
- return skullOwner;
- }
-
- public void increaseCount(int amount) {
- count += amount;
- }
-
- public void increaseCount() {
- count++;
- }
-
- public void setCount(int count) {
- this.count = count;
- }
-
- public int getCount() {
- return count;
- }
-
- public ItemStack getDisplayStack() {
- return stack;
- }
-
- public EnumSet<Locations> getLocations() {
- return locations;
- }
-
- public String getInternalId() {
- return internalId.toUpperCase(Locale.ENGLISH);
- }
-
- public boolean isEntity() {
- return isEntity;
- }
-}
+//package com.thatgravyboat.skyblockhud.tracker;
+//
+//import com.google.gson.JsonObject;
+//import com.thatgravyboat.skyblockhud.location.Locations;
+//import java.util.EnumSet;
+//import java.util.Locale;
+//import net.minecraft.item.Item;
+//import net.minecraft.item.ItemStack;
+//import net.minecraft.nbt.NBTBase;
+//import net.minecraft.nbt.NBTTagCompound;
+//import net.minecraft.nbt.NBTTagList;
+//import net.minecraft.util.ResourceLocation;
+//
+//public class TrackerObject {
+//
+// private final ItemStack stack;
+// private final String internalId;
+// private final EnumSet<Locations> locations;
+// private final boolean isEntity;
+// private int count;
+//
+// public TrackerObject(JsonObject jsonObject, EnumSet<Locations> locations) {
+// this.stack = decodeToItemStack(jsonObject);
+// this.internalId = jsonObject.get("id").getAsString();
+// this.isEntity = jsonObject.get("id").getAsString().contains("entity:");
+// this.locations = locations;
+// }
+//
+// public static ItemStack decodeToItemStack(JsonObject jsonObject) {
+// jsonObject = jsonObject.getAsJsonObject("displayItem");
+// int meta = jsonObject.get("meta").getAsInt();
+// ResourceLocation itemid = new ResourceLocation(jsonObject.get("item").getAsString());
+// ItemStack stack = new ItemStack(Item.itemRegistry.getObject(itemid), 0, meta);
+// if (jsonObject.has("displayName")) stack.setStackDisplayName(jsonObject.get("displayName").getAsString());
+// if (jsonObject.has("skullData") && itemid.getResourcePath().equals("skull") && meta == 3) {
+// stack.setTagInfo("SkullOwner", getSkullTag(jsonObject.getAsJsonObject("skullData")));
+// }
+// if (jsonObject.has("enchanted") && jsonObject.get("enchanted").getAsBoolean()) {
+// stack.setTagInfo("ench", new NBTTagList());
+// }
+// if (!jsonObject.get("id").getAsString().contains("entity:")) {
+// NBTTagCompound extraAttributes = new NBTTagCompound();
+// extraAttributes.setString("id", jsonObject.get("id").getAsString());
+// stack.setTagInfo("ExtraAttributes", extraAttributes);
+// }
+// return stack;
+// }
+//
+// public static NBTBase getSkullTag(JsonObject skullObject) {
+// NBTTagCompound skullOwner = new NBTTagCompound();
+// NBTTagCompound properties = new NBTTagCompound();
+// NBTTagList textures = new NBTTagList();
+// NBTTagCompound value = new NBTTagCompound();
+//
+// skullOwner.setString("Id", skullObject.get("id").getAsString());
+//
+// value.setString("Value", skullObject.get("texture").getAsString());
+// textures.appendTag(value);
+//
+// properties.setTag("textures", textures);
+//
+// skullOwner.setTag("Properties", properties);
+// return skullOwner;
+// }
+//
+// public void increaseCount(int amount) {
+// count += amount;
+// }
+//
+// public void increaseCount() {
+// count++;
+// }
+//
+// public void setCount(int count) {
+// this.count = count;
+// }
+//
+// public int getCount() {
+// return count;
+// }
+//
+// public ItemStack getDisplayStack() {
+// return stack;
+// }
+//
+// public EnumSet<Locations> getLocations() {
+// return locations;
+// }
+//
+// public String getInternalId() {
+// return internalId.toUpperCase(Locale.ENGLISH);
+// }
+//
+// public boolean isEntity() {
+// return isEntity;
+// }
+//}