diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index e46d8448..433eea79 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -31,7 +31,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { * This is for keeping compatibility with addons mods (Such as TinkersGregworks etc) that looped over the old materials enum */ @Deprecated - public static final Collection VALUES = new HashSet(Arrays.asList(MATERIALS_ARRAY)); + public static Collection VALUES = new LinkedHashSet(); /** * This is the Default Material returned in case no Material has been found or a NullPointer has been inserted at a location where it shouldn't happen. @@ -1281,6 +1281,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } initMaterialProperties(); //No more material addition or manipulation should be done past this point! MATERIALS_ARRAY = MATERIALS_MAP.values().toArray(new Materials[MATERIALS_MAP.size()]); //Generate standard object array. This is a lot faster to loop over. + VALUES = Arrays.asList(MATERIALS_ARRAY); OrePrefixes.initMaterialComponents(); for (Materials aMaterial : MATERIALS_ARRAY) { if (aMaterial.mMetaItemSubID >= 0) { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java index b5dab734..6d11864f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java @@ -13,6 +13,7 @@ import gregtech.common.items.behaviors.Behaviour_DataOrb; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import java.util.Arrays; import java.util.Iterator; public class GT_MetaTileEntity_Replicator @@ -84,7 +85,7 @@ public class GT_MetaTileEntity_Replicator public int getCapacity() { if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished)) { Materials tMaterial; - for (Iterator i$ = Materials.VALUES.iterator(); i$.hasNext(); sHeaviestElementMass = Math.max(sHeaviestElementMass, (int) tMaterial.getMass())) { + for (Iterator i$ = Arrays.asList(Materials.values()).iterator(); i$.hasNext(); sHeaviestElementMass = Math.max(sHeaviestElementMass, (int) tMaterial.getMass())) { tMaterial = (Materials) i$.next(); } }