From fad429671b44238a6efbf527fb500bb3810cb461 Mon Sep 17 00:00:00 2001 From: ramidzkh Date: Sat, 28 May 2022 08:48:05 +1000 Subject: [PATCH] Stop the server crashing on load (#5) --- src/main/java/appbot/ABItems.java | 2 -- src/main/java/appbot/client/AppliedBotanicsClient.java | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/appbot/ABItems.java b/src/main/java/appbot/ABItems.java index e6d5420..05905f8 100644 --- a/src/main/java/appbot/ABItems.java +++ b/src/main/java/appbot/ABItems.java @@ -3,7 +3,6 @@ import static appbot.AppliedBotanics.id; import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder; -import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; import net.minecraft.Util; import net.minecraft.core.Registry; import net.minecraft.world.entity.player.Player; @@ -106,7 +105,6 @@ public void openChestGui(Player player, IChestOrDrive chest, ICellHandler cellHa for (var tier : Tier.values()) { var cell = get(tier); - ColorProviderRegistry.ITEM.register(BasicStorageCell::getColor, cell); StorageCellModels.registerModel(cell, id("block/drive/cells/" + Registry.ITEM.getKey(cell).getPath())); } } diff --git a/src/main/java/appbot/client/AppliedBotanicsClient.java b/src/main/java/appbot/client/AppliedBotanicsClient.java index bfb5eaf..36a1142 100644 --- a/src/main/java/appbot/client/AppliedBotanicsClient.java +++ b/src/main/java/appbot/client/AppliedBotanicsClient.java @@ -1,5 +1,8 @@ package appbot.client; +import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; + +import appbot.ABItems; import appbot.ABMenus; import appbot.ae2.ManaKey; import appbot.ae2.ManaKeyType; @@ -7,6 +10,7 @@ import appeng.api.client.AEStackRendering; import appeng.client.gui.me.common.MEStorageScreen; import appeng.init.client.InitScreens; +import appeng.items.storage.BasicStorageCell; import appeng.menu.me.common.MEStorageMenu; public interface AppliedBotanicsClient { @@ -14,6 +18,10 @@ public interface AppliedBotanicsClient { static void initialize() { AEStackRendering.register(ManaKeyType.TYPE, ManaKey.class, new ManaRenderer()); + for (var tier : ABItems.Tier.values()) { + ColorProviderRegistry.ITEM.register(BasicStorageCell::getColor, ABItems.get(tier)); + } + InitScreens.>register(ABMenus.PORTABLE_MANA_CELL_TYPE, MEStorageScreen::new, "/screens/terminals/portable_mana_cell.json"); }