diff options
author | Harry <harryyunull@gmail.com> | 2023-08-01 17:19:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-01 23:19:16 +0200 |
commit | d6b20d8bdb4b785e94d868b119d40bf7c0a71f15 (patch) | |
tree | e1aa0da4b9cc93a643452da0b32d3b926d3d595a /src/main/java/gregtech/common | |
parent | c0ecbc14dcc3181e103500e262ec6fbcb58fbf93 (diff) | |
download | GT5-Unofficial-d6b20d8bdb4b785e94d868b119d40bf7c0a71f15.tar.gz GT5-Unofficial-d6b20d8bdb4b785e94d868b119d40bf7c0a71f15.tar.bz2 GT5-Unofficial-d6b20d8bdb4b785e94d868b119d40bf7c0a71f15.zip |
Crafting input hatches: fixes (#2202)
* Fix NPEs
* spotlessApply (#2203)
Co-authored-by: GitHub GTNH Actions <>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/common')
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java index d88d8050c5..d5e546db48 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java @@ -229,6 +229,7 @@ public class GT_MetaTileEntity_Hatch_CraftingInput_ME extends GT_MetaTileEntity_ // Clean up the inserted items/liquids for (int i = 0; i < errorIndex; ++i) { var itemStack = inventoryCrafting.getStackInSlot(i); + if (itemStack == null) continue; if (itemStack.getItem() instanceof ItemFluidPacket) { // remove fluid var fluidStack = ItemFluidPacket.getFluidStack(itemStack); if (fluidStack == null) continue; diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_Slave.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_Slave.java index 51d58a38b1..fbcf674888 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_Slave.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_Slave.java @@ -158,10 +158,9 @@ public class GT_MetaTileEntity_Hatch_CraftingInput_Slave extends GT_MetaTileEnti @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (!(aPlayer instanceof EntityPlayerMP)) return super.onRightclick(aBaseMetaTileEntity, aPlayer); + if (!(aPlayer instanceof EntityPlayerMP)) return false; ItemStack dataStick = aPlayer.inventory.getCurrentItem(); - if (!ItemList.Tool_DataStick.isStackEqual(dataStick, true, true)) - return super.onRightclick(aBaseMetaTileEntity, aPlayer); + if (!ItemList.Tool_DataStick.isStackEqual(dataStick, true, true)) return false; if (!dataStick.hasTagCompound() || !"CraftingInputBuffer".equals(dataStick.stackTagCompound.getString("type"))) return false; |