Skip to content

Commit

Permalink
Fix excessive packets & re-renders with AEHostable parts (GregTechCEu…
Browse files Browse the repository at this point in the history
  • Loading branch information
M-W-K authored Jun 2, 2024
1 parent 00f3b4d commit 9ce8a20
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public abstract class MetaTileEntityAEHostablePart<T extends IAEStack<T>> extend
private AENetworkProxy aeProxy;
private int meUpdateTick;
protected boolean isOnline;
protected boolean lastOnline;

public MetaTileEntityAEHostablePart(ResourceLocation metaTileEntityId, int tier, boolean isExportHatch,
Class<? extends IStorageChannel<T>> storageChannel) {
Expand Down Expand Up @@ -149,8 +150,9 @@ public boolean updateMEStatus() {
} else {
this.isOnline = false;
}
if (!getWorld().isRemote) {
if (!getWorld().isRemote && this.isOnline != this.lastOnline) {
writeCustomData(UPDATE_ONLINE_STATUS, buf -> buf.writeBoolean(this.isOnline));
this.lastOnline = this.isOnline;
}
return this.isOnline;
}
Expand Down

0 comments on commit 9ce8a20

Please sign in to comment.