aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2023-01-25 19:43:51 +0100
committerGitHub <noreply@github.com>2023-01-25 19:43:51 +0100
commitf1a5ba28e92da4f46b39da27277b1c8b7a6ec4bb (patch)
treef8ad2c2ab2f859446345e189e62007b3e28b44c0 /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java
parentf1ce88fb8e98b41a10ba374d32cb312b949ba8ef (diff)
downloadnotenoughupdates-f1a5ba28e92da4f46b39da27277b1c8b7a6ec4bb.tar.gz
notenoughupdates-f1a5ba28e92da4f46b39da27277b1c8b7a6ec4bb.tar.bz2
notenoughupdates-f1a5ba28e92da4f46b39da27277b1c8b7a6ec4bb.zip
Annotation registering (and also some comptime performance) (#554)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java
index 15fc8ef8..dad801ec 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCustomizeManager.java
@@ -21,6 +21,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
+import io.github.moulberry.notenoughupdates.NEUManager;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.core.ChromaColour;
import net.minecraft.client.Minecraft;
@@ -67,8 +68,6 @@ public class ItemCustomizeManager {
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
private static ItemDataMap itemDataMap = new ItemDataMap();
- private static final HashMap<Integer, String> itemUuidCache = new HashMap<>();
-
public static class ItemDataMap {
public HashMap<String, ItemData> itemData = new HashMap<>();
}
@@ -269,25 +268,10 @@ public class ItemCustomizeManager {
return CUSTOM_GLINT_TEXTURE;
}
- public static String getUuidForItem(ItemStack stack) {
- if (!stack.hasTagCompound()) return null;
-
- int nbtHash = stack.getTagCompound().hashCode();
-
- if (itemUuidCache.containsKey(nbtHash)) {
- return itemUuidCache.get(nbtHash);
- }
-
- String uuid = NotEnoughUpdates.INSTANCE.manager.getUUIDForItem(stack);
-
- itemUuidCache.put(nbtHash, uuid);
- return uuid;
- }
-
public static ItemData getDataForItem(ItemStack stack) {
if (stack == null) return null;
- String uuid = getUuidForItem(stack);
+ String uuid = NEUManager.getUUIDForItem(stack);
if (uuid == null) {
return null;
@@ -297,7 +281,6 @@ public class ItemCustomizeManager {
}
public static void tick() {
- itemUuidCache.clear();
disableTextureBinding = false;
}