From 9083e4f97b34da73037c12328a0185f55d2f8adc Mon Sep 17 00:00:00 2001 From: Toad-Dev <748280+toad-dev@users.noreply.github.com> Date: Wed, 15 Dec 2021 19:39:44 -0800 Subject: [PATCH] Ensure that static inits in Registry happen at a defined time. There must be a better way to do this, but at least I understand why this code existed before. --- .../java/dan200/computercraft/shared/Registry.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/dan200/computercraft/shared/Registry.java b/src/main/java/dan200/computercraft/shared/Registry.java index 2f0342689..92c04d2c8 100644 --- a/src/main/java/dan200/computercraft/shared/Registry.java +++ b/src/main/java/dan200/computercraft/shared/Registry.java @@ -77,6 +77,16 @@ public final class Registry public static void init() { + // Touch each static class to force static initializers to run + // Maybe there's a better way to do this :/ + Object[] o = { + ModBlockEntities.CABLE, + ModBlocks.CABLE, + ModItems.CABLE, + ModEntities.TURTLE_PLAYER, + ModContainers.COMPUTER, + }; + TurtleUpgrades.registerTurtleUpgrades(); PocketUpgrades.registerPocketUpgrades();