From 570b349783baef8767ded3bcd5f7d7b2a74e19af Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Wed, 29 Jun 2022 21:42:34 +0800 Subject: init the hashmap after game loading finished (#1102) fix https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10569 the static block is executed in preload time, when the oredict isn't fully registered. now puts it in the first time the recipe check begin --- .../machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java index 7ec720984a..2ff1e998d5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java @@ -78,11 +78,12 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En private static final HashSet isImpureDust = new HashSet<>(); private static final HashSet isThermal = new HashSet<>(); private static final HashSet isOre = new HashSet<>(); + private static boolean isInit = false; private ItemStack[] sMidProduct; private int sMode = 0; private boolean sVoidStone = false; - static { + private static void initHash() { for (String name : OreDictionary.getOreNames()) { if (name == null || name.isEmpty()) continue; if (name.startsWith("crushedPurified")) { @@ -228,6 +229,11 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends GT_MetaTileEntity_En @Override public boolean checkRecipe(ItemStack aStack) { + if (!isInit) { + initHash(); + isInit = true; + } + int tCharged = MAX_PARA; List tInput = getStoredInputs(); List tInputFluid = getStoredFluids(); -- cgit