diff --git a/common/src/main/java/gripe/_90/megacells/core/Loaders.java b/common/src/main/java/gripe/_90/megacells/core/Loaders.java deleted file mode 100644 index 8a48a568..00000000 --- a/common/src/main/java/gripe/_90/megacells/core/Loaders.java +++ /dev/null @@ -1,6 +0,0 @@ -package gripe._90.megacells.core; - -public enum Loaders { - FABRIC, - FORGE -} diff --git a/common/src/main/java/gripe/_90/megacells/core/Platform.java b/common/src/main/java/gripe/_90/megacells/core/Platform.java index ef065482..3f79ebd8 100644 --- a/common/src/main/java/gripe/_90/megacells/core/Platform.java +++ b/common/src/main/java/gripe/_90/megacells/core/Platform.java @@ -3,8 +3,6 @@ import net.minecraft.world.item.CreativeModeTab; public interface Platform { - Loaders getLoader(); - CreativeModeTab getCreativeTab(); boolean isAddonLoaded(Addons addon); diff --git a/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotIntegration.java b/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotIntegration.java index 0720255c..eb06f2b8 100644 --- a/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotIntegration.java +++ b/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotIntegration.java @@ -4,48 +4,30 @@ import java.util.List; +import net.minecraft.core.Registry; import net.minecraft.world.item.Item; import appeng.api.upgrades.Upgrades; import appeng.core.localization.GuiText; -import gripe._90.megacells.MEGACells; +import appbot.AppliedBotanics; public final class AppBotIntegration { - private static final Class APPBOT_ITEMS; - - static { - try { - APPBOT_ITEMS = Class.forName("appbot.%s.ABItems" - .formatted( - switch (MEGACells.PLATFORM.getLoader()) { - case FABRIC -> "fabric"; - case FORGE -> "forge"; - })); - } catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } - } - public static void initUpgrades() { AppBotItems.getPortables() .forEach(c -> Upgrades.add(GREATER_ENERGY_CARD, c, 2, GuiText.PortableCells.getTranslationKey())); for (var portable : List.of( - cell("PORTABLE_MANA_CELL_1K"), - cell("PORTABLE_MANA_CELL_4K"), - cell("PORTABLE_MANA_CELL_16K"), - cell("PORTABLE_MANA_CELL_64K"), - cell("PORTABLE_MANA_CELL_256K"))) { + cell("portable_mana_storage_cell_1k"), + cell("portable_mana_storage_cell_4k"), + cell("portable_mana_storage_cell_16k"), + cell("portable_mana_storage_cell_64k"), + cell("portable_mana_storage_cell_256k"))) { Upgrades.add(GREATER_ENERGY_CARD, portable, 2, GuiText.PortableCells.getTranslationKey()); } } private static Item cell(String name) { - try { - return (Item) APPBOT_ITEMS.getDeclaredField(name).get(null); - } catch (IllegalAccessException | NoSuchFieldException e) { - throw new RuntimeException(e); - } + return Registry.ITEM.get(AppliedBotanics.id(name)); } } diff --git a/fabric/src/main/java/gripe/_90/megacells/util/FabricPlatform.java b/fabric/src/main/java/gripe/_90/megacells/util/FabricPlatform.java index 7ff71bac..850cb9d1 100644 --- a/fabric/src/main/java/gripe/_90/megacells/util/FabricPlatform.java +++ b/fabric/src/main/java/gripe/_90/megacells/util/FabricPlatform.java @@ -7,16 +7,10 @@ import gripe._90.megacells.MEGACells; import gripe._90.megacells.core.Addons; -import gripe._90.megacells.core.Loaders; import gripe._90.megacells.core.Platform; import gripe._90.megacells.definition.MEGAItems; public final class FabricPlatform implements Platform { - @Override - public Loaders getLoader() { - return Loaders.FABRIC; - } - @Override public CreativeModeTab getCreativeTab() { return FabricItemGroupBuilder.build(MEGACells.makeId("tab"), () -> new ItemStack(MEGAItems.ITEM_CELL_256M)); diff --git a/forge/src/main/java/gripe/_90/megacells/util/forge/ForgePlatform.java b/forge/src/main/java/gripe/_90/megacells/util/forge/ForgePlatform.java index 2060559e..99f3d2dd 100644 --- a/forge/src/main/java/gripe/_90/megacells/util/forge/ForgePlatform.java +++ b/forge/src/main/java/gripe/_90/megacells/util/forge/ForgePlatform.java @@ -10,16 +10,10 @@ import gripe._90.megacells.MEGACells; import gripe._90.megacells.core.Addons; -import gripe._90.megacells.core.Loaders; import gripe._90.megacells.core.Platform; import gripe._90.megacells.definition.MEGAItems; public final class ForgePlatform implements Platform { - @Override - public Loaders getLoader() { - return Loaders.FORGE; - } - @Override public CreativeModeTab getCreativeTab() { return new CreativeModeTab(MEGACells.MODID + ".tab") {