Skip to content

Commit

Permalink
Fix potential MetaTileEntity NPE when calling a server side method on…
Browse files Browse the repository at this point in the history
… client (GregTechCEu#2437)
  • Loading branch information
ghzdude authored Apr 4, 2024
1 parent 1e98892 commit 1e4ca34
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -826,18 +826,20 @@ private void updateLightValue() {
}

public void update() {
if (!allowTickAcceleration()) {
if (!getWorld().isRemote && !allowTickAcceleration()) {
int currentTick = FMLCommonHandler.instance().getMinecraftServerInstance().getTickCounter();
if (currentTick == lastTick) {
return;
}
lastTick = currentTick;
}

for (MTETrait mteTrait : this.mteTraits.values()) {
if (shouldUpdate(mteTrait)) {
mteTrait.update();
}
}

if (!getWorld().isRemote) {
updateCovers();
} else {
Expand Down

0 comments on commit 1e4ca34

Please sign in to comment.