From 804220fd3d7d569f43bc929bb00cb4876652d8e1 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Mon, 26 Aug 2024 19:02:17 +0200 Subject: [PATCH] Fix breakBlock using wrong block metadata (#2980) Fix long standing breakBlock bug --- .../com/elisis/gtnhlanth/common/block/ShieldedAccGlass.java | 2 +- .../github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java | 2 +- .../common/blocks/BW_TileEntityContainer_MachineBlock.java | 2 +- .../github/technus/tectech/thing/block/GodforgeGlassBlock.java | 2 +- .../github/technus/tectech/thing/block/QuantumGlassBlock.java | 2 +- src/main/java/common/blocks/BaseGTUpdateableBlock.java | 2 +- src/main/java/goodgenerator/blocks/regularBlock/Casing.java | 2 +- src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java | 2 +- .../java/gregtech/common/blocks/GT_Block_Casings_Abstract.java | 2 +- src/main/java/gregtech/common/blocks/GT_Block_Laser.java | 2 +- .../common/blocks/GregtechMetaCasingBlocksAbstract.java | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/elisis/gtnhlanth/common/block/ShieldedAccGlass.java b/src/main/java/com/elisis/gtnhlanth/common/block/ShieldedAccGlass.java index a114cead69d..bdc57f1e59b 100644 --- a/src/main/java/com/elisis/gtnhlanth/common/block/ShieldedAccGlass.java +++ b/src/main/java/com/elisis/gtnhlanth/common/block/ShieldedAccGlass.java @@ -49,7 +49,7 @@ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + if (GregTech_API.isMachineBlock(this, aMetaData)) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index 1a00d16d85d..b881f47cfa6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -108,7 +108,7 @@ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + if (GregTech_API.isMachineBlock(this, aMetaData)) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java index 0d1d9fd20b8..e7abd0e6ce2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java @@ -37,7 +37,7 @@ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + if (GregTech_API.isMachineBlock(this, aMetaData)) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } diff --git a/src/main/java/com/github/technus/tectech/thing/block/GodforgeGlassBlock.java b/src/main/java/com/github/technus/tectech/thing/block/GodforgeGlassBlock.java index 67c77f5ac4b..0ac925926c1 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/GodforgeGlassBlock.java +++ b/src/main/java/com/github/technus/tectech/thing/block/GodforgeGlassBlock.java @@ -93,7 +93,7 @@ public static void run() { @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMeta) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + if (GregTech_API.isMachineBlock(this, aMeta)) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java index 790b4f390b1..6c22595b535 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java +++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java @@ -97,7 +97,7 @@ public static void run() { @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMeta) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + if (GregTech_API.isMachineBlock(this, aMeta)) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } diff --git a/src/main/java/common/blocks/BaseGTUpdateableBlock.java b/src/main/java/common/blocks/BaseGTUpdateableBlock.java index ef61327dd75..ff38365d79c 100644 --- a/src/main/java/common/blocks/BaseGTUpdateableBlock.java +++ b/src/main/java/common/blocks/BaseGTUpdateableBlock.java @@ -50,7 +50,7 @@ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + if (GregTech_API.isMachineBlock(this, aMetaData)) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } diff --git a/src/main/java/goodgenerator/blocks/regularBlock/Casing.java b/src/main/java/goodgenerator/blocks/regularBlock/Casing.java index 9e01d783d26..c10b0f71843 100644 --- a/src/main/java/goodgenerator/blocks/regularBlock/Casing.java +++ b/src/main/java/goodgenerator/blocks/regularBlock/Casing.java @@ -97,7 +97,7 @@ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + if (GregTech_API.isMachineBlock(this, aMetaData)) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } diff --git a/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java b/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java index 6c13a9c6809..dcd2bdd8013 100644 --- a/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java +++ b/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java @@ -114,7 +114,7 @@ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + if (GregTech_API.isMachineBlock(this, aMetaData)) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } aWorld.removeTileEntity(aX, aY, aZ); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java index 59144666df7..cfa51f8e995 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java @@ -100,7 +100,7 @@ public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + if (GregTech_API.isMachineBlock(this, aMetaData)) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Laser.java b/src/main/java/gregtech/common/blocks/GT_Block_Laser.java index 7ec03ce7818..038b1142847 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Laser.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Laser.java @@ -41,7 +41,7 @@ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + if (GregTech_API.isMachineBlock(this, aMetaData)) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java index a87f6c92b39..79d9e2c4583 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java @@ -106,7 +106,7 @@ public int getRenderBlockPass() { @Override public void breakBlock(final World aWorld, final int aX, final int aY, final int aZ, final Block aBlock, final int aMetaData) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + if (GregTech_API.isMachineBlock(this, aMetaData)) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } }