From fa87ed0e17ffce8c097cbadc54f5a01877a270a3 Mon Sep 17 00:00:00 2001 From: tommyTT <3993801+tommyTT@users.noreply.github.com> Date: Sat, 5 Jan 2019 18:34:45 +0100 Subject: [PATCH] Bugfix attempt to remove render lag (see WayofTime#1457) (#1458) Simplified the whole branch since it got really messed up --- .../java/WayofTime/bloodmagic/tile/TileDemonCrystal.java | 8 ++++++-- .../java/WayofTime/bloodmagic/tile/base/TileBase.java | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java index d856cc42..052e8e2a 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java @@ -35,8 +35,6 @@ public class TileDemonCrystal extends TileTicking { if (getWorld().isRemote) { - if(internalCounter % 20 == 0) - getWorld().markBlockRangeForRenderUpdate(pos, pos); return; } @@ -208,4 +206,10 @@ public class TileDemonCrystal extends TileTicking { this.placement = placement; } + + @Override + protected void onDataPacketClientReceived() { + super.onDataPacketClientReceived(); + notifyUpdate(); + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/tile/base/TileBase.java b/src/main/java/WayofTime/bloodmagic/tile/base/TileBase.java index e39ba05f..18344853 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/base/TileBase.java +++ b/src/main/java/WayofTime/bloodmagic/tile/base/TileBase.java @@ -97,6 +97,14 @@ public class TileBase extends TileEntity { public final void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { super.onDataPacket(net, pkt); readFromNBT(pkt.getNbtCompound()); + onDataPacketClientReceived(); + } + + /** + * Hook for performing client side updates after data packets are received and processed + */ + protected void onDataPacketClientReceived() { + // noop } @Override