diff options
author | Lyfts <127234178+Lyfts@users.noreply.github.com> | 2024-01-27 23:57:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-27 23:57:47 +0100 |
commit | 692b6fa6eb5ce19bcb92a3b52d551f076a3ad4ed (patch) | |
tree | 02ceab04ffed87a5e16cd2c5f1a2b6210a1fcb37 /src | |
parent | 46c33e464cf22464f8c619e223cea2c011076273 (diff) | |
download | GT5-Unofficial-692b6fa6eb5ce19bcb92a3b52d551f076a3ad4ed.tar.gz GT5-Unofficial-692b6fa6eb5ce19bcb92a3b52d551f076a3ad4ed.tar.bz2 GT5-Unofficial-692b6fa6eb5ce19bcb92a3b52d551f076a3ad4ed.zip |
Fix nano forge nei preview (#2475)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_NanoForge.java | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_NanoForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_NanoForge.java index c251147587..0e32936a26 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_NanoForge.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_NanoForge.java @@ -262,21 +262,20 @@ public class GT_MetaTileEntity_NanoForge extends @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mSpecialTier = 0; - if (aStack == null) return false; - if (aStack.isItemEqual(Materials.Carbon.getNanite(1)) && checkPiece(STRUCTURE_PIECE_MAIN, 4, 37, 1)) { - mSpecialTier = 1; - } + if (checkPiece(STRUCTURE_PIECE_MAIN, 4, 37, 1) && aStack != null) { + if (aStack.isItemEqual(Materials.Carbon.getNanite(1))) { + mSpecialTier = 1; + } - if (aStack.isItemEqual(Materials.Neutronium.getNanite(1)) && checkPiece(STRUCTURE_PIECE_MAIN, 4, 37, 1) - && checkPiece(STRUCTURE_PIECE_TIER2, -7, 14, 4)) { - mSpecialTier = 2; - } + if (aStack.isItemEqual(Materials.Neutronium.getNanite(1)) && checkPiece(STRUCTURE_PIECE_TIER2, -7, 14, 4)) { + mSpecialTier = 2; + } - if (aStack.isItemEqual(MaterialsUEVplus.TranscendentMetal.getNanite(1)) - && checkPiece(STRUCTURE_PIECE_MAIN, 4, 37, 1) - && checkPiece(STRUCTURE_PIECE_TIER2, -7, 14, 4) - && checkPiece(STRUCTURE_PIECE_TIER3, 14, 26, 4)) { - mSpecialTier = 3; + if (aStack.isItemEqual(MaterialsUEVplus.TranscendentMetal.getNanite(1)) + && checkPiece(STRUCTURE_PIECE_TIER2, -7, 14, 4) + && checkPiece(STRUCTURE_PIECE_TIER3, 14, 26, 4)) { + mSpecialTier = 3; + } } if (mMaintenanceHatches.size() != 1 || mInputBusses.isEmpty() @@ -310,8 +309,8 @@ public class GT_MetaTileEntity_NanoForge extends @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (mMachine) return -1; - int built = 0; - built += survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 4, 37, 1, elementBudget, env, false, true); + int built = survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 4, 37, 1, elementBudget, env, false, true); + if (built >= 0) return built; if (stackSize.stackSize > 1) { built += survivialBuildPiece(STRUCTURE_PIECE_TIER2, stackSize, -7, 14, 4, elementBudget, env, false, true); } |