diff options
author | kuba6000 <kuba.123123.6000@gmail.com> | 2023-11-13 19:33:04 +0100 |
---|---|---|
committer | Martin Robertz <dream-master@gmx.net> | 2023-11-14 10:46:30 +0100 |
commit | 9bb670b22c2c15da6530c05a8be1b0d54b462e6b (patch) | |
tree | f5b1cf0f7fc9a442456640e96f0ee3308e786b35 /src/main/java/com | |
parent | 1853416b9d65b5ed523f51ce23b51a0deb48fa22 (diff) | |
download | GT5-Unofficial-9bb670b22c2c15da6530c05a8be1b0d54b462e6b.tar.gz GT5-Unofficial-9bb670b22c2c15da6530c05a8be1b0d54b462e6b.tar.bz2 GT5-Unofficial-9bb670b22c2c15da6530c05a8be1b0d54b462e6b.zip |
Fix EIC piston reset
Former-commit-id: 270d20ceb76e64b7ec2d5234985245f1465a4acc
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 51683d2376..8aab42be9e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -123,7 +123,7 @@ public class GT_TileEntity_ElectricImplosionCompressor .casingIndex(CASING_INDEX).dot(2).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings2, 0)), onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 4)))) - .addElement('N', new IStructureElement<GT_TileEntity_ElectricImplosionCompressor>() { + .addElement('N', new IStructureElement<>() { // Much of this based on StructureUtility.ofBlocksTiered private final List<Pair<Block, Integer>> tiers = getAllBlockTiers(); @@ -336,17 +336,17 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public void stopMachine() { - this.resetPiston(); + this.resetPiston(this.mBlockTier); super.stopMachine(); } - private void resetPiston() { + private void resetPiston(int tier) { if (!pistonEnabled) return; IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); if (!aBaseMetaTileEntity.isServerSide()) return; if (!this.piston) { List<Pair<Block, Integer>> tiers = getAllBlockTiers(); - Pair<Block, Integer> tieredBlock = tiers.get(Math.min(this.mBlockTier, tiers.size()) - 1); + Pair<Block, Integer> tieredBlock = tiers.get(Math.min(tier, tiers.size()) - 1); this.chunkCoordinates.forEach(c -> { // Don't replace real blocks in case user has placed something (e.g. tier upgrade) if (aBaseMetaTileEntity.getWorld().isAirBlock(c.posX, c.posY, c.posZ)) { @@ -407,6 +407,7 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + int pistonTier = this.mBlockTier; this.mCasing = 0; int mMaxHatchTier = 0; this.setBlockTier(0); @@ -422,7 +423,7 @@ public class GT_TileEntity_ElectricImplosionCompressor this.activatePiston(); return true; } - this.resetPiston(); + this.resetPiston(pistonTier); return false; } |