Skip to content

Commit

Permalink
Fix breakBlock using wrong block metadata (GTNewHorizons#2980)
Browse files Browse the repository at this point in the history
Fix long standing breakBlock bug
  • Loading branch information
NotAPenguin0 authored Aug 26, 2024
1 parent 8c40645 commit 804220f
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/common/blocks/BaseGTUpdateableBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gregtech/common/blocks/GT_Block_Laser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 804220f

Please sign in to comment.