From 381139af35da55cfaed22f72a1f9a31a2936fbc7 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 26 Jun 2024 12:31:08 -0400 Subject: [PATCH] Collection of resourceHash --- src/engine/mbEnums.java | 2 ++ .../net/client/handlers/ArcMineChangeProductionMsgHandler.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/mbEnums.java b/src/engine/mbEnums.java index fa8d81e5..83b9e8c4 100644 --- a/src/engine/mbEnums.java +++ b/src/engine/mbEnums.java @@ -2741,6 +2741,7 @@ public class mbEnums { public static HashMap templateLookup = new HashMap<>(); public static HashMap templateHashLookup = new HashMap<>(); + public static HashMap resourceHashLookup = new HashMap<>(); public int templateID; public ItemTemplate template; public int resourceHash; @@ -2762,6 +2763,7 @@ public class mbEnums { for (ResourceType resourceType : ResourceType.values()) { templateLookup.put(resourceType.templateID, resourceType); templateHashLookup.put(resourceType.templateHash, resourceType); + resourceHashLookup.put(resourceType.resourceHash, resourceType); } } diff --git a/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java b/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java index 4488c083..f4fcfe96 100644 --- a/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java @@ -50,7 +50,7 @@ public class ArcMineChangeProductionMsgHandler extends AbstractClientMsgHandler //make sure valid resource - mbEnums.ResourceType resource = mbEnums.ResourceType.templateHashLookup.get(changeProductionMsg.getResourceHash()); + mbEnums.ResourceType resource = mbEnums.ResourceType.resourceHashLookup.get(changeProductionMsg.getResourceHash()); if (resource == null) return true;