Skip to content

Commit

Permalink
Replace all references of blockType with getBlockType to fix NPE down…
Browse files Browse the repository at this point in the history
…stream
  • Loading branch information
spacebuilder2020 authored and mitchej123 committed Oct 24, 2023
1 parent f54c697 commit 0da29db
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,6 @@ public void readFromNBT(NBTTagCompound compound) {

public void updateBlocks() {
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, blockType);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ public void setRange(int value) {

private void updateBlocks() {
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, blockType);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
worldObj.notifyBlocksOfNeighborChange(
xCoord + direction.offsetX,
yCoord + direction.offsetY,
zCoord + direction.offsetZ,
blockType,
getBlockType(),
direction.getOpposite().ordinal());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ public void setShouldOutput(boolean shouldOutputSignal) {

private void updateBlocks() {
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, blockType);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
worldObj.notifyBlocksOfNeighborChange(
xCoord + direction.offsetX,
yCoord + direction.offsetY,
zCoord + direction.offsetZ,
blockType,
getBlockType(),
direction.getOpposite().ordinal());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void updateState() {
}
if (structure == null) {
isActive = false;
worldObj.notifyBlockChange(xCoord, yCoord, zCoord, blockType);
worldObj.notifyBlockChange(xCoord, yCoord, zCoord, getBlockType());
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
return;
}
Expand All @@ -80,7 +80,7 @@ public void updateState() {
}
}
if (isActive != isActiveBeforeUpdate) {
worldObj.notifyBlockChange(xCoord, yCoord, zCoord, blockType);
worldObj.notifyBlockChange(xCoord, yCoord, zCoord, getBlockType());
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void updateEntity() {
if (tick % 20 == 0) {
int comparatorOut = (int) (getEnergyStored() / getMaxEnergyStored() * 15D);
if (comparatorOut != lastCheckCompOverride) {
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, blockType);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
lastCheckCompOverride = comparatorOut;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void updateEntity() {
int comparatorOutput = core.getComparatorOutput(comparatorMode);
if (comparatorOutput != comparatorOutputCache) {
comparatorOutputCache = comparatorOutput;
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, blockType);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void updateEntity() {
int comparatorOutput = core.getComparatorOutput(comparatorMode);
if (comparatorOutput != comparatorOutputCache) {
comparatorOutputCache = comparatorOutput;
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, blockType);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
}
}
}
Expand Down

0 comments on commit 0da29db

Please sign in to comment.