diff --git a/common/src/main/java/gripe/_90/megacells/client/render/MEGACraftingUnitModelProvider.java b/common/src/main/java/gripe/_90/megacells/client/render/MEGACraftingUnitModelProvider.java index c8948c3d..b47960d0 100644 --- a/common/src/main/java/gripe/_90/megacells/client/render/MEGACraftingUnitModelProvider.java +++ b/common/src/main/java/gripe/_90/megacells/client/render/MEGACraftingUnitModelProvider.java @@ -19,7 +19,6 @@ import gripe._90.megacells.util.Utils; public class MEGACraftingUnitModelProvider extends AbstractCraftingUnitModelProvider { - private static final List MATERIALS = new ArrayList<>(); protected static final Material RING_CORNER = texture("ring_corner"); diff --git a/common/src/main/java/gripe/_90/megacells/datagen/CommonModelSupplier.java b/common/src/main/java/gripe/_90/megacells/datagen/CommonModelSupplier.java index 27f92fe3..559a5ecc 100644 --- a/common/src/main/java/gripe/_90/megacells/datagen/CommonModelSupplier.java +++ b/common/src/main/java/gripe/_90/megacells/datagen/CommonModelSupplier.java @@ -16,9 +16,6 @@ import gripe._90.megacells.integration.appbot.AppBotItems; public class CommonModelSupplier { - private CommonModelSupplier() { - } - public static final List> FLAT_ITEMS = Lists.newArrayList(MEGAItems.MEGA_ITEM_CELL_HOUSING, MEGAItems.MEGA_FLUID_CELL_HOUSING, MEGAItems.CELL_COMPONENT_1M, MEGAItems.CELL_COMPONENT_4M, MEGAItems.CELL_COMPONENT_16M, MEGAItems.CELL_COMPONENT_64M, MEGAItems.CELL_COMPONENT_256M, diff --git a/common/src/main/java/gripe/_90/megacells/datagen/CommonRecipeSupplier.java b/common/src/main/java/gripe/_90/megacells/datagen/CommonRecipeSupplier.java index 5d0f4106..331962f9 100644 --- a/common/src/main/java/gripe/_90/megacells/datagen/CommonRecipeSupplier.java +++ b/common/src/main/java/gripe/_90/megacells/datagen/CommonRecipeSupplier.java @@ -33,9 +33,6 @@ import gripe._90.megacells.util.Utils; public class CommonRecipeSupplier { - private CommonRecipeSupplier() { - } - public static void buildRecipes(Consumer consumer) { // spotless:off component(consumer, MEGAItems.TIER_1M, StorageTier.SIZE_256K, AEItems.SKY_DUST.asItem()); diff --git a/common/src/main/java/gripe/_90/megacells/definition/MEGABlockEntities.java b/common/src/main/java/gripe/_90/megacells/definition/MEGABlockEntities.java index 610d79f3..6ce8998a 100644 --- a/common/src/main/java/gripe/_90/megacells/definition/MEGABlockEntities.java +++ b/common/src/main/java/gripe/_90/megacells/definition/MEGABlockEntities.java @@ -10,14 +10,11 @@ import net.minecraft.core.BlockPos; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import appeng.block.AEBaseEntityBlock; import appeng.blockentity.AEBaseBlockEntity; -import appeng.blockentity.ClientTickingBlockEntity; -import appeng.blockentity.ServerTickingBlockEntity; import appeng.blockentity.crafting.CraftingBlockEntity; import appeng.blockentity.crafting.CraftingMonitorBlockEntity; import appeng.blockentity.networking.EnergyCellBlockEntity; @@ -27,9 +24,6 @@ @SuppressWarnings({ "unused", "unchecked" }) public final class MEGABlockEntities { - private MEGABlockEntities() { - } - public static void init() { // controls static load order Utils.LOGGER.info("Initialised block entities."); @@ -68,20 +62,9 @@ private static BlockEntityType create(String id AEBaseBlockEntity.registerBlockEntityItem(type, blockDefinitions[0].asItem()); - // If the block entity classes implement specific interfaces, automatically register them - // as tickers with the blocks that create that entity. - BlockEntityTicker serverTicker = null; - if (ServerTickingBlockEntity.class.isAssignableFrom(entityClass)) { - serverTicker = (level, pos, state, entity) -> ((ServerTickingBlockEntity) entity).serverTick(); - } - BlockEntityTicker clientTicker = null; - if (ClientTickingBlockEntity.class.isAssignableFrom(entityClass)) { - clientTicker = (level, pos, state, entity) -> ((ClientTickingBlockEntity) entity).clientTick(); - } - for (var block : blocks) { AEBaseEntityBlock baseBlock = (AEBaseEntityBlock) block; - baseBlock.setBlockEntity(entityClass, type, clientTicker, serverTicker); + baseBlock.setBlockEntity(entityClass, type, null, null); } return type; diff --git a/common/src/main/java/gripe/_90/megacells/definition/MEGABlocks.java b/common/src/main/java/gripe/_90/megacells/definition/MEGABlocks.java index 3617dcd3..fb08aa99 100644 --- a/common/src/main/java/gripe/_90/megacells/definition/MEGABlocks.java +++ b/common/src/main/java/gripe/_90/megacells/definition/MEGABlocks.java @@ -27,9 +27,6 @@ import gripe._90.megacells.util.Utils; public final class MEGABlocks { - private MEGABlocks() { - } - public static void init() { // controls static load order Utils.LOGGER.info("Initialised blocks."); diff --git a/common/src/main/java/gripe/_90/megacells/definition/MEGAItems.java b/common/src/main/java/gripe/_90/megacells/definition/MEGAItems.java index afb26f3c..9c3298b6 100644 --- a/common/src/main/java/gripe/_90/megacells/definition/MEGAItems.java +++ b/common/src/main/java/gripe/_90/megacells/definition/MEGAItems.java @@ -23,9 +23,6 @@ import gripe._90.megacells.util.Utils; public final class MEGAItems { - private MEGAItems() { - } - public static void init() { // controls static load order Utils.LOGGER.info("Initialised items."); diff --git a/common/src/main/java/gripe/_90/megacells/init/InitStorageCells.java b/common/src/main/java/gripe/_90/megacells/init/InitStorageCells.java index eca86af4..40a93b3f 100644 --- a/common/src/main/java/gripe/_90/megacells/init/InitStorageCells.java +++ b/common/src/main/java/gripe/_90/megacells/init/InitStorageCells.java @@ -12,7 +12,6 @@ import gripe._90.megacells.util.Utils; public class InitStorageCells { - public static void init() { Stream.of(MEGAItems.getItemCells(), MEGAItems.getItemPortables()).flatMap(Collection::stream) .forEach(c -> StorageCellModels.registerModel(c, Utils.makeId("block/drive/cells/mega_item_cell"))); diff --git a/common/src/main/java/gripe/_90/megacells/init/InitUpgrades.java b/common/src/main/java/gripe/_90/megacells/init/InitUpgrades.java index 6eeed3e4..10545f4d 100644 --- a/common/src/main/java/gripe/_90/megacells/init/InitUpgrades.java +++ b/common/src/main/java/gripe/_90/megacells/init/InitUpgrades.java @@ -9,6 +9,7 @@ import gripe._90.megacells.definition.MEGAItems; import gripe._90.megacells.integration.ae2wt.AE2WTIntegration; import gripe._90.megacells.integration.appbot.AppBotIntegration; +import gripe._90.megacells.util.Utils; public class InitUpgrades { public static void init() { @@ -59,7 +60,12 @@ public static void init() { Upgrades.add(MEGAItems.GREATER_ENERGY_CARD, portableCell, 2, portableCellGroup); } - AE2WTIntegration.initUpgrades(); - AppBotIntegration.initUpgrades(); + if (Utils.PLATFORM.isModLoaded("ae2wtlib")) { + AE2WTIntegration.initUpgrades(); + } + + if (Utils.PLATFORM.isModLoaded("appbot")) { + AppBotIntegration.initUpgrades(); + } } } diff --git a/common/src/main/java/gripe/_90/megacells/integration/ae2wt/AE2WTIntegration.java b/common/src/main/java/gripe/_90/megacells/integration/ae2wt/AE2WTIntegration.java index af37ba43..6ec8cb61 100644 --- a/common/src/main/java/gripe/_90/megacells/integration/ae2wt/AE2WTIntegration.java +++ b/common/src/main/java/gripe/_90/megacells/integration/ae2wt/AE2WTIntegration.java @@ -7,14 +7,8 @@ import gripe._90.megacells.util.Utils; public final class AE2WTIntegration { - private AE2WTIntegration() { - } - public static void initUpgrades() { - if (Utils.PLATFORM.isModLoaded("ae2wtlib")) { - UpgradeHelper.addUpgradeToAllTerminals(GREATER_ENERGY_CARD, 0); - } - + UpgradeHelper.addUpgradeToAllTerminals(GREATER_ENERGY_CARD, 0); Utils.LOGGER.info("Initialised AE2WT integration."); } } 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 b724743f..ff4a0ff8 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 @@ -9,22 +9,15 @@ import appeng.api.upgrades.Upgrades; import appeng.core.localization.GuiText; -import gripe._90.megacells.util.Utils; - public final class AppBotIntegration { - private AppBotIntegration() { - } - public static void initUpgrades() { - if (Utils.PLATFORM.isModLoaded("appbot")) { - AppBotItems.getPortables() - .forEach(c -> Upgrades.add(GREATER_ENERGY_CARD, c, 2, GuiText.PortableCells.getTranslationKey())); + AppBotItems.getPortables() + .forEach(c -> Upgrades.add(GREATER_ENERGY_CARD, c, 2, GuiText.PortableCells.getTranslationKey())); - for (var portable : List.of(ABItems.PORTABLE_MANA_CELL_1K, ABItems.PORTABLE_MANA_CELL_4K, - ABItems.PORTABLE_MANA_CELL_16K, ABItems.PORTABLE_MANA_CELL_64K, - ABItems.PORTABLE_MANA_CELL_256K)) { - Upgrades.add(GREATER_ENERGY_CARD, portable, 2, GuiText.PortableCells.getTranslationKey()); - } + for (var portable : List.of(ABItems.PORTABLE_MANA_CELL_1K, ABItems.PORTABLE_MANA_CELL_4K, + ABItems.PORTABLE_MANA_CELL_16K, ABItems.PORTABLE_MANA_CELL_64K, + ABItems.PORTABLE_MANA_CELL_256K)) { + Upgrades.add(GREATER_ENERGY_CARD, portable, 2, GuiText.PortableCells.getTranslationKey()); } } } diff --git a/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotItems.java b/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotItems.java index 471fc128..da7721d2 100644 --- a/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotItems.java +++ b/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotItems.java @@ -13,9 +13,6 @@ import gripe._90.megacells.util.Utils; public final class AppBotItems { - private AppBotItems() { - } - public static void init() { // controls static load order Utils.LOGGER.info("Initialised Applied Botanics integration."); diff --git a/common/src/main/java/gripe/_90/megacells/item/MEGAPortableCell.java b/common/src/main/java/gripe/_90/megacells/item/MEGAPortableCell.java index 099ab4a1..1fcbe890 100644 --- a/common/src/main/java/gripe/_90/megacells/item/MEGAPortableCell.java +++ b/common/src/main/java/gripe/_90/megacells/item/MEGAPortableCell.java @@ -14,7 +14,6 @@ import gripe._90.megacells.util.Utils; public class MEGAPortableCell extends PortableCellItem { - private final StorageTier tier; public MEGAPortableCell(Properties props, StorageTier tier, AEKeyType keyType, MenuType menu) { diff --git a/common/src/main/java/gripe/_90/megacells/item/cell/BulkCellHandler.java b/common/src/main/java/gripe/_90/megacells/item/cell/BulkCellHandler.java index 73a815ff..7f459b33 100644 --- a/common/src/main/java/gripe/_90/megacells/item/cell/BulkCellHandler.java +++ b/common/src/main/java/gripe/_90/megacells/item/cell/BulkCellHandler.java @@ -17,7 +17,6 @@ import gripe._90.megacells.item.MEGABulkCell; public class BulkCellHandler implements ICellHandler { - public static final BulkCellHandler INSTANCE = new BulkCellHandler(); private BulkCellHandler() { diff --git a/common/src/main/java/gripe/_90/megacells/item/cell/CompressionHandler.java b/common/src/main/java/gripe/_90/megacells/item/cell/CompressionHandler.java index 0b8ab15f..734291f1 100644 --- a/common/src/main/java/gripe/_90/megacells/item/cell/CompressionHandler.java +++ b/common/src/main/java/gripe/_90/megacells/item/cell/CompressionHandler.java @@ -21,13 +21,13 @@ import gripe._90.megacells.util.Utils; public class CompressionHandler { - private CompressionHandler() { - } - public static final CompressionHandler INSTANCE = new CompressionHandler(); private final List validRecipes = new ObjectArrayList<>(); + private CompressionHandler() { + } + private boolean isCompressionRecipe(CraftingRecipe recipe) { return (recipe.getIngredients().size() == 4 || recipe.getIngredients().size() == 9) && recipe.getIngredients().stream().distinct().limit(2).count() == 1 diff --git a/common/src/main/java/gripe/_90/megacells/util/Utils.java b/common/src/main/java/gripe/_90/megacells/util/Utils.java index dd9656bb..08a83f6e 100644 --- a/common/src/main/java/gripe/_90/megacells/util/Utils.java +++ b/common/src/main/java/gripe/_90/megacells/util/Utils.java @@ -7,7 +7,7 @@ import net.minecraft.resources.ResourceLocation; -import gripe._90.megacells.util.service.IPlatformHelper; +import gripe._90.megacells.util.service.Platform; public final class Utils { private Utils() { @@ -17,7 +17,7 @@ private Utils() { public static final Logger LOGGER = LoggerFactory.getLogger("MEGA Cells"); - public static final IPlatformHelper PLATFORM = ServiceLoader.load(IPlatformHelper.class).findFirst().orElseThrow(); + public static final Platform PLATFORM = ServiceLoader.load(Platform.class).findFirst().orElseThrow(); public static ResourceLocation makeId(String path) { return new ResourceLocation(MODID, path); diff --git a/common/src/main/java/gripe/_90/megacells/util/service/IPlatformHelper.java b/common/src/main/java/gripe/_90/megacells/util/service/Platform.java similarity index 83% rename from common/src/main/java/gripe/_90/megacells/util/service/IPlatformHelper.java rename to common/src/main/java/gripe/_90/megacells/util/service/Platform.java index 3cebaeef..761e96ec 100644 --- a/common/src/main/java/gripe/_90/megacells/util/service/IPlatformHelper.java +++ b/common/src/main/java/gripe/_90/megacells/util/service/Platform.java @@ -2,7 +2,7 @@ import net.minecraft.world.item.CreativeModeTab; -public interface IPlatformHelper { +public interface Platform { CreativeModeTab getCreativeTab(); boolean isModLoaded(String modId); diff --git a/fabric/src/main/java/gripe/_90/megacells/MEGACellsFabric.java b/fabric/src/main/java/gripe/_90/megacells/MEGACellsFabric.java index a4f02213..8cb229d2 100644 --- a/fabric/src/main/java/gripe/_90/megacells/MEGACellsFabric.java +++ b/fabric/src/main/java/gripe/_90/megacells/MEGACellsFabric.java @@ -2,7 +2,6 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; import net.fabricmc.fabric.api.event.lifecycle.v1.CommonLifecycleEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.minecraft.core.Registry; @@ -63,12 +62,11 @@ public void onAe2Initialized() { InitAutoRotatingModel.init(); InitBlockEntityRenderers.init(); InitBuiltInModels.init(); + InitItemColors.init(); InitRenderTypes.init(); // re-init AE2 props for MEGA energy cell InitItemModelsProperties.init(); - - InitItemColors.init(ColorProviderRegistry.ITEM::register); } } } diff --git a/fabric/src/main/java/gripe/_90/megacells/datagen/LocalisationProvider.java b/fabric/src/main/java/gripe/_90/megacells/datagen/LocalisationProvider.java index 86bf485f..33bba8b2 100644 --- a/fabric/src/main/java/gripe/_90/megacells/datagen/LocalisationProvider.java +++ b/fabric/src/main/java/gripe/_90/megacells/datagen/LocalisationProvider.java @@ -7,8 +7,8 @@ import gripe._90.megacells.definition.MEGAItems; import gripe._90.megacells.definition.MEGATranslations; -public class LocalisationProvider extends FabricLanguageProvider { - protected LocalisationProvider(FabricDataGenerator gen, String locale) { +class LocalisationProvider extends FabricLanguageProvider { + LocalisationProvider(FabricDataGenerator gen, String locale) { super(gen, locale); } diff --git a/fabric/src/main/java/gripe/_90/megacells/datagen/LootTableProvider.java b/fabric/src/main/java/gripe/_90/megacells/datagen/LootTableProvider.java index 15772c2b..2a226396 100644 --- a/fabric/src/main/java/gripe/_90/megacells/datagen/LootTableProvider.java +++ b/fabric/src/main/java/gripe/_90/megacells/datagen/LootTableProvider.java @@ -15,8 +15,8 @@ import gripe._90.megacells.definition.MEGABlocks; import gripe._90.megacells.util.Utils; -public class LootTableProvider extends SimpleFabricLootTableProvider { - public LootTableProvider(FabricDataGenerator dataGenerator) { +class LootTableProvider extends SimpleFabricLootTableProvider { + LootTableProvider(FabricDataGenerator dataGenerator) { super(dataGenerator, LootContextParamSets.BLOCK); } diff --git a/fabric/src/main/java/gripe/_90/megacells/datagen/MEGADataGenerators.java b/fabric/src/main/java/gripe/_90/megacells/datagen/MEGADataGenerators.java index d69902b1..9eae6794 100644 --- a/fabric/src/main/java/gripe/_90/megacells/datagen/MEGADataGenerators.java +++ b/fabric/src/main/java/gripe/_90/megacells/datagen/MEGADataGenerators.java @@ -4,7 +4,6 @@ import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; public class MEGADataGenerators implements DataGeneratorEntrypoint { - @Override public void onInitializeDataGenerator(FabricDataGenerator generator) { var blockTags = new TagProvider.Blocks(generator); diff --git a/fabric/src/main/java/gripe/_90/megacells/datagen/ModelProvider.java b/fabric/src/main/java/gripe/_90/megacells/datagen/ModelProvider.java index b542948a..975244e9 100644 --- a/fabric/src/main/java/gripe/_90/megacells/datagen/ModelProvider.java +++ b/fabric/src/main/java/gripe/_90/megacells/datagen/ModelProvider.java @@ -36,8 +36,7 @@ import gripe._90.megacells.definition.MEGABlocks; import gripe._90.megacells.util.Utils; -public class ModelProvider extends FabricModelProvider { - +class ModelProvider extends FabricModelProvider { static final TextureSlot LAYER1 = TextureSlot.create("layer1"); static final TextureSlot CELL_TEXTURE = TextureSlot.create("cell"); @@ -49,7 +48,7 @@ public class ModelProvider extends FabricModelProvider { static final ResourceLocation STORAGE_CELL_LED = AppEng.makeId("item/storage_cell_led"); static final ResourceLocation PORTABLE_CELL_LED = AppEng.makeId("item/portable_cell_led"); - public ModelProvider(FabricDataGenerator gen) { + ModelProvider(FabricDataGenerator gen) { super(gen); } diff --git a/fabric/src/main/java/gripe/_90/megacells/datagen/RecipeProvider.java b/fabric/src/main/java/gripe/_90/megacells/datagen/RecipeProvider.java index 9b68e5eb..8b781770 100644 --- a/fabric/src/main/java/gripe/_90/megacells/datagen/RecipeProvider.java +++ b/fabric/src/main/java/gripe/_90/megacells/datagen/RecipeProvider.java @@ -8,9 +8,8 @@ import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; import net.minecraft.data.recipes.FinishedRecipe; -public class RecipeProvider extends FabricRecipeProvider { - - public RecipeProvider(FabricDataGenerator gen) { +class RecipeProvider extends FabricRecipeProvider { + RecipeProvider(FabricDataGenerator gen) { super(gen); } diff --git a/fabric/src/main/java/gripe/_90/megacells/datagen/TagProvider.java b/fabric/src/main/java/gripe/_90/megacells/datagen/TagProvider.java index c1f89bed..833769c3 100644 --- a/fabric/src/main/java/gripe/_90/megacells/datagen/TagProvider.java +++ b/fabric/src/main/java/gripe/_90/megacells/datagen/TagProvider.java @@ -8,9 +8,9 @@ import gripe._90.megacells.definition.MEGABlocks; -public class TagProvider { +class TagProvider { static class Items extends FabricTagProvider.ItemTagProvider { - public Items(FabricDataGenerator gen, @Nullable BlockTagProvider block) { + Items(FabricDataGenerator gen, @Nullable BlockTagProvider block) { super(gen, block); } @@ -21,7 +21,7 @@ protected void generateTags() { } static class Blocks extends FabricTagProvider.BlockTagProvider { - public Blocks(FabricDataGenerator gen) { + Blocks(FabricDataGenerator gen) { super(gen); } diff --git a/fabric/src/main/java/gripe/_90/megacells/init/client/InitItemColors.java b/fabric/src/main/java/gripe/_90/megacells/init/client/InitItemColors.java index 57f2a21b..61ffb9a7 100644 --- a/fabric/src/main/java/gripe/_90/megacells/init/client/InitItemColors.java +++ b/fabric/src/main/java/gripe/_90/megacells/init/client/InitItemColors.java @@ -5,7 +5,7 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.color.item.ItemColor; +import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; import net.minecraft.world.level.ItemLike; import appeng.core.definitions.ItemDefinition; @@ -18,7 +18,7 @@ @Environment(EnvType.CLIENT) public class InitItemColors { - public static void init(Registry itemColors) { + public static void init() { var cells = new ArrayList>(List.of( MEGAItems.ITEM_CELL_1M, MEGAItems.ITEM_CELL_4M, MEGAItems.ITEM_CELL_16M, MEGAItems.ITEM_CELL_64M, MEGAItems.ITEM_CELL_256M, MEGAItems.FLUID_CELL_1M, MEGAItems.FLUID_CELL_4M, MEGAItems.FLUID_CELL_16M, @@ -34,12 +34,7 @@ public static void init(Registry itemColors) { portables.addAll(AppBotItems.getPortables()); } - itemColors.register(BasicStorageCell::getColor, cells.toArray(new ItemLike[0])); - itemColors.register(PortableCellItem::getColor, portables.toArray(new ItemLike[0])); - } - - @FunctionalInterface - public interface Registry { - void register(ItemColor itemColor, ItemLike... itemLikes); + ColorProviderRegistry.ITEM.register(BasicStorageCell::getColor, cells.toArray(new ItemLike[0])); + ColorProviderRegistry.ITEM.register(PortableCellItem::getColor, portables.toArray(new ItemLike[0])); } } diff --git a/fabric/src/main/java/gripe/_90/megacells/util/FabricPlatformHelper.java b/fabric/src/main/java/gripe/_90/megacells/util/FabricPlatform.java similarity index 83% rename from fabric/src/main/java/gripe/_90/megacells/util/FabricPlatformHelper.java rename to fabric/src/main/java/gripe/_90/megacells/util/FabricPlatform.java index 7535b38f..7ce07c47 100644 --- a/fabric/src/main/java/gripe/_90/megacells/util/FabricPlatformHelper.java +++ b/fabric/src/main/java/gripe/_90/megacells/util/FabricPlatform.java @@ -6,9 +6,9 @@ import net.minecraft.world.item.ItemStack; import gripe._90.megacells.definition.MEGAItems; -import gripe._90.megacells.util.service.IPlatformHelper; +import gripe._90.megacells.util.service.Platform; -public final class FabricPlatformHelper implements IPlatformHelper { +public final class FabricPlatform implements Platform { @Override public CreativeModeTab getCreativeTab() { return FabricItemGroupBuilder.build(Utils.makeId("tab"), diff --git a/fabric/src/main/resources/META-INF/services/gripe._90.megacells.util.service.IPlatformHelper b/fabric/src/main/resources/META-INF/services/gripe._90.megacells.util.service.IPlatformHelper deleted file mode 100644 index e735eb26..00000000 --- a/fabric/src/main/resources/META-INF/services/gripe._90.megacells.util.service.IPlatformHelper +++ /dev/null @@ -1 +0,0 @@ -gripe._90.megacells.util.FabricPlatformHelper \ No newline at end of file diff --git a/fabric/src/main/resources/META-INF/services/gripe._90.megacells.util.service.Platform b/fabric/src/main/resources/META-INF/services/gripe._90.megacells.util.service.Platform new file mode 100644 index 00000000..278c473b --- /dev/null +++ b/fabric/src/main/resources/META-INF/services/gripe._90.megacells.util.service.Platform @@ -0,0 +1 @@ +gripe._90.megacells.util.FabricPlatform \ No newline at end of file diff --git a/forge/src/main/java/gripe/_90/megacells/datagen/forge/BlockStateProvider.java b/forge/src/main/java/gripe/_90/megacells/datagen/forge/BlockStateProvider.java index 14540dc1..540f0737 100644 --- a/forge/src/main/java/gripe/_90/megacells/datagen/forge/BlockStateProvider.java +++ b/forge/src/main/java/gripe/_90/megacells/datagen/forge/BlockStateProvider.java @@ -18,7 +18,6 @@ import gripe._90.megacells.util.Utils; public class BlockStateProvider extends net.minecraftforge.client.model.generators.BlockStateProvider { - public BlockStateProvider(DataGenerator gen, ExistingFileHelper efh) { super(gen, Utils.MODID, efh); } diff --git a/forge/src/main/java/gripe/_90/megacells/datagen/forge/ItemModelProvider.java b/forge/src/main/java/gripe/_90/megacells/datagen/forge/ItemModelProvider.java index 08dda822..5474ffbf 100644 --- a/forge/src/main/java/gripe/_90/megacells/datagen/forge/ItemModelProvider.java +++ b/forge/src/main/java/gripe/_90/megacells/datagen/forge/ItemModelProvider.java @@ -12,7 +12,6 @@ import gripe._90.megacells.util.Utils; public class ItemModelProvider extends net.minecraftforge.client.model.generators.ItemModelProvider { - static final ResourceLocation STORAGE_CELL_LED = AppEng.makeId("item/storage_cell_led"); static final ResourceLocation PORTABLE_CELL_LED = AppEng.makeId("item/portable_cell_led"); static final ResourceLocation DRIVE_CELL = AppEng.makeId("block/drive/drive_cell"); diff --git a/forge/src/main/java/gripe/_90/megacells/datagen/forge/MEGADataGenerators.java b/forge/src/main/java/gripe/_90/megacells/datagen/forge/MEGADataGenerators.java index 8b437fed..fa065642 100644 --- a/forge/src/main/java/gripe/_90/megacells/datagen/forge/MEGADataGenerators.java +++ b/forge/src/main/java/gripe/_90/megacells/datagen/forge/MEGADataGenerators.java @@ -14,7 +14,6 @@ @Mod.EventBusSubscriber(modid = Utils.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public class MEGADataGenerators { - @SubscribeEvent public static void onGatherData(GatherDataEvent event) { DataGenerator generator = event.getGenerator(); diff --git a/forge/src/main/java/gripe/_90/megacells/forge/MEGACellsForge.java b/forge/src/main/java/gripe/_90/megacells/forge/MEGACellsForge.java index eb74277c..2e71b885 100644 --- a/forge/src/main/java/gripe/_90/megacells/forge/MEGACellsForge.java +++ b/forge/src/main/java/gripe/_90/megacells/forge/MEGACellsForge.java @@ -42,6 +42,7 @@ public MEGACellsForge() { if (Utils.PLATFORM.isModLoaded("appmek")) { AppMekItems.init(); } + if (Utils.PLATFORM.isModLoaded("appbot")) { AppBotItems.init(); } @@ -53,9 +54,11 @@ public MEGACellsForge() { ForgeRegistries.ITEMS.register(b.id(), b.asItem()); }); } + if (event.getRegistryKey().equals(Registry.ITEM_REGISTRY)) { MEGAItems.getItems().forEach(i -> ForgeRegistries.ITEMS.register(i.id(), i.asItem())); } + if (event.getRegistryKey().equals(Registry.BLOCK_ENTITY_TYPE_REGISTRY)) { MEGABlockEntities.getBlockEntityTypes().forEach(ForgeRegistries.BLOCK_ENTITY_TYPES::register); } diff --git a/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekIntegration.java b/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekIntegration.java index b9dbbf75..fdb33a71 100644 --- a/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekIntegration.java +++ b/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekIntegration.java @@ -17,9 +17,6 @@ import gripe._90.megacells.util.Utils; public final class AppMekIntegration { - private AppMekIntegration() { - } - public static void initUpgrades() { var storageCellGroup = GuiText.StorageCells.getTranslationKey(); var portableCellGroup = GuiText.PortableCells.getTranslationKey(); diff --git a/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekItems.java b/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekItems.java index 26761bfd..d5561d28 100644 --- a/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekItems.java +++ b/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekItems.java @@ -14,9 +14,6 @@ import gripe._90.megacells.util.Utils; public final class AppMekItems { - private AppMekItems() { - } - public static void init() { // controls static load order Utils.LOGGER.info("Initialised Applied Mekanistics integration."); diff --git a/forge/src/main/java/gripe/_90/megacells/integration/appmek/datagen/AppMekItemModelProvider.java b/forge/src/main/java/gripe/_90/megacells/integration/appmek/datagen/AppMekItemModelProvider.java index 5ca53003..866b0cfc 100644 --- a/forge/src/main/java/gripe/_90/megacells/integration/appmek/datagen/AppMekItemModelProvider.java +++ b/forge/src/main/java/gripe/_90/megacells/integration/appmek/datagen/AppMekItemModelProvider.java @@ -15,7 +15,6 @@ import gripe._90.megacells.util.Utils; public class AppMekItemModelProvider extends ItemModelProvider { - static final ResourceLocation STORAGE_CELL_LED = AppEng.makeId("item/storage_cell_led"); static final ResourceLocation PORTABLE_CELL_LED = AppEng.makeId("item/portable_cell_led"); static final ResourceLocation DRIVE_CELL = AppEng.makeId("block/drive/drive_cell"); diff --git a/forge/src/main/java/gripe/_90/megacells/util/forge/ForgePlatformHelper.java b/forge/src/main/java/gripe/_90/megacells/util/forge/ForgePlatform.java similarity index 88% rename from forge/src/main/java/gripe/_90/megacells/util/forge/ForgePlatformHelper.java rename to forge/src/main/java/gripe/_90/megacells/util/forge/ForgePlatform.java index 8b3176f7..a1280d76 100644 --- a/forge/src/main/java/gripe/_90/megacells/util/forge/ForgePlatformHelper.java +++ b/forge/src/main/java/gripe/_90/megacells/util/forge/ForgePlatform.java @@ -10,9 +10,9 @@ import gripe._90.megacells.definition.MEGAItems; import gripe._90.megacells.util.Utils; -import gripe._90.megacells.util.service.IPlatformHelper; +import gripe._90.megacells.util.service.Platform; -public final class ForgePlatformHelper implements IPlatformHelper { +public final class ForgePlatform implements Platform { @Override public CreativeModeTab getCreativeTab() { return new CreativeModeTab(Utils.MODID + ".tab") { diff --git a/forge/src/main/resources/META-INF/services/gripe._90.megacells.util.service.IPlatformHelper b/forge/src/main/resources/META-INF/services/gripe._90.megacells.util.service.IPlatformHelper deleted file mode 100644 index 02470695..00000000 --- a/forge/src/main/resources/META-INF/services/gripe._90.megacells.util.service.IPlatformHelper +++ /dev/null @@ -1 +0,0 @@ -gripe._90.megacells.util.forge.ForgePlatformHelper \ No newline at end of file diff --git a/forge/src/main/resources/META-INF/services/gripe._90.megacells.util.service.Platform b/forge/src/main/resources/META-INF/services/gripe._90.megacells.util.service.Platform new file mode 100644 index 00000000..8b70fab6 --- /dev/null +++ b/forge/src/main/resources/META-INF/services/gripe._90.megacells.util.service.Platform @@ -0,0 +1 @@ +gripe._90.megacells.util.forge.ForgePlatform \ No newline at end of file