aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYang Xizhi <60341015+GlodBlock@users.noreply.github.com>2022-06-29 21:42:34 +0800
committerGitHub <noreply@github.com>2022-06-29 15:42:34 +0200
commit570b349783baef8767ded3bcd5f7d7b2a74e19af (patch)
tree297651baf6283e73348d513c9d75ae06af912302 /src
parent0b1118acb99258d7fe1b4905254a9ba403edf49a (diff)
downloadGT5-Unofficial-570b349783baef8767ded3bcd5f7d7b2a74e19af.tar.gz
GT5-Unofficial-570b349783baef8767ded3bcd5f7d7b2a74e19af.tar.bz2
GT5-Unofficial-570b349783baef8767ded3bcd5f7d7b2a74e19af.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java8
1 files changed, 7 insertions, 1 deletions
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<Integer> isImpureDust = new HashSet<>();
private static final HashSet<Integer> isThermal = new HashSet<>();
private static final HashSet<Integer> 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<ItemStack> tInput = getStoredInputs();
List<FluidStack> tInputFluid = getStoredFluids();