From 9ed1535477904c4cd116abc838ed48f91fef07a0 Mon Sep 17 00:00:00 2001 From: shartte Date: Tue, 8 Sep 2020 22:28:30 +0200 Subject: [PATCH] Fixes #4661: Do not update a tile entity when it's in an unloaded chunk (i.e. during chunk unloading) (#4708) --- src/main/java/appeng/tile/AEBaseTileEntity.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/appeng/tile/AEBaseTileEntity.java b/src/main/java/appeng/tile/AEBaseTileEntity.java index 9dae932f3..02fc63c1d 100644 --- a/src/main/java/appeng/tile/AEBaseTileEntity.java +++ b/src/main/java/appeng/tile/AEBaseTileEntity.java @@ -253,9 +253,11 @@ public class AEBaseTileEntity extends TileEntity implements IOrientable, ICommon if (this.renderFragment > 0) { this.renderFragment |= 1; } else { + // Clearing the cached model-data is always harmless regardless of status + this.requestModelDataUpdate(); + // TODO: Optimize Network Load - if (this.world != null && !this.isRemoved()) { - this.requestModelDataUpdate(); + if (this.world != null && !this.isRemoved() && !notLoaded()) { boolean alreadyUpdated = false; // Let the block update it's own state with our internal state changes @@ -368,7 +370,6 @@ public class AEBaseTileEntity extends TileEntity implements IOrientable, ICommon * null means nothing to store... * * @param from source of settings - * * @return compound of source */ public CompoundNBT downloadSettings(final SettingsFrom from) {