From a2e23af5cbd85d085ce2003402560aad4bb87a52 Mon Sep 17 00:00:00 2001 From: iamblackornot Date: Sat, 21 Oct 2023 13:16:22 +0300 Subject: A new approach for block updates in BaseMetaTileEntity (#2342) * - added 0,5s cooldown on BaseMetaTileEntity texture render update * - changed to RandomCooldown to make visual representation of the target object more relevant to its state * - implemented a BlockUpdateHandler, making the update cooldowns chunk-based - left commented out debug code * - now BaseMetaTileEntity tracks last time a texture update was issued and skips update if parent chunk was already updated since last update issue * - reworked BlockUpdateHandler to a singleton doing update work on client tick, this way update logic is fully encapsulated and gets rid of some comparisons needed to sync updates * - fixed a bug with crash on quitting the game - forgot to add moved sources - cleaned up debug code - added description commentary * - updated buildscript * - switched to internal tick counter, cause server time is unreliable and crashes client https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/14742 - removed subclass aliases - switched to XSTR instead of java's Random - IllegalArugmentException instead of InvalidParameterException - added client side config option to enable/disable this feature (by default is off) --------- Co-authored-by: iamblackornot --- src/main/java/gregtech/loaders/preload/GT_PreLoad.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/gregtech/loaders') diff --git a/src/main/java/gregtech/loaders/preload/GT_PreLoad.java b/src/main/java/gregtech/loaders/preload/GT_PreLoad.java index 730aba52a0..749cb06eda 100644 --- a/src/main/java/gregtech/loaders/preload/GT_PreLoad.java +++ b/src/main/java/gregtech/loaders/preload/GT_PreLoad.java @@ -835,6 +835,8 @@ public class GT_PreLoad { .get("render", "RenderItemDurabilityBar", true); GT_Mod.gregtechproxy.mRenderItemChargeBar = GregTech_API.sClientDataFile .get("render", "RenderItemChargeBar", true); + GT_Mod.gregtechproxy.mUseBlockUpdateHandler = GregTech_API.sClientDataFile + .get("render", "UseBlockUpdateHandler", false); GT_Mod.gregtechproxy.mCoverTabsVisible = GregTech_API.sClientDataFile .get("interface", "DisplayCoverTabs", true); -- cgit