Browse Source

Collection of resourceHash

postwipe-hostile
MagicBot 6 months ago
parent
commit
381139af35
  1. 2
      src/engine/mbEnums.java
  2. 2
      src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java

2
src/engine/mbEnums.java

@ -2741,6 +2741,7 @@ public class mbEnums {
public static HashMap<Integer, ResourceType> templateLookup = new HashMap<>(); public static HashMap<Integer, ResourceType> templateLookup = new HashMap<>();
public static HashMap<Integer, ResourceType> templateHashLookup = new HashMap<>(); public static HashMap<Integer, ResourceType> templateHashLookup = new HashMap<>();
public static HashMap<Integer, ResourceType> resourceHashLookup = new HashMap<>();
public int templateID; public int templateID;
public ItemTemplate template; public ItemTemplate template;
public int resourceHash; public int resourceHash;
@ -2762,6 +2763,7 @@ public class mbEnums {
for (ResourceType resourceType : ResourceType.values()) { for (ResourceType resourceType : ResourceType.values()) {
templateLookup.put(resourceType.templateID, resourceType); templateLookup.put(resourceType.templateID, resourceType);
templateHashLookup.put(resourceType.templateHash, resourceType); templateHashLookup.put(resourceType.templateHash, resourceType);
resourceHashLookup.put(resourceType.resourceHash, resourceType);
} }
} }

2
src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java

@ -50,7 +50,7 @@ public class ArcMineChangeProductionMsgHandler extends AbstractClientMsgHandler
//make sure valid resource //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) if (resource == null)
return true; return true;

Loading…
Cancel
Save