From cfbc2dd9cbe58563ad455bc24cd466cfdd5e37d3 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:53:32 +0100 Subject: [PATCH 1/7] Switch to in-dev Regilite 0.1 build. Handles initial renames and structure changes. --- buildSrc/shared.gradle.kts | 6 +- endercore/build.gradle.kts | 2 +- enderio-armory/build.gradle.kts | 2 +- .../armory/common/init/ArmoryItems.java | 4 +- enderio-base/build.gradle.kts | 2 +- .../base/common/block/glass/GlassBlocks.java | 30 +-- .../enderio/base/common/init/EIOBlocks.java | 106 ++++----- .../enderio/base/common/init/EIOEntities.java | 4 +- .../enderio/base/common/init/EIOFluids.java | 27 +-- .../enderio/base/common/init/EIOItems.java | 217 +++++++++--------- enderio-conduits/build.gradle.kts | 2 +- .../conduits/common/init/ConduitBlocks.java | 8 +- .../conduits/common/init/ConduitItems.java | 28 +-- enderio-machines/build.gradle.kts | 2 +- .../common/init/MachineBlockEntities.java | 93 ++++---- .../machines/common/init/MachineBlocks.java | 144 ++++++------ gradle.properties | 2 +- 17 files changed, 337 insertions(+), 342 deletions(-) diff --git a/buildSrc/shared.gradle.kts b/buildSrc/shared.gradle.kts index e34a9e966..7c045673e 100644 --- a/buildSrc/shared.gradle.kts +++ b/buildSrc/shared.gradle.kts @@ -156,11 +156,11 @@ fun getVersionString(): String { val versionSeries: String by project // If this is not a release, we're going to get the last tag, add the ci build number, then append -dev+ - var commitHash = shellRunAndRead("git rev-parse --short HEAD").trim(); - var previousTagVersion = shellRunAndRead("git describe --tags --abbrev=0").trim(); + val commitHash = shellRunAndRead("git rev-parse --short HEAD").trim(); + val previousTagVersion = shellRunAndRead("git describe --tags --abbrev=0").trim(); // Extract the numeric component of the last version. - var versionRegex = Regex("""\d+(\.\d+)+""") + val versionRegex = Regex("""\d+(\.\d+)+""") var currentVersion = versionRegex.find(previousTagVersion)?.value if (currentVersion == null) { // Fallback to version series if we're unable to discover the previous version. diff --git a/endercore/build.gradle.kts b/endercore/build.gradle.kts index c563577bc..2bfcd710f 100644 --- a/endercore/build.gradle.kts +++ b/endercore/build.gradle.kts @@ -14,7 +14,7 @@ val almostunifiedVersion: String by project dependencies { // Regilite - api("com.enderio:Regilite:${regiliteVersion}") + api("com.enderio:regilite:${regiliteVersion}") // Almost Unified compileOnly("com.almostreliable.mods:almostunified-neoforge:1.21.1-${almostunifiedVersion}:api") diff --git a/enderio-armory/build.gradle.kts b/enderio-armory/build.gradle.kts index 405f8cb06..79a442274 100644 --- a/enderio-armory/build.gradle.kts +++ b/enderio-armory/build.gradle.kts @@ -30,7 +30,7 @@ val cctMinecraftVersion: String by project val cctVersion: String by project dependencies { - api("com.enderio:Regilite:$regiliteVersion") + api("com.enderio:regilite:$regiliteVersion") api(project(":enderio-base")) accessTransformers(project(":enderio-base")) diff --git a/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java b/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java index 8b2a90a88..4fd7dd594 100644 --- a/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java +++ b/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java @@ -26,8 +26,8 @@ public class ArmoryItems { public static final RegiliteItem DARK_STEEL_SWORD = ITEM_REGISTRY .registerItem("dark_steel_sword", DarkSteelSwordItem::new, new Item.Properties().durability(2000)) - .setTab(EIOCreativeTabs.GEAR) - .setTranslation("The Ender") + .withTab(EIOCreativeTabs.GEAR) + .withTranslation("The Ender") .setModelProvider((prov, ctx) -> prov.handheld(ctx.get())); // TODO: Bring these back when they are finished. diff --git a/enderio-base/build.gradle.kts b/enderio-base/build.gradle.kts index 357413326..4b031a8b6 100644 --- a/enderio-base/build.gradle.kts +++ b/enderio-base/build.gradle.kts @@ -26,7 +26,7 @@ val jeiMinecraftVersion: String by project val jeiVersion: String by project dependencies { - api("com.enderio:Regilite:$regiliteVersion") + api("com.enderio:regilite:$regiliteVersion") // EnderIO Base will bundle Regilite and EnderCore in production. jarJar("com.enderio:Regilite:$regiliteVersion") diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java b/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java index d4df686f8..78f3b0d4e 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java @@ -78,26 +78,26 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It .isRedstoneConductor(GlassBlocks::never) .isSuffocating(GlassBlocks::never) .isViewBlocking(GlassBlocks::never)) - .setTranslation("") + .withTranslation("") .setBlockStateProvider((cons, ctx) -> cons.simpleBlock(ctx.get(), cons.models().getExistingFile(getModelFile()))) - .addBlockTags( + .withTags( glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS ); - block.createBlockItem(itemRegistry, item -> { - item.setTab(EIOCreativeTabs.BLOCKS) - .addItemTags( + block.withBlockItem(itemRegistry, item -> { + item.withTab(EIOCreativeTabs.BLOCKS) + .withTags( glassIdentifier.explosion_resistance() ? EIOTags.Items.FUSED_QUARTZ : EIOTags.Items.CLEAR_GLASS, EIOTags.Items.GLASS_TAGS.get(glassIdentifier) ) .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); if (glassIdentifier.lighting() == GlassLighting.EMITTING && glassIdentifier.explosion_resistance()) { - item.addItemTags(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); + item.withTags(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); } if (glassIdentifier.lighting() == GlassLighting.BLOCKING && glassIdentifier.explosion_resistance()) { - item.addItemTags(EIOTags.Items.DARK_FUSED_QUARTZ); + item.withTags(EIOTags.Items.DARK_FUSED_QUARTZ); } }); @@ -121,28 +121,28 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It .isSuffocating(GlassBlocks::never) .isViewBlocking(GlassBlocks::never) .mapColor(color)) - .setTranslation("") + .withTranslation("") .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(getModelFile()))) - .setColorSupplier(() -> () -> (state, level, pos, tintIndex) -> color.getMapColor().col) - .addBlockTags( + .withBlockColor(() -> () -> (state, level, pos, tintIndex) -> color.getMapColor().col) + .withTags( glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS ); - block.createBlockItem(itemRegistry, item -> { - item.setTab(EIOCreativeTabs.BLOCKS) + block.withBlockItem(itemRegistry, item -> { + item.withTab(EIOCreativeTabs.BLOCKS) .setColorSupplier(() -> () -> (stack, tintIndex) -> color.getMapColor().col) - .addItemTags( + .withTags( glassIdentifier.explosion_resistance() ? EIOTags.Items.FUSED_QUARTZ : EIOTags.Items.CLEAR_GLASS, EIOTags.Items.GLASS_TAGS.get(glassIdentifier) ) .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); if (glassIdentifier.lighting() == GlassLighting.EMITTING && glassIdentifier.explosion_resistance()) { - item.addItemTags(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); + item.withTags(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); } if (glassIdentifier.lighting() == GlassLighting.BLOCKING && glassIdentifier.explosion_resistance()) { - item.addItemTags(EIOTags.Items.DARK_FUSED_QUARTZ); + item.withTags(EIOTags.Items.DARK_FUSED_QUARTZ); } }); diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java index 802410948..0d8a0f712 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java @@ -140,57 +140,57 @@ public class EIOBlocks { .renderType(prov.mcLoc("cutout_mipped")) .texture("particle", prov.blockTexture(ctx.get())) .texture("texture", prov.blockTexture(ctx.get())))) - .addBlockTags(BlockTags.CLIMBABLE, BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .createBlockItem(ITEM_REGISTRY, item -> item + .withTags(BlockTags.CLIMBABLE, BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withBlockItem(ITEM_REGISTRY, item -> item .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_ladder"))) - .setTab(EIOCreativeTabs.BLOCKS)); + .withTab(EIOCreativeTabs.BLOCKS)); public static final RegiliteBlock DARK_STEEL_BARS = BLOCK_REGISTRY .registerBlock("dark_steel_bars", IronBarsBlock::new, BlockBehaviour.Properties.of().strength(5.0f, 1000.0f).requiresCorrectToolForDrops().sound(SoundType.METAL).noOcclusion()) .setBlockStateProvider(EIOBlockState::paneBlock) - .addBlockTags( + .withTags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) - .createBlockItem(ITEM_REGISTRY, item -> item - .setTab(EIOCreativeTabs.BLOCKS) + .withBlockItem(ITEM_REGISTRY, item -> item + .withTab(EIOCreativeTabs.BLOCKS) .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_bars"))) ); public static final RegiliteBlock DARK_STEEL_DOOR = BLOCK_REGISTRY .registerBlock("dark_steel_door", props -> new DoorBlock(BlockSetType.IRON, props), BlockBehaviour.Properties.of().strength(5.0f, 2000.0f).sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) - .setLootTable(RegiliteBlockLootProvider::createDoor) + .withLootTable(RegiliteBlockLootProvider::createDoor) .setBlockStateProvider( (prov, ctx) -> prov.doorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_door_bottom"), prov.modLoc("block/dark_steel_door_top"), prov.mcLoc("cutout"))) - .addBlockTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.DOORS) - .createBlockItem(ITEM_REGISTRY, item -> item + .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.DOORS) + .withBlockItem(ITEM_REGISTRY, item -> item .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get())) - .setTab(EIOCreativeTabs.BLOCKS) + .withTab(EIOCreativeTabs.BLOCKS) ); public static final RegiliteBlock DARK_STEEL_TRAPDOOR = BLOCK_REGISTRY .registerBlock("dark_steel_trapdoor", props -> new TrapDoorBlock(BlockSetType.IRON, props), BlockBehaviour.Properties.of().strength(5.0f, 2000.0f).sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) .setBlockStateProvider((prov, ctx) -> prov.trapdoorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_trapdoor"), true, prov.mcLoc("cutout"))) - .addBlockTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.TRAPDOORS) - .createBlockItem(ITEM_REGISTRY, item -> item + .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.TRAPDOORS) + .withBlockItem(ITEM_REGISTRY, item -> item .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.modLoc("block/dark_steel_trapdoor_bottom"))) - .setTab(EIOCreativeTabs.BLOCKS) + .withTab(EIOCreativeTabs.BLOCKS) ); public static final RegiliteBlock END_STEEL_BARS = BLOCK_REGISTRY .registerBlock("end_steel_bars", IronBarsBlock::new, BlockBehaviour.Properties.of().strength(5.0f, 1000.0f).requiresCorrectToolForDrops().sound(SoundType.METAL).noOcclusion()) .setBlockStateProvider(EIOBlockState::paneBlock) - .addBlockTags( + .withTags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) - .createBlockItem(ITEM_REGISTRY, item -> item - .setTab(EIOCreativeTabs.BLOCKS) + .withBlockItem(ITEM_REGISTRY, item -> item + .withTab(EIOCreativeTabs.BLOCKS) .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/end_steel_bars"))) ); @@ -202,13 +202,13 @@ public class EIOBlocks { .requiresCorrectToolForDrops() .mapColor(MapColor.COLOR_BLACK) .instrument(NoteBlockInstrument.BASEDRUM)) - .addBlockTags( + .withTags( BlockTags.WITHER_IMMUNE, BlockTags.NEEDS_DIAMOND_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) - .createBlockItem(ITEM_REGISTRY, item -> item - .setTab(EIOCreativeTabs.BLOCKS) + .withBlockItem(ITEM_REGISTRY, item -> item + .withTab(EIOCreativeTabs.BLOCKS) ); // endregion @@ -242,7 +242,7 @@ private static Map fillGlassMap() { .sound(SoundType.CHAIN) .noOcclusion() .mapColor(MapColor.NONE)) - .addBlockTags( + .withTags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE, Tags.Blocks.CHAINS @@ -257,7 +257,7 @@ private static Map fillGlassMap() { prov.axisBlock(ctx.get(), model, model); }) - .createBlockItem(ITEM_REGISTRY, item -> item + .withBlockItem(ITEM_REGISTRY, item -> item .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("item/soul_chain"))) .addItemTags(Tags.Items.CHAINS) .setTab(EIOCreativeTabs.BLOCKS) @@ -381,7 +381,7 @@ private static Map fillGlassMap() { PaintedWoodenPressurePlateBlock::new, Blocks.OAK_PRESSURE_PLATE, BlockTags.WOODEN_PRESSURE_PLATES, BlockTags.MINEABLE_WITH_AXE); public static final RegiliteBlock PAINTED_SLAB = paintedBlock("painted_slab", PaintedSlabBlock::new, PaintedSlabBlockItem::new, - Blocks.OAK_SLAB, BlockTags.WOODEN_SLABS, BlockTags.MINEABLE_WITH_AXE).setLootTable(DecorLootTable::paintedSlab); + Blocks.OAK_SLAB, BlockTags.WOODEN_SLABS, BlockTags.MINEABLE_WITH_AXE).withLootTable(DecorLootTable::paintedSlab); public static final RegiliteBlock PAINTED_GLOWSTONE = paintedBlock("painted_glowstone", SinglePaintedBlock::new, Blocks.GLOWSTONE); @@ -409,30 +409,30 @@ private static Map fillGlassMap() { .registerBlock("enderman_head", EnderSkullBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SKELETON_SKULL).instrument(NoteBlockInstrument.SKELETON).strength(1.0F).pushReaction(PushReaction.DESTROY)) .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) - .createBlockItem(ITEM_REGISTRY, + .withBlockItem(ITEM_REGISTRY, // TODO: Properties being handled right? Maybe cleaner if we have a factory that takes properties, then a properties arg. (enderSkullBlock) -> new EnderSkullBlockItem(enderSkullBlock, new Item.Properties(), Direction.DOWN), item -> item - .setTab(EIOCreativeTabs.MAIN) + .withTab(EIOCreativeTabs.MAIN) .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), "item/template_skull"))); public static final RegiliteBlock WALL_ENDERMAN_HEAD = BLOCK_REGISTRY .registerBlock("wall_enderman_head", WallEnderSkullBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SKELETON_SKULL).strength(1.0F).lootFrom(ENDERMAN_HEAD).pushReaction(PushReaction.DESTROY)) .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) - .setTranslation(""); + .withTranslation(""); private static RegiliteBlock metalBlock(String name, TagKey blockTag, TagKey itemTag) { return BLOCK_REGISTRY .registerBlock(name, Block::new, BlockBehaviour.Properties.of().sound(SoundType.METAL).mapColor(MapColor.METAL).strength(5, 6).requiresCorrectToolForDrops()) - .addBlockTags( + .withTags( BlockTags.NEEDS_STONE_TOOL, BlockTags.MINEABLE_WITH_PICKAXE, blockTag ) - .createBlockItem(ITEM_REGISTRY, item -> item - .setTab(EIOCreativeTabs.BLOCKS) - .addItemTags(itemTag) + .withBlockItem(ITEM_REGISTRY, item -> item + .withTab(EIOCreativeTabs.BLOCKS) + .withTags(itemTag) ); } @@ -441,12 +441,12 @@ private static RegiliteBlock chassisBlock(String name) { .registerBlock(name, Block::new, BlockBehaviour.Properties.of().noOcclusion().sound(SoundType.METAL).mapColor(MapColor.METAL).strength(5, 6)) .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().cubeAll(name, prov.blockTexture(ctx.get())).renderType(prov.mcLoc("translucent")))) - .addBlockTags( + .withTags( BlockTags.NEEDS_STONE_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) - .createBlockItem(ITEM_REGISTRY, item -> item - .setTab(EIOCreativeTabs.BLOCKS) + .withBlockItem(ITEM_REGISTRY, item -> item + .withTab(EIOCreativeTabs.BLOCKS) ); } @@ -465,9 +465,9 @@ private static RegiliteBlock pressurePlateBlock(String na vb.partialState().with(PressurePlateBlock.POWERED, true).addModels(new ConfiguredModel(dm)); vb.partialState().with(PressurePlateBlock.POWERED, false).addModels(new ConfiguredModel(um)); }) - .addBlockTags(BlockTags.NEEDS_STONE_TOOL, BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) - .createBlockItem(ITEM_REGISTRY, item -> item - .setTab(EIOCreativeTabs.BLOCKS) + .withTags(BlockTags.NEEDS_STONE_TOOL, BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) + .withBlockItem(ITEM_REGISTRY, item -> item + .withTab(EIOCreativeTabs.BLOCKS) ); } @@ -478,15 +478,15 @@ private static RegiliteBlock silentPressurePlateBlock( return BLOCK_REGISTRY .registerBlock("silent_" + upModelLoc.getPath(), props -> new SilentPressurePlateBlock(block), BlockBehaviour.Properties.of()) - .addBlockTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) + .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) .setBlockStateProvider((prov, ctx) -> { VariantBlockStateBuilder vb = prov.getVariantBuilder(ctx.get()); vb.partialState().with(PressurePlateBlock.POWERED, true).addModels(new ConfiguredModel(prov.models().getExistingFile(downModelLoc))); vb.partialState().with(PressurePlateBlock.POWERED, false).addModels(new ConfiguredModel(prov.models().getExistingFile(upModelLoc))); }) - .createBlockItem(ITEM_REGISTRY, item -> item + .withBlockItem(ITEM_REGISTRY, item -> item .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) - .setTab(EIOCreativeTabs.BLOCKS) + .withTab(EIOCreativeTabs.BLOCKS) ); } @@ -503,10 +503,10 @@ private static RegiliteBlock silentWeightedPre } return new ConfiguredModel[] { new ConfiguredModel(prov.models().getExistingFile(downModelLoc)) }; })) - .addBlockTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) - .createBlockItem(ITEM_REGISTRY, item -> item + .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) + .withBlockItem(ITEM_REGISTRY, item -> item .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) - .setTab(EIOCreativeTabs.BLOCKS) + .withTab(EIOCreativeTabs.BLOCKS) ); } @@ -515,7 +515,7 @@ private static RegiliteBlock resettingLeverBlock(String nam return BLOCK_REGISTRY .registerBlock(name, props -> new ResettingLeverBlock(duration, inverted), BlockBehaviour.Properties.of()) - .setTranslation("Resetting Lever " + (inverted ? "Inverted " : "") + durationLabel) + .withTranslation("Resetting Lever " + (inverted ? "Inverted " : "") + durationLabel) .setBlockStateProvider((prov, ctx) -> { BlockModelProvider modProv = prov.models(); ModelFile.ExistingModelFile baseModel = modProv.getExistingFile(prov.mcLoc("block/lever")); @@ -535,17 +535,17 @@ private static RegiliteBlock resettingLeverBlock(String nam return new ConfiguredModel[] { new ConfiguredModel(model, rotationX, rotationY, false) }; }); }) - .createBlockItem(ITEM_REGISTRY, item -> item + .withBlockItem(ITEM_REGISTRY, item -> item .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.mcLoc("item/lever"))) - .setTab(EIOCreativeTabs.BLOCKS) + .withTab(EIOCreativeTabs.BLOCKS) ); } public static final RegiliteBlock INDUSTRIAL_INSULATION = BLOCK_REGISTRY .registerBlock("industrial_insulation_block", IndustrialInsulationBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SPONGE)) - .setTranslation("Industrial Insulation") - .createBlockItem(ITEM_REGISTRY, item -> item - .setTab(EIOCreativeTabs.BLOCKS) + .withTranslation("Industrial Insulation") + .withBlockItem(ITEM_REGISTRY, item -> item + .withTab(EIOCreativeTabs.BLOCKS) ); @SafeVarargs @@ -574,10 +574,10 @@ private static RegiliteBlock paintedBlock(String name, Func return BLOCK_REGISTRY .registerBlock(name, blockFactory, BlockBehaviour.Properties.ofFullCopy(copyFrom).noOcclusion()) .setBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock(name, prov, ctx.get(), copyFrom, itemTextureRotation)) - .setColorSupplier(() -> PaintedBlockColor::new) - .setLootTable(DecorLootTable::withPaint) - .addBlockTags(tags) - .createBlockItem( + .withBlockColor(() -> PaintedBlockColor::new) + .withLootTable(DecorLootTable::withPaint) + .withTags(tags) + .withBlockItem( ITEM_REGISTRY, b -> itemFactory.apply(b, new Item.Properties()), item -> item @@ -593,9 +593,9 @@ public static RegiliteBlock lightBlock(String name, Functio return 0; })) .setBlockStateProvider(EIOBlockState::lightBlock) - .createBlockItem(ITEM_REGISTRY, item -> item + .withBlockItem(ITEM_REGISTRY, item -> item .setModelProvider((prov, ctx) -> prov.withExistingParent(name, "block/button_inventory")) - .setTab(EIOCreativeTabs.BLOCKS) + .withTab(EIOCreativeTabs.BLOCKS) ); } diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java index 7c151703d..7d550f0e3 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java @@ -15,8 +15,8 @@ public class EIOEntities { public static final RegiliteEntity PAINTED_SAND = ENTITY_REGISTRY .registerEntity("painted_sand", (EntityType.EntityFactory) PaintedSandEntity::new, MobCategory.MISC) - .setRenderer(() -> PaintedSandRenderer::new) - .setTranslation("Painted Sand"); + .withRenderer(() -> PaintedSandRenderer::new) + .withTranslation("Painted Sand"); public static void register(IEventBus bus) { ENTITY_REGISTRY.register(bus); diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java index 4825d164a..2676479f2 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java @@ -49,11 +49,11 @@ public class EIOFluids { public static final RegiliteFluid XP_JUICE = fluid("xp_juice", "XP Juice", FluidType.Properties.create().lightLevel(10).density(800).viscosity(1500)) - .addFluidTags(EIOTags.Fluids.EXPERIENCE); + .withTags(EIOTags.Fluids.EXPERIENCE); public static final RegiliteFluid LIQUID_SUNSHINE = fluid("liquid_sunshine", "Liquid Sunshine", FluidType.Properties.create().density(200).viscosity(400)) - .addFluidTags(EIOTags.Fluids.SOLAR_PANEL_LIGHT); + .withTags(EIOTags.Fluids.SOLAR_PANEL_LIGHT); public static final RegiliteFluid CLOUD_SEED = fluid("cloud_seed", "Cloud Seed", FluidType.Properties.create().density(500).viscosity(800)); @@ -63,29 +63,26 @@ public class EIOFluids { private static RegiliteFluid fluid(String name, String translation, FluidType.Properties properties) { return baseFluid(name, properties) - .setTranslation(translation) - .withBucket(ITEM_REGISTRY, fluid -> new BucketItem(fluid.get(), new Item.Properties().stacksTo(1))) - .setTab(EIOCreativeTabs.MAIN) - .setTranslation(translation + " Bucket") - .finishBucket(); + .withTranslation(translation) + .withBucket(ITEM_REGISTRY, item -> item + .withTab(EIOCreativeTabs.MAIN) + .withTranslation(translation + " Bucket")); } private static RegiliteFluid gasFluid(String name, String translation, FluidType.Properties properties) { return baseFluid(name, properties) - .setTranslation(translation) - .withBucket(ITEM_REGISTRY, fluid -> new BucketItem(fluid.get(), new Item.Properties().stacksTo(1))) - .setTab(EIOCreativeTabs.MAIN) - .setTranslation(translation + " Bucket") - .finishBucket(); + .withTranslation(translation) + .withBucket(ITEM_REGISTRY, item -> item + .withTab(EIOCreativeTabs.MAIN) + .withTranslation(translation + " Bucket")); } private static RegiliteFluid baseFluid(String name, FluidType.Properties properties) { return FLUID_TYPE_REGISTRY .registerFluid(name, properties) - .setRenderType(() -> RenderType::translucent) + .withRenderType(() -> RenderType::translucent) .createFluid(FLUID_REGISTRY) - .withBlock(BLOCK_REGISTRY, fluid -> new LiquidBlock(fluid.get(), BlockBehaviour.Properties.ofFullCopy(Blocks.WATER))) - .finishLiquidBlock(); + .withBlock(BLOCK_REGISTRY, BlockBehaviour.Properties.ofFullCopy(Blocks.WATER)); } public static void register(IEventBus bus) { diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java index 91f6a8ec3..e1ff89eac 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java @@ -48,35 +48,35 @@ public class EIOItems { // region Alloys - public static final RegiliteItem COPPER_ALLOY_INGOT = materialItem("copper_alloy_ingot").addItemTags(EIOTags.Items.INGOTS_COPPER_ALLOY); - public static final RegiliteItem ENERGETIC_ALLOY_INGOT = materialItem("energetic_alloy_ingot").addItemTags(EIOTags.Items.INGOTS_ENERGETIC_ALLOY); - public static final RegiliteItem VIBRANT_ALLOY_INGOT = materialItem("vibrant_alloy_ingot").addItemTags(EIOTags.Items.INGOTS_VIBRANT_ALLOY); - public static final RegiliteItem REDSTONE_ALLOY_INGOT = materialItem("redstone_alloy_ingot").addItemTags(EIOTags.Items.INGOTS_REDSTONE_ALLOY); - public static final RegiliteItem CONDUCTIVE_ALLOY_INGOT = materialItem("conductive_alloy_ingot").addItemTags(EIOTags.Items.INGOTS_CONDUCTIVE_ALLOY); - public static final RegiliteItem PULSATING_ALLOY_INGOT = materialItem("pulsating_alloy_ingot").addItemTags(EIOTags.Items.INGOTS_PULSATING_ALLOY); - public static final RegiliteItem DARK_STEEL_INGOT = materialItem("dark_steel_ingot").addItemTags(EIOTags.Items.INGOTS_DARK_STEEL); - public static final RegiliteItem SOULARIUM_INGOT = materialItem("soularium_ingot").addItemTags(EIOTags.Items.INGOTS_SOULARIUM); - public static final RegiliteItem END_STEEL_INGOT = materialItem("end_steel_ingot").addItemTags(EIOTags.Items.INGOTS_END_STEEL); - - public static final RegiliteItem COPPER_ALLOY_NUGGET = materialItem("copper_alloy_nugget").addItemTags(EIOTags.Items.NUGGETS_COPPER_ALLOY); - public static final RegiliteItem ENERGETIC_ALLOY_NUGGET = materialItem("energetic_alloy_nugget").addItemTags(EIOTags.Items.NUGGETS_ENERGETIC_ALLOY); - public static final RegiliteItem VIBRANT_ALLOY_NUGGET = materialItem("vibrant_alloy_nugget").addItemTags(EIOTags.Items.NUGGETS_VIBRANT_ALLOY); - public static final RegiliteItem REDSTONE_ALLOY_NUGGET = materialItem("redstone_alloy_nugget").addItemTags(EIOTags.Items.NUGGETS_REDSTONE_ALLOY); - public static final RegiliteItem CONDUCTIVE_ALLOY_NUGGET = materialItem("conductive_alloy_nugget").addItemTags(EIOTags.Items.NUGGETS_CONDUCTIVE_ALLOY); - public static final RegiliteItem PULSATING_ALLOY_NUGGET = materialItem("pulsating_alloy_nugget").addItemTags(EIOTags.Items.NUGGETS_PULSATING_ALLOY); - public static final RegiliteItem DARK_STEEL_NUGGET = materialItem("dark_steel_nugget").addItemTags(EIOTags.Items.NUGGETS_DARK_STEEL); - public static final RegiliteItem SOULARIUM_NUGGET = materialItem("soularium_nugget").addItemTags(EIOTags.Items.NUGGETS_SOULARIUM); - public static final RegiliteItem END_STEEL_NUGGET = materialItem("end_steel_nugget").addItemTags(EIOTags.Items.NUGGETS_END_STEEL); + public static final RegiliteItem COPPER_ALLOY_INGOT = materialItem("copper_alloy_ingot").withTags(EIOTags.Items.INGOTS_COPPER_ALLOY); + public static final RegiliteItem ENERGETIC_ALLOY_INGOT = materialItem("energetic_alloy_ingot").withTags(EIOTags.Items.INGOTS_ENERGETIC_ALLOY); + public static final RegiliteItem VIBRANT_ALLOY_INGOT = materialItem("vibrant_alloy_ingot").withTags(EIOTags.Items.INGOTS_VIBRANT_ALLOY); + public static final RegiliteItem REDSTONE_ALLOY_INGOT = materialItem("redstone_alloy_ingot").withTags(EIOTags.Items.INGOTS_REDSTONE_ALLOY); + public static final RegiliteItem CONDUCTIVE_ALLOY_INGOT = materialItem("conductive_alloy_ingot").withTags(EIOTags.Items.INGOTS_CONDUCTIVE_ALLOY); + public static final RegiliteItem PULSATING_ALLOY_INGOT = materialItem("pulsating_alloy_ingot").withTags(EIOTags.Items.INGOTS_PULSATING_ALLOY); + public static final RegiliteItem DARK_STEEL_INGOT = materialItem("dark_steel_ingot").withTags(EIOTags.Items.INGOTS_DARK_STEEL); + public static final RegiliteItem SOULARIUM_INGOT = materialItem("soularium_ingot").withTags(EIOTags.Items.INGOTS_SOULARIUM); + public static final RegiliteItem END_STEEL_INGOT = materialItem("end_steel_ingot").withTags(EIOTags.Items.INGOTS_END_STEEL); + + public static final RegiliteItem COPPER_ALLOY_NUGGET = materialItem("copper_alloy_nugget").withTags(EIOTags.Items.NUGGETS_COPPER_ALLOY); + public static final RegiliteItem ENERGETIC_ALLOY_NUGGET = materialItem("energetic_alloy_nugget").withTags(EIOTags.Items.NUGGETS_ENERGETIC_ALLOY); + public static final RegiliteItem VIBRANT_ALLOY_NUGGET = materialItem("vibrant_alloy_nugget").withTags(EIOTags.Items.NUGGETS_VIBRANT_ALLOY); + public static final RegiliteItem REDSTONE_ALLOY_NUGGET = materialItem("redstone_alloy_nugget").withTags(EIOTags.Items.NUGGETS_REDSTONE_ALLOY); + public static final RegiliteItem CONDUCTIVE_ALLOY_NUGGET = materialItem("conductive_alloy_nugget").withTags(EIOTags.Items.NUGGETS_CONDUCTIVE_ALLOY); + public static final RegiliteItem PULSATING_ALLOY_NUGGET = materialItem("pulsating_alloy_nugget").withTags(EIOTags.Items.NUGGETS_PULSATING_ALLOY); + public static final RegiliteItem DARK_STEEL_NUGGET = materialItem("dark_steel_nugget").withTags(EIOTags.Items.NUGGETS_DARK_STEEL); + public static final RegiliteItem SOULARIUM_NUGGET = materialItem("soularium_nugget").withTags(EIOTags.Items.NUGGETS_SOULARIUM); + public static final RegiliteItem END_STEEL_NUGGET = materialItem("end_steel_nugget").withTags(EIOTags.Items.NUGGETS_END_STEEL); // endregion // region Crafting Components - public static final RegiliteItem SILICON = materialItem("silicon").addItemTags(EIOTags.Items.SILICON); + public static final RegiliteItem SILICON = materialItem("silicon").withTags(EIOTags.Items.SILICON); public static final RegiliteItem GRAINS_OF_INFINITY = materialItem("grains_of_infinity") - .addItemTags(EIOTags.Items.DUSTS_GRAINS_OF_INFINITY) - .setTranslation("Grains of Infinity"); + .withTags(EIOTags.Items.DUSTS_GRAINS_OF_INFINITY) + .withTranslation("Grains of Infinity"); public static final RegiliteItem INFINITY_ROD = materialItem("infinity_rod"); @@ -87,10 +87,10 @@ public class EIOItems { public static final RegiliteItem ZOMBIE_ELECTRODE = materialItem("zombie_electrode"); public static final RegiliteItem Z_LOGIC_CONTROLLER = materialItem("z_logic_controller") - .setTranslation("Z-Logic Controller"); + .withTranslation("Z-Logic Controller"); public static final RegiliteItem FRANK_N_ZOMBIE = materialItemGlinted("frank_n_zombie") - .setTranslation("Frank'N'Zombie") + .withTranslation("Frank'N'Zombie") .setModelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.Z_LOGIC_CONTROLLER)); public static final RegiliteItem ENDER_RESONATOR = materialItem("ender_resonator"); @@ -110,21 +110,21 @@ public class EIOItems { props -> new CapacitorItem( props.component(EIODataComponents.CAPACITOR_DATA, CapacitorData.simple(1))), new Item.Properties().stacksTo(1)) - .setTab(EIOCreativeTabs.MAIN); + .withTab(EIOCreativeTabs.MAIN); public static final RegiliteItem DOUBLE_LAYER_CAPACITOR = ITEM_REGISTRY .registerItem("double_layer_capacitor", props -> new CapacitorItem( props.component(EIODataComponents.CAPACITOR_DATA, CapacitorData.simple(2))), new Item.Properties().stacksTo(1)) - .setTab(EIOCreativeTabs.MAIN); + .withTab(EIOCreativeTabs.MAIN); public static final RegiliteItem OCTADIC_CAPACITOR = ITEM_REGISTRY .registerItem("octadic_capacitor", props -> new CapacitorItem( props.component(EIODataComponents.CAPACITOR_DATA, CapacitorData.simple(3))), new Item.Properties().stacksTo(1)) - .setTab(EIOCreativeTabs.MAIN); + .withTab(EIOCreativeTabs.MAIN); public static final RegiliteItem LOOT_CAPACITOR = ITEM_REGISTRY .registerItem("loot_capacitor", LootCapacitorItem::new, new Item.Properties() @@ -134,12 +134,12 @@ public class EIOItems { // region Crystals - public static final RegiliteItem PULSATING_CRYSTAL = materialItemGlinted("pulsating_crystal").addItemTags(EIOTags.Items.GEMS_PULSATING_CRYSTAL); - public static final RegiliteItem VIBRANT_CRYSTAL = materialItemGlinted("vibrant_crystal").addItemTags(EIOTags.Items.GEMS_VIBRANT_CRYSTAL); - public static final RegiliteItem ENDER_CRYSTAL = materialItemGlinted("ender_crystal").addItemTags(EIOTags.Items.GEMS_ENDER_CRYSTAL); - public static final RegiliteItem ENTICING_CRYSTAL = materialItemGlinted("enticing_crystal").addItemTags(EIOTags.Items.GEMS_ENTICING_CRYSTAL); - public static final RegiliteItem WEATHER_CRYSTAL = materialItemGlinted("weather_crystal").addItemTags(EIOTags.Items.GEMS_WEATHER_CRYSTAL); - public static final RegiliteItem PRESCIENT_CRYSTAL = materialItemGlinted("prescient_crystal").addItemTags(EIOTags.Items.GEMS_PRESCIENT_CRYSTAL); + public static final RegiliteItem PULSATING_CRYSTAL = materialItemGlinted("pulsating_crystal").withTags(EIOTags.Items.GEMS_PULSATING_CRYSTAL); + public static final RegiliteItem VIBRANT_CRYSTAL = materialItemGlinted("vibrant_crystal").withTags(EIOTags.Items.GEMS_VIBRANT_CRYSTAL); + public static final RegiliteItem ENDER_CRYSTAL = materialItemGlinted("ender_crystal").withTags(EIOTags.Items.GEMS_ENDER_CRYSTAL); + public static final RegiliteItem ENTICING_CRYSTAL = materialItemGlinted("enticing_crystal").withTags(EIOTags.Items.GEMS_ENTICING_CRYSTAL); + public static final RegiliteItem WEATHER_CRYSTAL = materialItemGlinted("weather_crystal").withTags(EIOTags.Items.GEMS_WEATHER_CRYSTAL); + public static final RegiliteItem PRESCIENT_CRYSTAL = materialItemGlinted("prescient_crystal").withTags(EIOTags.Items.GEMS_PRESCIENT_CRYSTAL); // endregion @@ -147,50 +147,50 @@ public class EIOItems { public static final RegiliteItem FLOUR = materialItem("flour"); public static final RegiliteItem POWDERED_COAL = materialItem("powdered_coal") - .addItemTags(EIOTags.Items.DUSTS_COAL); + .withTags(EIOTags.Items.DUSTS_COAL); public static final RegiliteItem POWDERED_IRON = materialItem("powdered_iron") - .addItemTags(EIOTags.Items.DUSTS_IRON); + .withTags(EIOTags.Items.DUSTS_IRON); public static final RegiliteItem POWDERED_GOLD = materialItem("powdered_gold") - .addItemTags(EIOTags.Items.DUSTS_GOLD); + .withTags(EIOTags.Items.DUSTS_GOLD); public static final RegiliteItem POWDERED_COPPER = materialItem("powdered_copper") - .addItemTags(EIOTags.Items.DUSTS_COPPER); + .withTags(EIOTags.Items.DUSTS_COPPER); public static final RegiliteItem POWDERED_TIN = materialItem("powdered_tin") - .addItemTags(EIOTags.Items.DUSTS_TIN); // TODO: hide if tin isn't present + .withTags(EIOTags.Items.DUSTS_TIN); // TODO: hide if tin isn't present public static final RegiliteItem POWDERED_ENDER_PEARL = materialItem("powdered_ender_pearl") - .addItemTags(EIOTags.Items.DUSTS_ENDER); + .withTags(EIOTags.Items.DUSTS_ENDER); public static final RegiliteItem POWDERED_OBSIDIAN = materialItem("powdered_obsidian") - .addItemTags(EIOTags.Items.DUSTS_OBSIDIAN); + .withTags(EIOTags.Items.DUSTS_OBSIDIAN); public static final RegiliteItem POWDERED_COBALT = materialItem("powdered_cobalt") - .addItemTags(EIOTags.Items.DUSTS_COBALT); // TODO: hide if cobalt isnt present + .withTags(EIOTags.Items.DUSTS_COBALT); // TODO: hide if cobalt isnt present public static final RegiliteItem POWDERED_LAPIS_LAZULI = materialItem("powdered_lapis_lazuli") - .addItemTags(EIOTags.Items.DUSTS_LAPIS); + .withTags(EIOTags.Items.DUSTS_LAPIS); public static final RegiliteItem POWDERED_QUARTZ = materialItem("powdered_quartz") - .addItemTags(EIOTags.Items.DUSTS_QUARTZ); + .withTags(EIOTags.Items.DUSTS_QUARTZ); public static final RegiliteItem PRESCIENT_POWDER = materialItemGlinted("prescient_powder") - .addItemTags(EIOTags.Items.DUSTS_GRAINS_OF_PRESCIENCE) - .setTranslation("Grains of Prescience"); + .withTags(EIOTags.Items.DUSTS_GRAINS_OF_PRESCIENCE) + .withTranslation("Grains of Prescience"); public static final RegiliteItem VIBRANT_POWDER = materialItemGlinted("vibrant_powder") - .addItemTags(EIOTags.Items.DUSTS_GRAINS_OF_VIBRANCY) - .setTranslation("Grains of Vibrancy"); + .withTags(EIOTags.Items.DUSTS_GRAINS_OF_VIBRANCY) + .withTranslation("Grains of Vibrancy"); public static final RegiliteItem PULSATING_POWDER = materialItemGlinted("pulsating_powder") - .addItemTags(EIOTags.Items.DUSTS_GRAINS_OF_PIZEALLITY) - .setTranslation("Grains of Piezallity"); + .withTags(EIOTags.Items.DUSTS_GRAINS_OF_PIZEALLITY) + .withTranslation("Grains of Piezallity"); public static final RegiliteItem ENDER_CRYSTAL_POWDER = materialItemGlinted("ender_crystal_powder") - .addItemTags(EIOTags.Items.DUSTS_GRAINS_OF_THE_END) - .setTranslation("Grains of the End"); + .withTags(EIOTags.Items.DUSTS_GRAINS_OF_THE_END) + .withTranslation("Grains of the End"); public static final RegiliteItem PHOTOVOLTAIC_COMPOSITE = materialItem("photovoltaic_composite"); public static final RegiliteItem SOUL_POWDER = materialItem("soul_powder"); @@ -204,41 +204,41 @@ public class EIOItems { // region Gears public static final RegiliteItem GEAR_WOOD = materialItem("wood_gear") - .setTranslation("Wooden Gear") - .addItemTags(EIOTags.Items.GEARS_WOOD); + .withTranslation("Wooden Gear") + .withTags(EIOTags.Items.GEARS_WOOD); public static final RegiliteItem GEAR_STONE = materialItem("stone_gear") - .setTranslation("Stone Compound Gear") - .addItemTags(EIOTags.Items.GEARS_STONE); + .withTranslation("Stone Compound Gear") + .withTags(EIOTags.Items.GEARS_STONE); public static final RegiliteItem GEAR_IRON = materialItem("iron_gear") - .setTranslation("Infinity Bimetal Gear") - .addItemTags(EIOTags.Items.GEARS_IRON); + .withTranslation("Infinity Bimetal Gear") + .withTags(EIOTags.Items.GEARS_IRON); public static final RegiliteItem GEAR_ENERGIZED = materialItem("energized_gear") - .setTranslation("Energized Bimetal Gear") - .addItemTags(EIOTags.Items.GEARS_ENERGIZED); + .withTranslation("Energized Bimetal Gear") + .withTags(EIOTags.Items.GEARS_ENERGIZED); public static final RegiliteItem GEAR_VIBRANT = materialItem("vibrant_gear") - .setTranslation("Vibrant Bimetal Gear") - .addItemTags(EIOTags.Items.GEARS_VIBRANT); + .withTranslation("Vibrant Bimetal Gear") + .withTags(EIOTags.Items.GEARS_VIBRANT); public static final RegiliteItem GEAR_DARK_STEEL = materialItem("dark_bimetal_gear") - .setTranslation("Dark Bimetal Gear") - .addItemTags(EIOTags.Items.GEARS_DARK_STEEL); + .withTranslation("Dark Bimetal Gear") + .withTags(EIOTags.Items.GEARS_DARK_STEEL); // endregion // region Dyes public static final RegiliteItem DYE_GREEN = materialItem("organic_green_dye") - .addItemTags(Tags.Items.DYES_GREEN, Tags.Items.DYES); + .withTags(Tags.Items.DYES_GREEN, Tags.Items.DYES); public static final RegiliteItem DYE_BROWN = materialItem("organic_brown_dye") - .addItemTags(Tags.Items.DYES_BROWN, Tags.Items.DYES); + .withTags(Tags.Items.DYES_BROWN, Tags.Items.DYES); public static final RegiliteItem DYE_BLACK = materialItem("organic_black_dye") - .addItemTags(Tags.Items.DYES_BLACK, Tags.Items.DYES); + .withTags(Tags.Items.DYES_BLACK, Tags.Items.DYES); // endregion @@ -249,10 +249,10 @@ public class EIOItems { public static final RegiliteItem NUTRITIOUS_STICK = materialItem("nutritious_stick"); public static final RegiliteItem PLANT_MATTER_GREEN = materialItem("plant_matter_green") - .setTranslation("Clippings and Trimmings"); + .withTranslation("Clippings and Trimmings"); public static final RegiliteItem PLANT_MATTER_BROWN = materialItem("plant_matter_brown") - .setTranslation("Twigs and Prunings"); + .withTranslation("Twigs and Prunings"); public static final RegiliteItem GLIDER_WING = materialItem("glider_wing"); @@ -267,10 +267,10 @@ public class EIOItems { public static final RegiliteItem BROKEN_SPAWNER = ITEM_REGISTRY .registerItem("broken_spawner", BrokenSpawnerItem::new) - .addItemTags(EIOTags.Items.ENTITY_STORAGE) + .withTags(EIOTags.Items.ENTITY_STORAGE) .setModelProvider(ModelHelper::fakeBlockModel) - .setTab(EIOCreativeTabs.MAIN) - .setTab(EIOCreativeTabs.SOULS, modifier -> modifier.acceptAll(BrokenSpawnerItem.getPossibleStacks())); + .withTab(EIOCreativeTabs.MAIN) + .withTab(EIOCreativeTabs.SOULS, modifier -> modifier.acceptAll(BrokenSpawnerItem.getPossibleStacks())); // endregion @@ -322,8 +322,8 @@ private static RegiliteItem grindingBall(String name, GrindingBall props .component(EIODataComponents.GRINDING_BALL, grindingBallData), false)) - .addItemTags(EIOTags.Items.GRINDING_BALLS) - .setTab(EIOCreativeTabs.MAIN); + .withTags(EIOTags.Items.GRINDING_BALLS) + .withTab(EIOCreativeTabs.MAIN); } // endregion @@ -332,21 +332,21 @@ private static RegiliteItem grindingBall(String name, GrindingBall private static RegiliteItem gliderItem(String name) { return dumbItem(name, HangGliderItem::new) - .addItemTags(EIOTags.Items.GLIDER) - .setTab(EIOCreativeTabs.MAIN) + .withTags(EIOTags.Items.GLIDER) + .withTab(EIOCreativeTabs.MAIN) .setModelProvider((prov, ctx) -> GliderItemModel.create(ctx.get(), prov)); } private static RegiliteItem materialItem(String name) { return ITEM_REGISTRY .registerItem(name, props -> new MaterialItem(props, false)) - .setTab(EIOCreativeTabs.MAIN); + .withTab(EIOCreativeTabs.MAIN); } private static RegiliteItem materialItemGlinted(String name) { return ITEM_REGISTRY .registerItem(name, props -> new MaterialItem(props, true)) - .setTab(EIOCreativeTabs.MAIN); + .withTab(EIOCreativeTabs.MAIN); } // endregion @@ -357,57 +357,55 @@ private static RegiliteItem materialItemGlinted(String name) { public static final RegiliteItem FILLED_SOUL_VIAL = ITEM_REGISTRY .registerItem("filled_soul_vial", SoulVialItem::new, new Item.Properties().stacksTo(1)) - .addItemTags(EIOTags.Items.ENTITY_STORAGE) - .setTab(EIOCreativeTabs.SOULS, modifier -> modifier.acceptAll(SoulVialItem.getAllFilled())) - //TODO .removeTab(CreativeModeTabs.SEARCH) - ; + .withTags(EIOTags.Items.ENTITY_STORAGE) + .withTab(EIOCreativeTabs.SOULS, modifier -> modifier.acceptAll(SoulVialItem.getAllFilled(), CreativeModeTab.TabVisibility.PARENT_TAB_ONLY)); public static final RegiliteItem ENDERIOS = ITEM_REGISTRY .registerItem("enderios", EnderiosItem::new, new Item.Properties().stacksTo(1)) - .setTab(EIOCreativeTabs.MAIN) - .setTranslation("\"Enderios\""); + .withTab(EIOCreativeTabs.MAIN) + .withTranslation("\"Enderios\""); // endregion // region Tools public static final RegiliteItem YETA_WRENCH = ITEM_REGISTRY .registerItem("yeta_wrench", YetaWrenchItem::new, new Item.Properties().stacksTo(1)) - .setTab(EIOCreativeTabs.GEAR) - .addItemTags(EIOTags.Items.WRENCH); + .withTab(EIOCreativeTabs.GEAR) + .withTags(EIOTags.Items.WRENCH); public static final RegiliteItem LOCATION_PRINTOUT = ITEM_REGISTRY .registerItem("location_printout", LocationPrintoutItem::new, new Item.Properties().stacksTo(1)) - .setTab(EIOCreativeTabs.GEAR); + .withTab(EIOCreativeTabs.GEAR); public static final RegiliteItem COORDINATE_SELECTOR = ITEM_REGISTRY .registerItem("coordinate_selector", CoordinateSelectorItem::new, new Item.Properties().stacksTo(1)) - .setTab(EIOCreativeTabs.GEAR); + .withTab(EIOCreativeTabs.GEAR); public static final RegiliteItem EXPERIENCE_ROD = ITEM_REGISTRY .registerItem("experience_rod", ExperienceRodItem::new) - .setTab(EIOCreativeTabs.GEAR); + .withTab(EIOCreativeTabs.GEAR); public static final RegiliteItem LEVITATION_STAFF = ITEM_REGISTRY .registerItem("staff_of_levity", LevitationStaffItem::new) - .setTab(EIOCreativeTabs.GEAR, modifier -> EIOItems.LEVITATION_STAFF.get().addAllVariants(modifier)) - .addCapability(Capabilities.FluidHandler.ITEM, LevitationStaffItem.FLUID_HANDLER_PROVIDER) - .apply(EIOItems::poweredToggledItemCapabilities); + .withTab(EIOCreativeTabs.GEAR, modifier -> EIOItems.LEVITATION_STAFF.get().addAllVariants(modifier)) + .withCapability(Capabilities.FluidHandler.ITEM, LevitationStaffItem.FLUID_HANDLER_PROVIDER) + .with(EIOItems::poweredToggledItemCapabilities); public static final RegiliteItem TRAVEL_STAFF = ITEM_REGISTRY .registerItem("staff_of_travelling", TravelStaffItem::new, new Item.Properties().stacksTo(1)) - .setTab(EIOCreativeTabs.GEAR, modifier -> EIOItems.TRAVEL_STAFF.get().addAllVariants(modifier)) - .addCapability(Capabilities.EnergyStorage.ITEM, TravelStaffItem.ENERGY_STORAGE_PROVIDER); + .withTab(EIOCreativeTabs.GEAR, modifier -> EIOItems.TRAVEL_STAFF.get().addAllVariants(modifier)) + .withCapability(Capabilities.EnergyStorage.ITEM, TravelStaffItem.ENERGY_STORAGE_PROVIDER); public static final RegiliteItem ELECTROMAGNET = ITEM_REGISTRY .registerItem("electromagnet", ElectromagnetItem::new) - .setTab(EIOCreativeTabs.GEAR, modifier -> EIOItems.ELECTROMAGNET.get().addAllVariants(modifier)) - .apply(EIOItems::poweredToggledItemCapabilities); + .withTab(EIOCreativeTabs.GEAR, modifier -> EIOItems.ELECTROMAGNET.get().addAllVariants(modifier)) + .with(EIOItems::poweredToggledItemCapabilities); public static final RegiliteItem COLD_FIRE_IGNITER = ITEM_REGISTRY .registerItem("cold_fire_igniter", ColdFireIgniter::new) - .setTab(EIOCreativeTabs.GEAR, + .withTab(EIOCreativeTabs.GEAR, modifier -> EIOItems.COLD_FIRE_IGNITER.get().addAllVariants(modifier)) // TODO: Might PR this to ITEM_REGISTRY so its nicer, but I like the footprint. - .addCapability(Capabilities.FluidHandler.ITEM, ColdFireIgniter.FLUID_HANDLER_PROVIDER); + .withCapability(Capabilities.FluidHandler.ITEM, ColdFireIgniter.FLUID_HANDLER_PROVIDER); // endregion @@ -415,24 +413,24 @@ private static RegiliteItem materialItemGlinted(String name) { public static final RegiliteItem BASIC_ITEM_FILTER = ITEM_REGISTRY .registerItem("basic_filter", properties -> new ItemFilter(properties.component(EIODataComponents.ITEM_FILTER, new ItemFilterCapability.Component(5)))) - .setTab(EIOCreativeTabs.GEAR) - .addCapability(EIOCapabilities.Filter.ITEM, ItemFilter.FILTER_PROVIDER); + .withTab(EIOCreativeTabs.GEAR) + .withCapability(EIOCapabilities.Filter.ITEM, ItemFilter.FILTER_PROVIDER); public static final RegiliteItem ADVANCED_ITEM_FILTER = ITEM_REGISTRY .registerItem("advanced_filter", properties -> new ItemFilter(properties.component(EIODataComponents.ITEM_FILTER, new ItemFilterCapability.Component(10)))) - .setTab(EIOCreativeTabs.GEAR) - .addCapability(EIOCapabilities.Filter.ITEM, ItemFilter.FILTER_PROVIDER); + .withTab(EIOCreativeTabs.GEAR) + .withCapability(EIOCapabilities.Filter.ITEM, ItemFilter.FILTER_PROVIDER); public static final RegiliteItem BASIC_FLUID_FILTER = ITEM_REGISTRY .registerItem("fluid_filter", properties -> new FluidFilter(properties.component(EIODataComponents.FLUID_FILTER, new FluidFilterCapability.Component(5)))) - .setTab(EIOCreativeTabs.GEAR) - .addCapability(EIOCapabilities.Filter.ITEM, FluidFilter.FILTER_PROVIDER); + .withTab(EIOCreativeTabs.GEAR) + .withCapability(EIOCapabilities.Filter.ITEM, FluidFilter.FILTER_PROVIDER); public static final RegiliteItem ENTITY_FILTER = ITEM_REGISTRY .registerItem("entity_filter", properties -> new EntityFilter(properties.component(EIODataComponents.ENTITY_FILTER, new EntityFilterCapability.Component(5)))) - .setTranslation("Soul Filter") - .setTab(EIOCreativeTabs.GEAR) - .addCapability(EIOCapabilities.Filter.ITEM, EntityFilter.ENTITY_FILTER); + .withTranslation("Soul Filter") + .withTab(EIOCreativeTabs.GEAR) + .withCapability(EIOCapabilities.Filter.ITEM, EntityFilter.ENTITY_FILTER); // endregion @@ -461,8 +459,7 @@ public static MutableComponent capacitorDescriptionBuilder(String type, String v // region Helpers public static RegiliteItem dumbItem(String name, Function factory) { - // TODO: remove from search. - return ITEM_REGISTRY.registerItem(name, factory);//removeTab(CreativeModeTabs.SEARCH); + return ITEM_REGISTRY.registerItem(name, factory); } public static RegiliteItem dumbItem(String name) { @@ -470,11 +467,11 @@ public static RegiliteItem dumbItem(String name) { } public static RegiliteItem groupedItem(String name, Function factory, ResourceKey tab) { - return ITEM_REGISTRY.registerItem(name, factory).setTab(tab); + return ITEM_REGISTRY.registerItem(name, factory).withTab(tab); } private static void poweredToggledItemCapabilities(RegiliteItem item) { - item.addCapability(Capabilities.EnergyStorage.ITEM, PoweredToggledItem.ENERGY_STORAGE_PROVIDER); + item.withCapability(Capabilities.EnergyStorage.ITEM, PoweredToggledItem.ENERGY_STORAGE_PROVIDER); } // endregion diff --git a/enderio-conduits/build.gradle.kts b/enderio-conduits/build.gradle.kts index eaf757824..7ac80c90d 100644 --- a/enderio-conduits/build.gradle.kts +++ b/enderio-conduits/build.gradle.kts @@ -33,7 +33,7 @@ val cctMinecraftVersion: String by project val cctVersion: String by project dependencies { - api("com.enderio:Regilite:$regiliteVersion") + api("com.enderio:regilite:$regiliteVersion") api(project(":enderio-base")) accessTransformers(project(":enderio-base")) diff --git a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java index 63a8a50c8..feb1a9718 100644 --- a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java +++ b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java @@ -25,12 +25,12 @@ public class ConduitBlocks { .noOcclusion() .dynamicShape() .mapColor(MapColor.STONE)) - .setTranslation("Conduit Bundle") + .withTranslation("Conduit Bundle") .setBlockStateProvider(ConduitBlockState::conduit) - .addBlockTags(BlockTags.MINEABLE_WITH_PICKAXE) - .createBlockItem(ITEM_REGISTRY, b -> new ConduitBlockItem(b, new Item.Properties()), + .withTags(BlockTags.MINEABLE_WITH_PICKAXE) + .withBlockItem(ITEM_REGISTRY, b -> new ConduitBlockItem(b, new Item.Properties()), item -> item - .setTranslation(" Conduit") + .withTranslation(" Conduit") .setModelProvider((prov, ctx) -> {})); public static void register(IEventBus bus) { diff --git a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitItems.java b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitItems.java index 338b78559..aeed863f1 100644 --- a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitItems.java +++ b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitItems.java @@ -27,27 +27,27 @@ public class ConduitItems { public static final RegiliteItem EXTRACTION_SPEED_UPGRADE_1 = ITEM_REGISTRY.registerItem("extraction_speed_upgrade_1", properties -> new SpeedUpgradeItem(properties.component(ConduitComponents.EXTRACTION_SPEED_UPGRADE_TIER, 1))) - .setTranslation("Tier 1 Extraction Speed Upgrade") - .setTab(EIOCreativeTabs.CONDUITS) - .addCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); + .withTranslation("Tier 1 Extraction Speed Upgrade") + .withTab(EIOCreativeTabs.CONDUITS) + .withCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); public static final RegiliteItem EXTRACTION_SPEED_UPGRADE_2 = ITEM_REGISTRY.registerItem("extraction_speed_upgrade_2", properties -> new SpeedUpgradeItem(properties.component(ConduitComponents.EXTRACTION_SPEED_UPGRADE_TIER, 2))) - .setTranslation("Tier 2 Extraction Speed Upgrade") - .setTab(EIOCreativeTabs.CONDUITS) - .addCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); + .withTranslation("Tier 2 Extraction Speed Upgrade") + .withTab(EIOCreativeTabs.CONDUITS) + .withCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); public static final RegiliteItem EXTRACTION_SPEED_UPGRADE_3 = ITEM_REGISTRY.registerItem("extraction_speed_upgrade_3", properties -> new SpeedUpgradeItem(properties.component(ConduitComponents.EXTRACTION_SPEED_UPGRADE_TIER, 3))) - .setTranslation("Tier 3 Extraction Speed Upgrade") - .setTab(EIOCreativeTabs.CONDUITS) - .addCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); + .withTranslation("Tier 3 Extraction Speed Upgrade") + .withTab(EIOCreativeTabs.CONDUITS) + .withCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); public static final RegiliteItem EXTRACTION_SPEED_UPGRADE_4 = ITEM_REGISTRY.registerItem("extraction_speed_upgrade_4", properties -> new SpeedUpgradeItem(properties.component(ConduitComponents.EXTRACTION_SPEED_UPGRADE_TIER, 4))) - .setTranslation("Tier 4 Extraction Speed Upgrade") - .setTab(EIOCreativeTabs.CONDUITS) - .addCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); + .withTranslation("Tier 4 Extraction Speed Upgrade") + .withTab(EIOCreativeTabs.CONDUITS) + .withCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); public static final RegiliteItem NOT_FILTER = createRedstoneFilter("redstone_not_filter", ConduitComponents.REDSTONE_NOT_FILTER, Unit.INSTANCE, RedstoneFilterItem.NOT_FILTER_PROVIDER, null); @@ -75,8 +75,8 @@ public class ConduitItems { public static RegiliteItem createRedstoneFilter(String name, DeferredHolder, DataComponentType> type, T defaultValue, ICapabilityProvider provider, Supplier> menu) { return ITEM_REGISTRY .registerItem(name, properties -> new RedstoneFilterItem(properties.component(type, defaultValue), menu)) - .setTab(EIOCreativeTabs.CONDUITS) - .addCapability(EIOCapabilities.Filter.ITEM, provider); + .withTab(EIOCreativeTabs.CONDUITS) + .withCapability(EIOCapabilities.Filter.ITEM, provider); } public static void register(IEventBus bus) { diff --git a/enderio-machines/build.gradle.kts b/enderio-machines/build.gradle.kts index 79bc07cf1..0f04cec7c 100644 --- a/enderio-machines/build.gradle.kts +++ b/enderio-machines/build.gradle.kts @@ -24,7 +24,7 @@ val graphlibVersion: String by project val graphlibVersionRange: String by project dependencies { - api("com.enderio:Regilite:$regiliteVersion") + api("com.enderio:regilite:$regiliteVersion") api(project(":enderio-base")) accessTransformers(project(":enderio-base")) diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlockEntities.java b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlockEntities.java index a07abfb27..4a0f0b671 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlockEntities.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlockEntities.java @@ -60,88 +60,89 @@ public class MachineBlockEntities { public static final RegiliteBlockEntity FLUID_TANK = register("fluid_tank", FluidTankBlockEntity.Standard::new, MachineBlocks.FLUID_TANK) - .setRenderer(() -> FluidTankBER::new) - .apply(MachineBlockEntities::machineBlockEntityCapabilities) - .apply(MachineBlockEntities::fluidHandlerCapability); + .withRenderer(() -> FluidTankBER::new) + .with(MachineBlockEntities::machineBlockEntityCapabilities) + .with(MachineBlockEntities::fluidHandlerCapability); public static final RegiliteBlockEntity PRESSURIZED_FLUID_TANK = register("pressurized_fluid_tank", FluidTankBlockEntity.Enhanced::new, MachineBlocks.PRESSURIZED_FLUID_TANK) - .setRenderer(() -> FluidTankBER::new) - .apply(MachineBlockEntities::machineBlockEntityCapabilities) - .apply(MachineBlockEntities::fluidHandlerCapability); + .withRenderer(() -> FluidTankBER::new) + .with(MachineBlockEntities::machineBlockEntityCapabilities) + .with(MachineBlockEntities::fluidHandlerCapability); public static final RegiliteBlockEntity ENCHANTER = register("enchanter", EnchanterBlockEntity::new, MachineBlocks.ENCHANTER); public static final RegiliteBlockEntity PRIMITIVE_ALLOY_SMELTER = register("primitive_alloy_smelter", PrimitiveAlloySmelterBlockEntity::new, MachineBlocks.PRIMITIVE_ALLOY_SMELTER) - .apply(MachineBlockEntities::machineBlockEntityCapabilities); + .with(MachineBlockEntities::machineBlockEntityCapabilities); public static final RegiliteBlockEntity ALLOY_SMELTER = register("alloy_smelter", AlloySmelterBlockEntity::factory, MachineBlocks.ALLOY_SMELTER) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final RegiliteBlockEntity CREATIVE_POWER = register("creative_power", CreativePowerBlockEntity::new, MachineBlocks.CREATIVE_POWER) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final RegiliteBlockEntity STIRLING_GENERATOR = register("stirling_generator", StirlingGeneratorBlockEntity::new, MachineBlocks.STIRLING_GENERATOR) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final RegiliteBlockEntity SAG_MILL = register("sag_mill", SagMillBlockEntity::new, MachineBlocks.SAG_MILL) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final RegiliteBlockEntity SLICE_AND_SPLICE = register("slice_and_splice", SlicerBlockEntity::new, MachineBlocks.SLICE_AND_SPLICE) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final RegiliteBlockEntity IMPULSE_HOPPER = register("impulse_hopper", ImpulseHopperBlockEntity::new, MachineBlocks.IMPULSE_HOPPER) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final RegiliteBlockEntity VACUUM_CHEST = register("vacuum_chest", VacuumChestBlockEntity::new, MachineBlocks.VACUUM_CHEST) - .apply(MachineBlockEntities::machineBlockEntityCapabilities); + .with(MachineBlockEntities::machineBlockEntityCapabilities); public static final RegiliteBlockEntity XP_VACUUM = register("xp_vacuum", XPVacuumBlockEntity::new, MachineBlocks.XP_VACUUM) - .apply(MachineBlockEntities::machineBlockEntityCapabilities) - .apply(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::machineBlockEntityCapabilities) + .with(MachineBlockEntities::fluidHandlerCapability); public static final RegiliteBlockEntity TRAVEL_ANCHOR = register("travel_anchor", TravelAnchorBlockEntity::new, MachineBlocks.TRAVEL_ANCHOR) - .apply(MachineBlockEntities::machineBlockEntityCapabilities); + .with(MachineBlockEntities::machineBlockEntityCapabilities); public static final RegiliteBlockEntity PAINTED_TRAVEL_ANCHOR = register("painted_travel_anchor", - PaintedTravelAnchorBlockEntity::new, MachineBlocks.PAINTED_TRAVEL_ANCHOR).apply(MachineBlockEntities::machineBlockEntityCapabilities); + PaintedTravelAnchorBlockEntity::new, MachineBlocks.PAINTED_TRAVEL_ANCHOR) + .with(MachineBlockEntities::machineBlockEntityCapabilities); public static final RegiliteBlockEntity CRAFTER = register("crafter", CrafterBlockEntity::new, MachineBlocks.CRAFTER) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final RegiliteBlockEntity DRAIN = register("drain", DrainBlockEntity::new, MachineBlocks.DRAIN) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities) - .apply(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .with(MachineBlockEntities::fluidHandlerCapability); public static final RegiliteBlockEntity SOUL_BINDER = register("soul_binder", SoulBinderBlockEntity::new, MachineBlocks.SOUL_BINDER) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities) - .apply(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .with(MachineBlockEntities::fluidHandlerCapability); public static final RegiliteBlockEntity WIRED_CHARGER = register("wired_charger", WiredChargerBlockEntity::new, MachineBlocks.WIRED_CHARGER) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final RegiliteBlockEntity PAINTING_MACHINE = register("painting_machine", PaintingMachineBlockEntity::new, MachineBlocks.PAINTING_MACHINE) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final RegiliteBlockEntity POWERED_SPAWNER = register("powered_spawner", PoweredSpawnerBlockEntity::new, MachineBlocks.POWERED_SPAWNER) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final Map> SOLAR_PANELS = Util.make(() -> { Map> map = new HashMap<>(); @@ -151,7 +152,7 @@ public class MachineBlockEntities { register(tier.name().toLowerCase(Locale.ROOT) + "_photovoltaic_cell", (worldPosition, blockState) -> new SolarPanelBlockEntity(worldPosition, blockState, tier), () -> MachineBlocks.SOLAR_PANELS.get(tier).get()) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities)); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities)); } return ImmutableMap.copyOf(map); }); @@ -165,43 +166,43 @@ public class MachineBlockEntities { tier.name().toLowerCase(Locale.ROOT) + "_capacitor_bank", (worldPosition, blockState) -> new CapacitorBankBlockEntity(worldPosition, blockState, tier), () -> MachineBlocks.CAPACITOR_BANKS.get(tier).get()) - .setRenderer(() -> CapacitorBankBER::new) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities)); + .withRenderer(() -> CapacitorBankBER::new) + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities)); } return ImmutableMap.copyOf(map); }); public static final RegiliteBlockEntity SOUL_ENGINE = register("soul_engine", SoulEngineBlockEntity::new, MachineBlocks.SOUL_ENGINE) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities) - .apply(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .with(MachineBlockEntities::fluidHandlerCapability); public static final RegiliteBlockEntity XP_OBELISK = register("xp_obelisk", XPObeliskBlockEntity::new, MachineBlocks.XP_OBELISK) - .setRenderer(() -> XPObeliskBER::new) + .withRenderer(() -> XPObeliskBER::new) // TODO: Make XP Obelisk use the common base class :) //.setRenderer(() -> ObeliskBER.factory(EIOItems.EXPERIENCE_ROD::get)) - .apply(MachineBlockEntities::machineBlockEntityCapabilities) - .apply(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::machineBlockEntityCapabilities) + .with(MachineBlockEntities::fluidHandlerCapability); public static final RegiliteBlockEntity VAT = register("vat", VatBlockEntity::new, MachineBlocks.VAT) - .apply(MachineBlockEntities::machineBlockEntityCapabilities) - .apply(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::machineBlockEntityCapabilities) + .with(MachineBlockEntities::fluidHandlerCapability); public static final RegiliteBlockEntity INHIBITOR_OBELISK = register("inhibitor_obelisk", InhibitorObeliskBlockEntity::new, MachineBlocks.INHIBITOR_OBELISK) - .setRenderer(() -> ObeliskBER.factory(() -> Items.ENDER_PEARL)) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .withRenderer(() -> ObeliskBER.factory(() -> Items.ENDER_PEARL)) + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final RegiliteBlockEntity AVERSION_OBELISK = register("aversion_obelisk", AversionObeliskBlockEntity::new, MachineBlocks.AVERSION_OBELISK) - .setRenderer(() -> ObeliskBER.factory(EIOBlocks.ENDERMAN_HEAD::asItem)) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .withRenderer(() -> ObeliskBER.factory(EIOBlocks.ENDERMAN_HEAD::asItem)) + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); public static final RegiliteBlockEntity RELOCATOR_OBELISK = register("relocator_obelisk", RelocatorObeliskBlockEntity::new, MachineBlocks.RELOCATOR_OBELISK) - .setRenderer(() -> ObeliskBER.factory(() -> Items.PRISMARINE)) - .apply(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .withRenderer(() -> ObeliskBER.factory(() -> Items.PRISMARINE)) + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); @SafeVarargs private static RegiliteBlockEntity register(String name, BlockEntityType.BlockEntitySupplier beFactory, @@ -211,17 +212,17 @@ private static RegiliteBlockEntity register(String na } private static void machineBlockEntityCapabilities(RegiliteBlockEntity blockEntity) { - blockEntity.addCapability(EIOCapabilities.SideConfig.BLOCK, MachineBlockEntity.SIDE_CONFIG_PROVIDER); - blockEntity.addCapability(Capabilities.ItemHandler.BLOCK, MachineBlockEntity.ITEM_HANDLER_PROVIDER); + blockEntity.withCapability(EIOCapabilities.SideConfig.BLOCK, MachineBlockEntity.SIDE_CONFIG_PROVIDER); + blockEntity.withCapability(Capabilities.ItemHandler.BLOCK, MachineBlockEntity.ITEM_HANDLER_PROVIDER); } private static void poweredMachineBlockEntityCapabilities(RegiliteBlockEntity blockEntity) { machineBlockEntityCapabilities(blockEntity); - blockEntity.addCapability(Capabilities.EnergyStorage.BLOCK, PoweredMachineBlockEntity.ENERGY_STORAGE_PROVIDER); + blockEntity.withCapability(Capabilities.EnergyStorage.BLOCK, PoweredMachineBlockEntity.ENERGY_STORAGE_PROVIDER); } private static void fluidHandlerCapability(RegiliteBlockEntity blockEntity) { - blockEntity.addCapability(Capabilities.FluidHandler.BLOCK, FluidTankUser.FLUID_HANDLER_PROVIDER); + blockEntity.withCapability(Capabilities.FluidHandler.BLOCK, FluidTankUser.FLUID_HANDLER_PROVIDER); } public static void register(IEventBus bus) { diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java index 721fc2baa..3bda98d0d 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java @@ -59,8 +59,8 @@ public class MachineBlocks { public static final RegiliteBlock FLUID_TANK = BLOCK_REGISTRY .registerBlock("fluid_tank", props -> new MachineBlock(MachineBlockEntities.FLUID_TANK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .setLootTable(MachinesLootTable::copyComponents) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .setBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() .getBuilder(ctx.getName()) .customLoader(CompositeModelBuilder::begin) @@ -69,19 +69,19 @@ public class MachineBlocks { .end() .texture("particle", EnderIOBase.loc("block/machine_side")) )) - .createBlockItem(ITEM_REGISTRY, + .withBlockItem(ITEM_REGISTRY, block -> new FluidTankItem(block, new Item.Properties(), 16000), item -> item .setModelProvider((prov, ctx) -> {}) - .setTab(EIOCreativeTabs.MACHINES) - .addCapability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) + .withTab(EIOCreativeTabs.MACHINES) + .withCapability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) ); public static final RegiliteBlock PRESSURIZED_FLUID_TANK = BLOCK_REGISTRY .registerBlock("pressurized_fluid_tank", props -> new MachineBlock(MachineBlockEntities.PRESSURIZED_FLUID_TANK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .setLootTable(MachinesLootTable::copyComponents) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .setBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() .withExistingParent(ctx.getName(), prov.mcLoc("block/block")) .customLoader(CompositeModelBuilder::begin) @@ -90,20 +90,20 @@ public class MachineBlocks { .end() .texture("particle", EnderIOBase.loc("block/machine_side")) )) - .createBlockItem(ITEM_REGISTRY, (block) -> new FluidTankItem(block, new Item.Properties(), 32000), + .withBlockItem(ITEM_REGISTRY, (block) -> new FluidTankItem(block, new Item.Properties(), 32000), item -> item .setModelProvider((prov, ctx) -> {}) - .setTab(EIOCreativeTabs.MACHINES) - .addCapability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) + .withTab(EIOCreativeTabs.MACHINES) + .withCapability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) ); public static final RegiliteBlock ENCHANTER = BLOCK_REGISTRY .registerBlock("enchanter", EnchanterBlock::new, BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion().isViewBlocking((pState, pLevel, pPos) -> false)) - .setLootTable(MachinesLootTable::copyComponents) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .setBlockStateProvider(MachineModelUtil::machineBlock) - .createBlockItem(ITEM_REGISTRY, item -> item.setTab(EIOCreativeTabs.MACHINES)); + .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); public static final RegiliteBlock PRIMITIVE_ALLOY_SMELTER = progressMachine("primitive_alloy_smelter", () -> MachineBlockEntities.PRIMITIVE_ALLOY_SMELTER); @@ -119,70 +119,70 @@ public class MachineBlocks { public static final RegiliteBlock CREATIVE_POWER = BLOCK_REGISTRY .registerBlock("creative_power", props -> new MachineBlock(MachineBlockEntities.CREATIVE_POWER, props), BlockBehaviour.Properties.of()) - .createBlockItem(ITEM_REGISTRY, item -> item.setTab(EIOCreativeTabs.MACHINES)); + .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); public static final RegiliteBlock STIRLING_GENERATOR = progressMachine("stirling_generator", () -> MachineBlockEntities.STIRLING_GENERATOR); public static final RegiliteBlock SAG_MILL = progressMachine("sag_mill", () -> MachineBlockEntities.SAG_MILL) - .setTranslation("SAG Mill"); + .withTranslation("SAG Mill"); public static final RegiliteBlock SLICE_AND_SPLICE = progressMachine("slice_and_splice", () -> MachineBlockEntities.SLICE_AND_SPLICE) - .setTranslation("Slice'N'Splice"); + .withTranslation("Slice'N'Splice"); public static final RegiliteBlock IMPULSE_HOPPER = progressMachine("impulse_hopper", () -> MachineBlockEntities.IMPULSE_HOPPER) - .setTranslation("Impulse Hopper"); + .withTranslation("Impulse Hopper"); public static final RegiliteBlock SOUL_BINDER = progressMachine("soul_binder", () -> MachineBlockEntities.SOUL_BINDER) - .setTranslation("Soul Binder"); + .withTranslation("Soul Binder"); public static final RegiliteBlock POWERED_SPAWNER = BLOCK_REGISTRY .registerBlock("powered_spawner", properties -> new ProgressMachineBlock(MachineBlockEntities.POWERED_SPAWNER, properties), BlockBehaviour.Properties.of().strength(2.5f, 8)) - .setLootTable((l,t) -> MachinesLootTable.copyStandardComponentsWith(l, t, EIODataComponents.STORED_ENTITY.get())) + .withLootTable((l,t) -> MachinesLootTable.copyStandardComponentsWith(l, t, EIODataComponents.STORED_ENTITY.get())) .setBlockStateProvider(MachineModelUtil::progressMachineBlock) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .createBlockItem(ITEM_REGISTRY, b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withBlockItem(ITEM_REGISTRY, b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), item -> item - .setTab(EIOCreativeTabs.MACHINES) - .addItemTags(EIOTags.Items.ENTITY_STORAGE) + .withTab(EIOCreativeTabs.MACHINES) + .withTags(EIOTags.Items.ENTITY_STORAGE) ); public static final RegiliteBlock VACUUM_CHEST = BLOCK_REGISTRY .registerBlock("vacuum_chest", p -> new MachineBlock(MachineBlockEntities.VACUUM_CHEST, p), BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .createBlockItem(ITEM_REGISTRY, item -> item.setTab(EIOCreativeTabs.MACHINES)); + .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); public static final RegiliteBlock XP_VACUUM = BLOCK_REGISTRY .registerBlock("xp_vacuum", p -> new MachineBlock(MachineBlockEntities.XP_VACUUM, p), BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .setTranslation("XP Vacuum") - .createBlockItem(ITEM_REGISTRY, item -> item.setTab(EIOCreativeTabs.MACHINES)); + .withTranslation("XP Vacuum") + .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); public static final RegiliteBlock TRAVEL_ANCHOR = BLOCK_REGISTRY .registerBlock("travel_anchor", TravelAnchorBlock::new, BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .createBlockItem(ITEM_REGISTRY, item -> item.setTab(EIOCreativeTabs.MACHINES)); + .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); public static final RegiliteBlock PAINTED_TRAVEL_ANCHOR = BLOCK_REGISTRY .registerBlock("painted_travel_anchor", PaintedTravelAnchorBlock::new, BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setColorSupplier(() -> PaintedBlockColor::new) - .setLootTable(DecorLootTable::withPaint) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withBlockColor(() -> PaintedBlockColor::new) + .withLootTable(DecorLootTable::withPaint) .setBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock("painted_travel_anchor", prov, ctx.get(), Blocks.DIRT, null)) //Any cube will do - .createBlockItem( + .withBlockItem( ITEM_REGISTRY, b -> new PaintedBlockItem(b, new Item.Properties()), item -> item.setColorSupplier(() -> PaintedBlockColor::new)); @@ -209,68 +209,68 @@ public class MachineBlocks { public static final RegiliteBlock SOUL_ENGINE = BLOCK_REGISTRY .registerBlock("soul_engine", p -> new ProgressMachineBlock(MachineBlockEntities.SOUL_ENGINE, p), BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) - .setLootTable(MachinesLootTable::copyComponents) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .setBlockStateProvider(MachineModelUtil::progressMachineBlock) - .createBlockItem(ITEM_REGISTRY, b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), + .withBlockItem(ITEM_REGISTRY, b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), item -> item - .setTab(EIOCreativeTabs.MACHINES) - .addItemTags(EIOTags.Items.ENTITY_STORAGE) + .withTab(EIOCreativeTabs.MACHINES) + .withTags(EIOTags.Items.ENTITY_STORAGE) ); public static final RegiliteBlock DRAIN = progressMachine("drain", () -> MachineBlockEntities.DRAIN); - public static final RegiliteBlock VAT = machine("vat", () -> MachineBlockEntities.VAT).setTranslation("VAT"); + public static final RegiliteBlock VAT = machine("vat", () -> MachineBlockEntities.VAT).withTranslation("VAT"); public static final RegiliteBlock BLOCK_DETECTOR = BLOCK_REGISTRY .registerBlock("block_detector", BlockDetectorBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.OBSERVER)) - .addBlockTags(BlockTags.MINEABLE_WITH_PICKAXE) + .withTags(BlockTags.MINEABLE_WITH_PICKAXE) .setBlockStateProvider((prov, ctx) -> prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName()))) - .createBlockItem(ITEM_REGISTRY, item -> item.setTab((EIOCreativeTabs.MACHINES))); + .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); public static final RegiliteBlock XP_OBELISK = BLOCK_REGISTRY .registerBlock("xp_obelisk", props -> new MachineBlock(MachineBlockEntities.XP_OBELISK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .setLootTable(MachinesLootTable::copyComponents) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .setTranslation("XP Obelisk") - .createBlockItem(ITEM_REGISTRY, item -> item.setTab((EIOCreativeTabs.MACHINES))); + .withTranslation("XP Obelisk") + .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); public static final RegiliteBlock INHIBITOR_OBELISK = BLOCK_REGISTRY .registerBlock("inhibitor_obelisk", props -> new MachineBlock(MachineBlockEntities.INHIBITOR_OBELISK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .setLootTable(MachinesLootTable::copyComponents) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .createBlockItem(ITEM_REGISTRY, item -> item.setTab((EIOCreativeTabs.MACHINES))); + .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); public static final RegiliteBlock AVERSION_OBELISK = BLOCK_REGISTRY .registerBlock("aversion_obelisk", props -> new MachineBlock(MachineBlockEntities.AVERSION_OBELISK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .setLootTable(MachinesLootTable::copyComponents) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .createBlockItem(ITEM_REGISTRY, item -> item.setTab((EIOCreativeTabs.MACHINES))); + .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); public static final RegiliteBlock RELOCATOR_OBELISK = BLOCK_REGISTRY .registerBlock("relocator_obelisk", props -> new MachineBlock(MachineBlockEntities.RELOCATOR_OBELISK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .setLootTable(MachinesLootTable::copyComponents) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .createBlockItem(ITEM_REGISTRY, item -> item.setTab((EIOCreativeTabs.MACHINES))); + .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); //used when single methods needs to be overridden in the block class private static RegiliteBlock baseMachine(RegiliteBlock machineBlock, BiConsumer> blockStateProvider) { return machineBlock - .setLootTable(MachinesLootTable::copyComponents) - .addBlockTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .setBlockStateProvider(blockStateProvider) - .createBlockItem(ITEM_REGISTRY, item -> item - .setTab(EIOCreativeTabs.MACHINES) + .withBlockItem(ITEM_REGISTRY, item -> item + .withTab(EIOCreativeTabs.MACHINES) ); } @@ -294,12 +294,12 @@ private static RegiliteBlock solarPanel(String name, Supplier new SolarPanelBlock(RegiliteBlockEntity.get(), props, tier), BlockBehaviour.Properties.of().strength(2.5f, 8)) .setBlockStateProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) - .addBlockTags(BlockTags.MINEABLE_WITH_PICKAXE) - .setLootTable(MachinesLootTable::copyComponents) - .createBlockItem(ITEM_REGISTRY, item -> item + .withTags(BlockTags.MINEABLE_WITH_PICKAXE) + .withLootTable(MachinesLootTable::copyComponents) + .withBlockItem(ITEM_REGISTRY, item -> item .setModelProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) - .setTab(EIOCreativeTabs.MACHINES) - .addItemTags(EIOTags.Items.ENTITY_STORAGE) + .withTab(EIOCreativeTabs.MACHINES) + .withTags(EIOTags.Items.ENTITY_STORAGE) ); } @@ -308,14 +308,14 @@ private static RegiliteBlock capacitorBank(String name, Supp .registerBlock(name, props -> new CapacitorBankBlock(props, RegiliteBlockEntity.get(), tier), BlockBehaviour.Properties.of().strength(2.5f, 8)) .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc(ctx.getName())))) - .setLootTable(MachinesLootTable::copyComponents) - .addBlockTags(BlockTags.MINEABLE_WITH_PICKAXE) - .createBlockItem(ITEM_REGISTRY, + .withLootTable(MachinesLootTable::copyComponents) + .withTags(BlockTags.MINEABLE_WITH_PICKAXE) + .withBlockItem(ITEM_REGISTRY, block -> new CapacitorBankItem(block, new Item.Properties()), item -> item .setModelProvider((prov, ctx) -> {}) - .setTab(EIOCreativeTabs.MACHINES) - .addCapability(Capabilities.EnergyStorage.ITEM, CapacitorBankItem.ENERGY_STORAGE_PROVIDER) + .withTab(EIOCreativeTabs.MACHINES) + .withCapability(Capabilities.EnergyStorage.ITEM, CapacitorBankItem.ENERGY_STORAGE_PROVIDER) ); } diff --git a/gradle.properties b/gradle.properties index 48c989b22..585f4e6a0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,7 @@ neoForge.parchment.minecraftVersion=1.21 neoForge.parchment.mappingsVersion=2024.07.28 # Dependencies -regiliteVersion=1.21-0.0.4-alpha +regiliteVersion=0.1-dev+9835048 jeiMinecraftVersion=1.21.1 jeiVersion=19.18.10.218 From 8e086e41500b51a29c32c8d6d66644f5cf87cf83 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Mon, 15 Jul 2024 22:28:45 +0100 Subject: [PATCH 2/7] Handle the last of the set method renames --- .../armory/common/init/ArmoryItems.java | 2 +- .../base/common/block/glass/GlassBlocks.java | 10 ++-- .../enderio/base/common/init/EIOBlocks.java | 56 +++++++++---------- .../enderio/base/common/init/EIOItems.java | 8 +-- .../conduits/common/init/ConduitBlocks.java | 4 +- .../machines/common/init/MachineBlocks.java | 44 +++++++-------- 6 files changed, 62 insertions(+), 62 deletions(-) diff --git a/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java b/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java index 4fd7dd594..9ceb0cc30 100644 --- a/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java +++ b/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java @@ -28,7 +28,7 @@ public class ArmoryItems { .registerItem("dark_steel_sword", DarkSteelSwordItem::new, new Item.Properties().durability(2000)) .withTab(EIOCreativeTabs.GEAR) .withTranslation("The Ender") - .setModelProvider((prov, ctx) -> prov.handheld(ctx.get())); + .withModelProvider((prov, ctx) -> prov.handheld(ctx.get())); // TODO: Bring these back when they are finished. // public static final ItemEntry DARK_STEEL_PICKAXE = REGISTRATE diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java b/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java index 78f3b0d4e..40e6ded2f 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java @@ -79,7 +79,7 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It .isSuffocating(GlassBlocks::never) .isViewBlocking(GlassBlocks::never)) .withTranslation("") - .setBlockStateProvider((cons, ctx) -> cons.simpleBlock(ctx.get(), cons.models().getExistingFile(getModelFile()))) + .withBlockStateProvider((cons, ctx) -> cons.simpleBlock(ctx.get(), cons.models().getExistingFile(getModelFile()))) .withTags( glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS ); @@ -90,7 +90,7 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It glassIdentifier.explosion_resistance() ? EIOTags.Items.FUSED_QUARTZ : EIOTags.Items.CLEAR_GLASS, EIOTags.Items.GLASS_TAGS.get(glassIdentifier) ) - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); + .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); if (glassIdentifier.lighting() == GlassLighting.EMITTING && glassIdentifier.explosion_resistance()) { item.withTags(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); @@ -122,7 +122,7 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It .isViewBlocking(GlassBlocks::never) .mapColor(color)) .withTranslation("") - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(getModelFile()))) + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(getModelFile()))) .withBlockColor(() -> () -> (state, level, pos, tintIndex) -> color.getMapColor().col) .withTags( glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS @@ -130,12 +130,12 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It block.withBlockItem(itemRegistry, item -> { item.withTab(EIOCreativeTabs.BLOCKS) - .setColorSupplier(() -> () -> (stack, tintIndex) -> color.getMapColor().col) + .withItemColor(() -> () -> (stack, tintIndex) -> color.getMapColor().col) .withTags( glassIdentifier.explosion_resistance() ? EIOTags.Items.FUSED_QUARTZ : EIOTags.Items.CLEAR_GLASS, EIOTags.Items.GLASS_TAGS.get(glassIdentifier) ) - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); + .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); if (glassIdentifier.lighting() == GlassLighting.EMITTING && glassIdentifier.explosion_resistance()) { item.withTags(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java index 0d8a0f712..5d0f64ebf 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java @@ -134,7 +134,7 @@ public class EIOBlocks { public static final RegiliteBlock DARK_STEEL_LADDER = BLOCK_REGISTRY .registerBlock("dark_steel_ladder", DarkSteelLadderBlock::new, BlockBehaviour.Properties.of().strength(0.4f).requiresCorrectToolForDrops().sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) - .setBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov + .withBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov .models() .withExistingParent(ctx.getName(), prov.mcLoc("block/ladder")) .renderType(prov.mcLoc("cutout_mipped")) @@ -142,56 +142,56 @@ public class EIOBlocks { .texture("texture", prov.blockTexture(ctx.get())))) .withTags(BlockTags.CLIMBABLE, BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_ladder"))) + .withModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_ladder"))) .withTab(EIOCreativeTabs.BLOCKS)); public static final RegiliteBlock DARK_STEEL_BARS = BLOCK_REGISTRY .registerBlock("dark_steel_bars", IronBarsBlock::new, BlockBehaviour.Properties.of().strength(5.0f, 1000.0f).requiresCorrectToolForDrops().sound(SoundType.METAL).noOcclusion()) - .setBlockStateProvider(EIOBlockState::paneBlock) + .withBlockStateProvider(EIOBlockState::paneBlock) .withTags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) .withBlockItem(ITEM_REGISTRY, item -> item .withTab(EIOCreativeTabs.BLOCKS) - .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_bars"))) + .withModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_bars"))) ); public static final RegiliteBlock DARK_STEEL_DOOR = BLOCK_REGISTRY .registerBlock("dark_steel_door", props -> new DoorBlock(BlockSetType.IRON, props), BlockBehaviour.Properties.of().strength(5.0f, 2000.0f).sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) .withLootTable(RegiliteBlockLootProvider::createDoor) - .setBlockStateProvider( + .withBlockStateProvider( (prov, ctx) -> prov.doorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_door_bottom"), prov.modLoc("block/dark_steel_door_top"), prov.mcLoc("cutout"))) .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.DOORS) .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get())) + .withModelProvider((prov, ctx) -> prov.basicItem(ctx.get())) .withTab(EIOCreativeTabs.BLOCKS) ); public static final RegiliteBlock DARK_STEEL_TRAPDOOR = BLOCK_REGISTRY .registerBlock("dark_steel_trapdoor", props -> new TrapDoorBlock(BlockSetType.IRON, props), BlockBehaviour.Properties.of().strength(5.0f, 2000.0f).sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) - .setBlockStateProvider((prov, ctx) -> prov.trapdoorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_trapdoor"), true, prov.mcLoc("cutout"))) + .withBlockStateProvider((prov, ctx) -> prov.trapdoorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_trapdoor"), true, prov.mcLoc("cutout"))) .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.TRAPDOORS) .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.modLoc("block/dark_steel_trapdoor_bottom"))) + .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.modLoc("block/dark_steel_trapdoor_bottom"))) .withTab(EIOCreativeTabs.BLOCKS) ); public static final RegiliteBlock END_STEEL_BARS = BLOCK_REGISTRY .registerBlock("end_steel_bars", IronBarsBlock::new, BlockBehaviour.Properties.of().strength(5.0f, 1000.0f).requiresCorrectToolForDrops().sound(SoundType.METAL).noOcclusion()) - .setBlockStateProvider(EIOBlockState::paneBlock) + .withBlockStateProvider(EIOBlockState::paneBlock) .withTags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) .withBlockItem(ITEM_REGISTRY, item -> item .withTab(EIOCreativeTabs.BLOCKS) - .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/end_steel_bars"))) + .withModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/end_steel_bars"))) ); public static final RegiliteBlock REINFORCED_OBSIDIAN = BLOCK_REGISTRY @@ -247,7 +247,7 @@ private static Map fillGlassMap() { BlockTags.MINEABLE_WITH_PICKAXE, Tags.Blocks.CHAINS ) - .setBlockStateProvider((prov, ctx) -> { + .withBlockStateProvider((prov, ctx) -> { var model = prov .models() .withExistingParent(ctx.getName(), prov.mcLoc("block/chain")) @@ -265,7 +265,7 @@ private static Map fillGlassMap() { public static final RegiliteBlock COLD_FIRE = BLOCK_REGISTRY .registerBlock("cold_fire", ColdFireBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.FIRE).noLootTable()) - .setBlockStateProvider((prov, ctx) -> { + .withBlockStateProvider((prov, ctx) -> { // This generates the models used for the blockstate in our resources. // One day we may bother to datagen that file. String[] toCopy = { "fire_floor0", "fire_floor1", "fire_side0", "fire_side1", "fire_side_alt0", "fire_side_alt1", "fire_up0", "fire_up1", @@ -403,23 +403,23 @@ private static Map fillGlassMap() { public static final RegiliteBlock LIGHT_NODE = BLOCK_REGISTRY .registerBlock("light_node", LightNode::new, BlockBehaviour.Properties.ofFullCopy(Blocks.AIR).lightLevel(l -> 15).noLootTable().noCollission().noOcclusion()) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().withExistingParent("light_node", "block/air"))); + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().withExistingParent("light_node", "block/air"))); public static final RegiliteBlock ENDERMAN_HEAD = BLOCK_REGISTRY .registerBlock("enderman_head", EnderSkullBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SKELETON_SKULL).instrument(NoteBlockInstrument.SKELETON).strength(1.0F).pushReaction(PushReaction.DESTROY)) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) .withBlockItem(ITEM_REGISTRY, // TODO: Properties being handled right? Maybe cleaner if we have a factory that takes properties, then a properties arg. (enderSkullBlock) -> new EnderSkullBlockItem(enderSkullBlock, new Item.Properties(), Direction.DOWN), item -> item .withTab(EIOCreativeTabs.MAIN) - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), "item/template_skull"))); + .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), "item/template_skull"))); public static final RegiliteBlock WALL_ENDERMAN_HEAD = BLOCK_REGISTRY .registerBlock("wall_enderman_head", WallEnderSkullBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SKELETON_SKULL).strength(1.0F).lootFrom(ENDERMAN_HEAD).pushReaction(PushReaction.DESTROY)) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) .withTranslation(""); private static RegiliteBlock metalBlock(String name, TagKey blockTag, TagKey itemTag) { @@ -439,7 +439,7 @@ private static RegiliteBlock metalBlock(String name, TagKey blockT private static RegiliteBlock chassisBlock(String name) { return BLOCK_REGISTRY .registerBlock(name, Block::new, BlockBehaviour.Properties.of().noOcclusion().sound(SoundType.METAL).mapColor(MapColor.METAL).strength(5, 6)) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().cubeAll(name, prov.blockTexture(ctx.get())).renderType(prov.mcLoc("translucent")))) .withTags( BlockTags.NEEDS_STONE_TOOL, @@ -456,7 +456,7 @@ private static RegiliteBlock pressurePlateBlock(String na return BLOCK_REGISTRY .registerBlock(name, props -> new EIOPressurePlateBlock(props, type, silent), BlockBehaviour.Properties.of().strength(5, 6).mapColor(MapColor.METAL)) - .setBlockStateProvider((prov, ctx) -> { + .withBlockStateProvider((prov, ctx) -> { BlockModelProvider modProv = prov.models(); ModelFile dm = modProv.withExistingParent(name + "_down", prov.mcLoc("block/pressure_plate_down")).texture("texture", texture); ModelFile um = modProv.withExistingParent(name, prov.mcLoc("block/pressure_plate_up")).texture("texture", texture); @@ -479,13 +479,13 @@ private static RegiliteBlock silentPressurePlateBlock( .registerBlock("silent_" + upModelLoc.getPath(), props -> new SilentPressurePlateBlock(block), BlockBehaviour.Properties.of()) .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) - .setBlockStateProvider((prov, ctx) -> { + .withBlockStateProvider((prov, ctx) -> { VariantBlockStateBuilder vb = prov.getVariantBuilder(ctx.get()); vb.partialState().with(PressurePlateBlock.POWERED, true).addModels(new ConfiguredModel(prov.models().getExistingFile(downModelLoc))); vb.partialState().with(PressurePlateBlock.POWERED, false).addModels(new ConfiguredModel(prov.models().getExistingFile(upModelLoc))); }) .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) + .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) .withTab(EIOCreativeTabs.BLOCKS) ); } @@ -497,7 +497,7 @@ private static RegiliteBlock silentWeightedPre return BLOCK_REGISTRY .registerBlock("silent_" + upModelLoc.getPath(), props -> new SilentWeightedPressurePlateBlock(block), BlockBehaviour.Properties.of()) - .setBlockStateProvider((prov, ctx) -> prov.getVariantBuilder(ctx.get()).forAllStates(blockState -> { + .withBlockStateProvider((prov, ctx) -> prov.getVariantBuilder(ctx.get()).forAllStates(blockState -> { if (blockState.getValue(WeightedPressurePlateBlock.POWER) == 0) { return new ConfiguredModel[] { new ConfiguredModel(prov.models().getExistingFile(upModelLoc)) }; } @@ -505,7 +505,7 @@ private static RegiliteBlock silentWeightedPre })) .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) + .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) .withTab(EIOCreativeTabs.BLOCKS) ); } @@ -516,7 +516,7 @@ private static RegiliteBlock resettingLeverBlock(String nam return BLOCK_REGISTRY .registerBlock(name, props -> new ResettingLeverBlock(duration, inverted), BlockBehaviour.Properties.of()) .withTranslation("Resetting Lever " + (inverted ? "Inverted " : "") + durationLabel) - .setBlockStateProvider((prov, ctx) -> { + .withBlockStateProvider((prov, ctx) -> { BlockModelProvider modProv = prov.models(); ModelFile.ExistingModelFile baseModel = modProv.getExistingFile(prov.mcLoc("block/lever")); ModelFile.ExistingModelFile onModel = modProv.getExistingFile(prov.mcLoc("block/lever_on")); @@ -536,7 +536,7 @@ private static RegiliteBlock resettingLeverBlock(String nam }); }) .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.mcLoc("item/lever"))) + .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.mcLoc("item/lever"))) .withTab(EIOCreativeTabs.BLOCKS) ); } @@ -573,7 +573,7 @@ private static RegiliteBlock paintedBlock(String name, Func return BLOCK_REGISTRY .registerBlock(name, blockFactory, BlockBehaviour.Properties.ofFullCopy(copyFrom).noOcclusion()) - .setBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock(name, prov, ctx.get(), copyFrom, itemTextureRotation)) + .withBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock(name, prov, ctx.get(), copyFrom, itemTextureRotation)) .withBlockColor(() -> PaintedBlockColor::new) .withLootTable(DecorLootTable::withPaint) .withTags(tags) @@ -581,7 +581,7 @@ private static RegiliteBlock paintedBlock(String name, Func ITEM_REGISTRY, b -> itemFactory.apply(b, new Item.Properties()), item -> item - .setColorSupplier(() -> PaintedBlockColor::new)); + .withItemColor(() -> PaintedBlockColor::new)); } public static RegiliteBlock lightBlock(String name, Function blockFactory) { @@ -592,9 +592,9 @@ public static RegiliteBlock lightBlock(String name, Functio } return 0; })) - .setBlockStateProvider(EIOBlockState::lightBlock) + .withBlockStateProvider(EIOBlockState::lightBlock) .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.withExistingParent(name, "block/button_inventory")) + .withModelProvider((prov, ctx) -> prov.withExistingParent(name, "block/button_inventory")) .withTab(EIOCreativeTabs.BLOCKS) ); } diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java index e1ff89eac..4006b3db1 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java @@ -91,12 +91,12 @@ public class EIOItems { public static final RegiliteItem FRANK_N_ZOMBIE = materialItemGlinted("frank_n_zombie") .withTranslation("Frank'N'Zombie") - .setModelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.Z_LOGIC_CONTROLLER)); + .withModelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.Z_LOGIC_CONTROLLER)); public static final RegiliteItem ENDER_RESONATOR = materialItem("ender_resonator"); public static final RegiliteItem SENTIENT_ENDER = materialItemGlinted("sentient_ender") - .setModelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.ENDER_RESONATOR)); + .withModelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.ENDER_RESONATOR)); public static final RegiliteItem SKELETAL_CONTRACTOR = materialItem("skeletal_contractor"); public static final RegiliteItem GUARDIAN_DIODE = materialItem("guardian_diode"); @@ -268,7 +268,7 @@ public class EIOItems { public static final RegiliteItem BROKEN_SPAWNER = ITEM_REGISTRY .registerItem("broken_spawner", BrokenSpawnerItem::new) .withTags(EIOTags.Items.ENTITY_STORAGE) - .setModelProvider(ModelHelper::fakeBlockModel) + .withModelProvider(ModelHelper::fakeBlockModel) .withTab(EIOCreativeTabs.MAIN) .withTab(EIOCreativeTabs.SOULS, modifier -> modifier.acceptAll(BrokenSpawnerItem.getPossibleStacks())); @@ -334,7 +334,7 @@ private static RegiliteItem gliderItem(String name) { return dumbItem(name, HangGliderItem::new) .withTags(EIOTags.Items.GLIDER) .withTab(EIOCreativeTabs.MAIN) - .setModelProvider((prov, ctx) -> GliderItemModel.create(ctx.get(), prov)); + .withModelProvider((prov, ctx) -> GliderItemModel.create(ctx.get(), prov)); } private static RegiliteItem materialItem(String name) { diff --git a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java index feb1a9718..c29611894 100644 --- a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java +++ b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java @@ -26,12 +26,12 @@ public class ConduitBlocks { .dynamicShape() .mapColor(MapColor.STONE)) .withTranslation("Conduit Bundle") - .setBlockStateProvider(ConduitBlockState::conduit) + .withBlockStateProvider(ConduitBlockState::conduit) .withTags(BlockTags.MINEABLE_WITH_PICKAXE) .withBlockItem(ITEM_REGISTRY, b -> new ConduitBlockItem(b, new Item.Properties()), item -> item .withTranslation(" Conduit") - .setModelProvider((prov, ctx) -> {})); + .withModelProvider((prov, ctx) -> {})); public static void register(IEventBus bus) { BLOCK_REGISTRY.register(bus); diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java index 3bda98d0d..36f2247f9 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java @@ -61,7 +61,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() + .withBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() .getBuilder(ctx.getName()) .customLoader(CompositeModelBuilder::begin) .child("tank", ModelHelper.getExistingAsBuilder(prov.models(), EnderIOBase.loc(String.format("block/%s_body", ctx.getName())))) @@ -72,7 +72,7 @@ public class MachineBlocks { .withBlockItem(ITEM_REGISTRY, block -> new FluidTankItem(block, new Item.Properties(), 16000), item -> item - .setModelProvider((prov, ctx) -> {}) + .withModelProvider((prov, ctx) -> {}) .withTab(EIOCreativeTabs.MACHINES) .withCapability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) ); @@ -82,7 +82,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() + .withBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() .withExistingParent(ctx.getName(), prov.mcLoc("block/block")) .customLoader(CompositeModelBuilder::begin) .child("tank", ModelHelper.getExistingAsBuilder(prov.models(), EnderIOBase.loc(String.format("block/%s_body", ctx.getName())))) @@ -92,7 +92,7 @@ public class MachineBlocks { )) .withBlockItem(ITEM_REGISTRY, (block) -> new FluidTankItem(block, new Item.Properties(), 32000), item -> item - .setModelProvider((prov, ctx) -> {}) + .withModelProvider((prov, ctx) -> {}) .withTab(EIOCreativeTabs.MACHINES) .withCapability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) ); @@ -102,7 +102,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion().isViewBlocking((pState, pLevel, pPos) -> false)) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider(MachineModelUtil::machineBlock) + .withBlockStateProvider(MachineModelUtil::machineBlock) .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); public static final RegiliteBlock PRIMITIVE_ALLOY_SMELTER = @@ -144,7 +144,7 @@ public class MachineBlocks { .registerBlock("powered_spawner", properties -> new ProgressMachineBlock(MachineBlockEntities.POWERED_SPAWNER, properties), BlockBehaviour.Properties.of().strength(2.5f, 8)) .withLootTable((l,t) -> MachinesLootTable.copyStandardComponentsWith(l, t, EIODataComponents.STORED_ENTITY.get())) - .setBlockStateProvider(MachineModelUtil::progressMachineBlock) + .withBlockStateProvider(MachineModelUtil::progressMachineBlock) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withBlockItem(ITEM_REGISTRY, b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), item -> item @@ -157,7 +157,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withLootTable(MachinesLootTable::copyComponents) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); public static final RegiliteBlock XP_VACUUM = BLOCK_REGISTRY @@ -165,7 +165,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withLootTable(MachinesLootTable::copyComponents) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withTranslation("XP Vacuum") .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); @@ -173,7 +173,7 @@ public class MachineBlocks { .registerBlock("travel_anchor", TravelAnchorBlock::new, BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withLootTable(MachinesLootTable::copyComponents) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); public static final RegiliteBlock PAINTED_TRAVEL_ANCHOR = BLOCK_REGISTRY @@ -181,11 +181,11 @@ public class MachineBlocks { .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withBlockColor(() -> PaintedBlockColor::new) .withLootTable(DecorLootTable::withPaint) - .setBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock("painted_travel_anchor", prov, ctx.get(), Blocks.DIRT, null)) //Any cube will do + .withBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock("painted_travel_anchor", prov, ctx.get(), Blocks.DIRT, null)) //Any cube will do .withBlockItem( ITEM_REGISTRY, b -> new PaintedBlockItem(b, new Item.Properties()), - item -> item.setColorSupplier(() -> PaintedBlockColor::new)); + item -> item.withItemColor(() -> PaintedBlockColor::new)); public static final Map> SOLAR_PANELS = Util.make(() -> { Map> panels = new HashMap<>(); @@ -211,7 +211,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider(MachineModelUtil::progressMachineBlock) + .withBlockStateProvider(MachineModelUtil::progressMachineBlock) .withBlockItem(ITEM_REGISTRY, b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), item -> item .withTab(EIOCreativeTabs.MACHINES) @@ -226,7 +226,7 @@ public class MachineBlocks { public static final RegiliteBlock BLOCK_DETECTOR = BLOCK_REGISTRY .registerBlock("block_detector", BlockDetectorBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.OBSERVER)) .withTags(BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName()))) + .withBlockStateProvider((prov, ctx) -> prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName()))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); public static final RegiliteBlock XP_OBELISK = BLOCK_REGISTRY @@ -234,7 +234,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withTranslation("XP Obelisk") .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); @@ -243,7 +243,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); public static final RegiliteBlock AVERSION_OBELISK = BLOCK_REGISTRY @@ -251,7 +251,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); public static final RegiliteBlock RELOCATOR_OBELISK = BLOCK_REGISTRY @@ -259,7 +259,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); //used when single methods needs to be overridden in the block class @@ -268,7 +268,7 @@ private static RegiliteBlock baseMachine(RegiliteBlo return machineBlock .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider(blockStateProvider) + .withBlockStateProvider(blockStateProvider) .withBlockItem(ITEM_REGISTRY, item -> item .withTab(EIOCreativeTabs.MACHINES) ); @@ -293,11 +293,11 @@ private static RegiliteBlock solarPanel(String name, Supplier new SolarPanelBlock(RegiliteBlockEntity.get(), props, tier), BlockBehaviour.Properties.of().strength(2.5f, 8)) - .setBlockStateProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) + .withBlockStateProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) .withTags(BlockTags.MINEABLE_WITH_PICKAXE) .withLootTable(MachinesLootTable::copyComponents) .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) + .withModelProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) .withTab(EIOCreativeTabs.MACHINES) .withTags(EIOTags.Items.ENTITY_STORAGE) ); @@ -307,13 +307,13 @@ private static RegiliteBlock capacitorBank(String name, Supp return BLOCK_REGISTRY .registerBlock(name, props -> new CapacitorBankBlock(props, RegiliteBlockEntity.get(), tier), BlockBehaviour.Properties.of().strength(2.5f, 8)) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc(ctx.getName())))) + .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc(ctx.getName())))) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.MINEABLE_WITH_PICKAXE) .withBlockItem(ITEM_REGISTRY, block -> new CapacitorBankItem(block, new Item.Properties()), item -> item - .setModelProvider((prov, ctx) -> {}) + .withModelProvider((prov, ctx) -> {}) .withTab(EIOCreativeTabs.MACHINES) .withCapability(Capabilities.EnergyStorage.ITEM, CapacitorBankItem.ENERGY_STORAGE_PROVIDER) ); From 15f758ec37a217cb82a25e7f336e72f29d83e103 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:31:44 +0100 Subject: [PATCH 3/7] fix: Build errors and changes since rebase. --- .../armory/common/init/ArmoryItems.java | 2 +- enderio-base/build.gradle.kts | 2 +- .../base/common/block/glass/GlassBlocks.java | 10 ++-- .../enderio/base/common/init/EIOBlocks.java | 60 +++++++++---------- .../enderio/base/common/init/EIOItems.java | 8 +-- enderio-conduits-modded/build.gradle.kts | 2 +- .../mods/mekanism/MekanismModule.java | 4 +- .../conduits/common/init/ConduitBlocks.java | 4 +- .../machines/common/init/MachineBlocks.java | 44 +++++++------- 9 files changed, 68 insertions(+), 68 deletions(-) diff --git a/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java b/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java index 9ceb0cc30..4fd7dd594 100644 --- a/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java +++ b/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java @@ -28,7 +28,7 @@ public class ArmoryItems { .registerItem("dark_steel_sword", DarkSteelSwordItem::new, new Item.Properties().durability(2000)) .withTab(EIOCreativeTabs.GEAR) .withTranslation("The Ender") - .withModelProvider((prov, ctx) -> prov.handheld(ctx.get())); + .setModelProvider((prov, ctx) -> prov.handheld(ctx.get())); // TODO: Bring these back when they are finished. // public static final ItemEntry DARK_STEEL_PICKAXE = REGISTRATE diff --git a/enderio-base/build.gradle.kts b/enderio-base/build.gradle.kts index 4b031a8b6..b84149e0f 100644 --- a/enderio-base/build.gradle.kts +++ b/enderio-base/build.gradle.kts @@ -29,7 +29,7 @@ dependencies { api("com.enderio:regilite:$regiliteVersion") // EnderIO Base will bundle Regilite and EnderCore in production. - jarJar("com.enderio:Regilite:$regiliteVersion") + jarJar("com.enderio:regilite:$regiliteVersion") jarJar(project(":endercore")) // JEI diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java b/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java index 40e6ded2f..78f3b0d4e 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java @@ -79,7 +79,7 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It .isSuffocating(GlassBlocks::never) .isViewBlocking(GlassBlocks::never)) .withTranslation("") - .withBlockStateProvider((cons, ctx) -> cons.simpleBlock(ctx.get(), cons.models().getExistingFile(getModelFile()))) + .setBlockStateProvider((cons, ctx) -> cons.simpleBlock(ctx.get(), cons.models().getExistingFile(getModelFile()))) .withTags( glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS ); @@ -90,7 +90,7 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It glassIdentifier.explosion_resistance() ? EIOTags.Items.FUSED_QUARTZ : EIOTags.Items.CLEAR_GLASS, EIOTags.Items.GLASS_TAGS.get(glassIdentifier) ) - .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); + .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); if (glassIdentifier.lighting() == GlassLighting.EMITTING && glassIdentifier.explosion_resistance()) { item.withTags(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); @@ -122,7 +122,7 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It .isViewBlocking(GlassBlocks::never) .mapColor(color)) .withTranslation("") - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(getModelFile()))) + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(getModelFile()))) .withBlockColor(() -> () -> (state, level, pos, tintIndex) -> color.getMapColor().col) .withTags( glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS @@ -130,12 +130,12 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It block.withBlockItem(itemRegistry, item -> { item.withTab(EIOCreativeTabs.BLOCKS) - .withItemColor(() -> () -> (stack, tintIndex) -> color.getMapColor().col) + .setColorSupplier(() -> () -> (stack, tintIndex) -> color.getMapColor().col) .withTags( glassIdentifier.explosion_resistance() ? EIOTags.Items.FUSED_QUARTZ : EIOTags.Items.CLEAR_GLASS, EIOTags.Items.GLASS_TAGS.get(glassIdentifier) ) - .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); + .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); if (glassIdentifier.lighting() == GlassLighting.EMITTING && glassIdentifier.explosion_resistance()) { item.withTags(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java index 5d0f64ebf..9a42cf858 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java @@ -134,7 +134,7 @@ public class EIOBlocks { public static final RegiliteBlock DARK_STEEL_LADDER = BLOCK_REGISTRY .registerBlock("dark_steel_ladder", DarkSteelLadderBlock::new, BlockBehaviour.Properties.of().strength(0.4f).requiresCorrectToolForDrops().sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) - .withBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov + .setBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov .models() .withExistingParent(ctx.getName(), prov.mcLoc("block/ladder")) .renderType(prov.mcLoc("cutout_mipped")) @@ -142,56 +142,56 @@ public class EIOBlocks { .texture("texture", prov.blockTexture(ctx.get())))) .withTags(BlockTags.CLIMBABLE, BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withBlockItem(ITEM_REGISTRY, item -> item - .withModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_ladder"))) + .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_ladder"))) .withTab(EIOCreativeTabs.BLOCKS)); public static final RegiliteBlock DARK_STEEL_BARS = BLOCK_REGISTRY .registerBlock("dark_steel_bars", IronBarsBlock::new, BlockBehaviour.Properties.of().strength(5.0f, 1000.0f).requiresCorrectToolForDrops().sound(SoundType.METAL).noOcclusion()) - .withBlockStateProvider(EIOBlockState::paneBlock) + .setBlockStateProvider(EIOBlockState::paneBlock) .withTags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) .withBlockItem(ITEM_REGISTRY, item -> item .withTab(EIOCreativeTabs.BLOCKS) - .withModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_bars"))) + .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_bars"))) ); public static final RegiliteBlock DARK_STEEL_DOOR = BLOCK_REGISTRY .registerBlock("dark_steel_door", props -> new DoorBlock(BlockSetType.IRON, props), BlockBehaviour.Properties.of().strength(5.0f, 2000.0f).sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) .withLootTable(RegiliteBlockLootProvider::createDoor) - .withBlockStateProvider( + .setBlockStateProvider( (prov, ctx) -> prov.doorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_door_bottom"), prov.modLoc("block/dark_steel_door_top"), prov.mcLoc("cutout"))) .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.DOORS) .withBlockItem(ITEM_REGISTRY, item -> item - .withModelProvider((prov, ctx) -> prov.basicItem(ctx.get())) + .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get())) .withTab(EIOCreativeTabs.BLOCKS) ); public static final RegiliteBlock DARK_STEEL_TRAPDOOR = BLOCK_REGISTRY .registerBlock("dark_steel_trapdoor", props -> new TrapDoorBlock(BlockSetType.IRON, props), BlockBehaviour.Properties.of().strength(5.0f, 2000.0f).sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) - .withBlockStateProvider((prov, ctx) -> prov.trapdoorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_trapdoor"), true, prov.mcLoc("cutout"))) + .setBlockStateProvider((prov, ctx) -> prov.trapdoorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_trapdoor"), true, prov.mcLoc("cutout"))) .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.TRAPDOORS) .withBlockItem(ITEM_REGISTRY, item -> item - .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.modLoc("block/dark_steel_trapdoor_bottom"))) + .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.modLoc("block/dark_steel_trapdoor_bottom"))) .withTab(EIOCreativeTabs.BLOCKS) ); public static final RegiliteBlock END_STEEL_BARS = BLOCK_REGISTRY .registerBlock("end_steel_bars", IronBarsBlock::new, BlockBehaviour.Properties.of().strength(5.0f, 1000.0f).requiresCorrectToolForDrops().sound(SoundType.METAL).noOcclusion()) - .withBlockStateProvider(EIOBlockState::paneBlock) + .setBlockStateProvider(EIOBlockState::paneBlock) .withTags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) .withBlockItem(ITEM_REGISTRY, item -> item .withTab(EIOCreativeTabs.BLOCKS) - .withModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/end_steel_bars"))) + .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/end_steel_bars"))) ); public static final RegiliteBlock REINFORCED_OBSIDIAN = BLOCK_REGISTRY @@ -247,7 +247,7 @@ private static Map fillGlassMap() { BlockTags.MINEABLE_WITH_PICKAXE, Tags.Blocks.CHAINS ) - .withBlockStateProvider((prov, ctx) -> { + .setBlockStateProvider((prov, ctx) -> { var model = prov .models() .withExistingParent(ctx.getName(), prov.mcLoc("block/chain")) @@ -259,13 +259,13 @@ private static Map fillGlassMap() { }) .withBlockItem(ITEM_REGISTRY, item -> item .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("item/soul_chain"))) - .addItemTags(Tags.Items.CHAINS) - .setTab(EIOCreativeTabs.BLOCKS) + .withTags(Tags.Items.CHAINS) + .withTab(EIOCreativeTabs.BLOCKS) ); public static final RegiliteBlock COLD_FIRE = BLOCK_REGISTRY .registerBlock("cold_fire", ColdFireBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.FIRE).noLootTable()) - .withBlockStateProvider((prov, ctx) -> { + .setBlockStateProvider((prov, ctx) -> { // This generates the models used for the blockstate in our resources. // One day we may bother to datagen that file. String[] toCopy = { "fire_floor0", "fire_floor1", "fire_side0", "fire_side1", "fire_side_alt0", "fire_side_alt1", "fire_up0", "fire_up1", @@ -403,23 +403,23 @@ private static Map fillGlassMap() { public static final RegiliteBlock LIGHT_NODE = BLOCK_REGISTRY .registerBlock("light_node", LightNode::new, BlockBehaviour.Properties.ofFullCopy(Blocks.AIR).lightLevel(l -> 15).noLootTable().noCollission().noOcclusion()) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().withExistingParent("light_node", "block/air"))); + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().withExistingParent("light_node", "block/air"))); public static final RegiliteBlock ENDERMAN_HEAD = BLOCK_REGISTRY .registerBlock("enderman_head", EnderSkullBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SKELETON_SKULL).instrument(NoteBlockInstrument.SKELETON).strength(1.0F).pushReaction(PushReaction.DESTROY)) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) .withBlockItem(ITEM_REGISTRY, // TODO: Properties being handled right? Maybe cleaner if we have a factory that takes properties, then a properties arg. (enderSkullBlock) -> new EnderSkullBlockItem(enderSkullBlock, new Item.Properties(), Direction.DOWN), item -> item .withTab(EIOCreativeTabs.MAIN) - .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), "item/template_skull"))); + .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), "item/template_skull"))); public static final RegiliteBlock WALL_ENDERMAN_HEAD = BLOCK_REGISTRY .registerBlock("wall_enderman_head", WallEnderSkullBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SKELETON_SKULL).strength(1.0F).lootFrom(ENDERMAN_HEAD).pushReaction(PushReaction.DESTROY)) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) .withTranslation(""); private static RegiliteBlock metalBlock(String name, TagKey blockTag, TagKey itemTag) { @@ -439,7 +439,7 @@ private static RegiliteBlock metalBlock(String name, TagKey blockT private static RegiliteBlock chassisBlock(String name) { return BLOCK_REGISTRY .registerBlock(name, Block::new, BlockBehaviour.Properties.of().noOcclusion().sound(SoundType.METAL).mapColor(MapColor.METAL).strength(5, 6)) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().cubeAll(name, prov.blockTexture(ctx.get())).renderType(prov.mcLoc("translucent")))) .withTags( BlockTags.NEEDS_STONE_TOOL, @@ -456,7 +456,7 @@ private static RegiliteBlock pressurePlateBlock(String na return BLOCK_REGISTRY .registerBlock(name, props -> new EIOPressurePlateBlock(props, type, silent), BlockBehaviour.Properties.of().strength(5, 6).mapColor(MapColor.METAL)) - .withBlockStateProvider((prov, ctx) -> { + .setBlockStateProvider((prov, ctx) -> { BlockModelProvider modProv = prov.models(); ModelFile dm = modProv.withExistingParent(name + "_down", prov.mcLoc("block/pressure_plate_down")).texture("texture", texture); ModelFile um = modProv.withExistingParent(name, prov.mcLoc("block/pressure_plate_up")).texture("texture", texture); @@ -479,13 +479,13 @@ private static RegiliteBlock silentPressurePlateBlock( .registerBlock("silent_" + upModelLoc.getPath(), props -> new SilentPressurePlateBlock(block), BlockBehaviour.Properties.of()) .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) - .withBlockStateProvider((prov, ctx) -> { + .setBlockStateProvider((prov, ctx) -> { VariantBlockStateBuilder vb = prov.getVariantBuilder(ctx.get()); vb.partialState().with(PressurePlateBlock.POWERED, true).addModels(new ConfiguredModel(prov.models().getExistingFile(downModelLoc))); vb.partialState().with(PressurePlateBlock.POWERED, false).addModels(new ConfiguredModel(prov.models().getExistingFile(upModelLoc))); }) .withBlockItem(ITEM_REGISTRY, item -> item - .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) + .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) .withTab(EIOCreativeTabs.BLOCKS) ); } @@ -497,7 +497,7 @@ private static RegiliteBlock silentWeightedPre return BLOCK_REGISTRY .registerBlock("silent_" + upModelLoc.getPath(), props -> new SilentWeightedPressurePlateBlock(block), BlockBehaviour.Properties.of()) - .withBlockStateProvider((prov, ctx) -> prov.getVariantBuilder(ctx.get()).forAllStates(blockState -> { + .setBlockStateProvider((prov, ctx) -> prov.getVariantBuilder(ctx.get()).forAllStates(blockState -> { if (blockState.getValue(WeightedPressurePlateBlock.POWER) == 0) { return new ConfiguredModel[] { new ConfiguredModel(prov.models().getExistingFile(upModelLoc)) }; } @@ -505,7 +505,7 @@ private static RegiliteBlock silentWeightedPre })) .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) .withBlockItem(ITEM_REGISTRY, item -> item - .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) + .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) .withTab(EIOCreativeTabs.BLOCKS) ); } @@ -516,7 +516,7 @@ private static RegiliteBlock resettingLeverBlock(String nam return BLOCK_REGISTRY .registerBlock(name, props -> new ResettingLeverBlock(duration, inverted), BlockBehaviour.Properties.of()) .withTranslation("Resetting Lever " + (inverted ? "Inverted " : "") + durationLabel) - .withBlockStateProvider((prov, ctx) -> { + .setBlockStateProvider((prov, ctx) -> { BlockModelProvider modProv = prov.models(); ModelFile.ExistingModelFile baseModel = modProv.getExistingFile(prov.mcLoc("block/lever")); ModelFile.ExistingModelFile onModel = modProv.getExistingFile(prov.mcLoc("block/lever_on")); @@ -536,7 +536,7 @@ private static RegiliteBlock resettingLeverBlock(String nam }); }) .withBlockItem(ITEM_REGISTRY, item -> item - .withModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.mcLoc("item/lever"))) + .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.mcLoc("item/lever"))) .withTab(EIOCreativeTabs.BLOCKS) ); } @@ -573,7 +573,7 @@ private static RegiliteBlock paintedBlock(String name, Func return BLOCK_REGISTRY .registerBlock(name, blockFactory, BlockBehaviour.Properties.ofFullCopy(copyFrom).noOcclusion()) - .withBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock(name, prov, ctx.get(), copyFrom, itemTextureRotation)) + .setBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock(name, prov, ctx.get(), copyFrom, itemTextureRotation)) .withBlockColor(() -> PaintedBlockColor::new) .withLootTable(DecorLootTable::withPaint) .withTags(tags) @@ -581,7 +581,7 @@ private static RegiliteBlock paintedBlock(String name, Func ITEM_REGISTRY, b -> itemFactory.apply(b, new Item.Properties()), item -> item - .withItemColor(() -> PaintedBlockColor::new)); + .setColorSupplier(() -> PaintedBlockColor::new)); } public static RegiliteBlock lightBlock(String name, Function blockFactory) { @@ -592,9 +592,9 @@ public static RegiliteBlock lightBlock(String name, Functio } return 0; })) - .withBlockStateProvider(EIOBlockState::lightBlock) + .setBlockStateProvider(EIOBlockState::lightBlock) .withBlockItem(ITEM_REGISTRY, item -> item - .withModelProvider((prov, ctx) -> prov.withExistingParent(name, "block/button_inventory")) + .setModelProvider((prov, ctx) -> prov.withExistingParent(name, "block/button_inventory")) .withTab(EIOCreativeTabs.BLOCKS) ); } diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java index 4006b3db1..e1ff89eac 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java @@ -91,12 +91,12 @@ public class EIOItems { public static final RegiliteItem FRANK_N_ZOMBIE = materialItemGlinted("frank_n_zombie") .withTranslation("Frank'N'Zombie") - .withModelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.Z_LOGIC_CONTROLLER)); + .setModelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.Z_LOGIC_CONTROLLER)); public static final RegiliteItem ENDER_RESONATOR = materialItem("ender_resonator"); public static final RegiliteItem SENTIENT_ENDER = materialItemGlinted("sentient_ender") - .withModelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.ENDER_RESONATOR)); + .setModelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.ENDER_RESONATOR)); public static final RegiliteItem SKELETAL_CONTRACTOR = materialItem("skeletal_contractor"); public static final RegiliteItem GUARDIAN_DIODE = materialItem("guardian_diode"); @@ -268,7 +268,7 @@ public class EIOItems { public static final RegiliteItem BROKEN_SPAWNER = ITEM_REGISTRY .registerItem("broken_spawner", BrokenSpawnerItem::new) .withTags(EIOTags.Items.ENTITY_STORAGE) - .withModelProvider(ModelHelper::fakeBlockModel) + .setModelProvider(ModelHelper::fakeBlockModel) .withTab(EIOCreativeTabs.MAIN) .withTab(EIOCreativeTabs.SOULS, modifier -> modifier.acceptAll(BrokenSpawnerItem.getPossibleStacks())); @@ -334,7 +334,7 @@ private static RegiliteItem gliderItem(String name) { return dumbItem(name, HangGliderItem::new) .withTags(EIOTags.Items.GLIDER) .withTab(EIOCreativeTabs.MAIN) - .withModelProvider((prov, ctx) -> GliderItemModel.create(ctx.get(), prov)); + .setModelProvider((prov, ctx) -> GliderItemModel.create(ctx.get(), prov)); } private static RegiliteItem materialItem(String name) { diff --git a/enderio-conduits-modded/build.gradle.kts b/enderio-conduits-modded/build.gradle.kts index b4bd7f0b8..73db88792 100644 --- a/enderio-conduits-modded/build.gradle.kts +++ b/enderio-conduits-modded/build.gradle.kts @@ -38,7 +38,7 @@ val mekanismVersion: String by project val refinedstorageVersion: String by project dependencies { - api("com.enderio:Regilite:$regiliteVersion") + api("com.enderio:regilite:$regiliteVersion") api(project(":enderio-base")) accessTransformers(project(":enderio-base")) diff --git a/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/MekanismModule.java b/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/MekanismModule.java index 0abc4ebaf..bc069c3f5 100644 --- a/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/MekanismModule.java +++ b/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/MekanismModule.java @@ -66,8 +66,8 @@ public class MekanismModule implements ConduitModule { public static final RegiliteItem BASIC_CHEMICAL_FILTER = ITEM_REGISTRY .registerItem("chemical_filter", properties -> new ChemicalFilterItem(properties.component(CHEMICAL_FILTER, new ChemicalFilterCapability.Component(5)))) - .setTab(EIOCreativeTabs.GEAR) - .addCapability(EIOCapabilities.Filter.ITEM, ChemicalFilterItem.FILTER_PROVIDER); + .withTab(EIOCreativeTabs.GEAR) + .withCapability(EIOCapabilities.Filter.ITEM, ChemicalFilterItem.FILTER_PROVIDER); private static final MenuRegistry MENU_REGISTRY = ModdedConduits.REGILITE.menuRegistry(); diff --git a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java index c29611894..feb1a9718 100644 --- a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java +++ b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java @@ -26,12 +26,12 @@ public class ConduitBlocks { .dynamicShape() .mapColor(MapColor.STONE)) .withTranslation("Conduit Bundle") - .withBlockStateProvider(ConduitBlockState::conduit) + .setBlockStateProvider(ConduitBlockState::conduit) .withTags(BlockTags.MINEABLE_WITH_PICKAXE) .withBlockItem(ITEM_REGISTRY, b -> new ConduitBlockItem(b, new Item.Properties()), item -> item .withTranslation(" Conduit") - .withModelProvider((prov, ctx) -> {})); + .setModelProvider((prov, ctx) -> {})); public static void register(IEventBus bus) { BLOCK_REGISTRY.register(bus); diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java index 36f2247f9..3bda98d0d 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java @@ -61,7 +61,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() + .setBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() .getBuilder(ctx.getName()) .customLoader(CompositeModelBuilder::begin) .child("tank", ModelHelper.getExistingAsBuilder(prov.models(), EnderIOBase.loc(String.format("block/%s_body", ctx.getName())))) @@ -72,7 +72,7 @@ public class MachineBlocks { .withBlockItem(ITEM_REGISTRY, block -> new FluidTankItem(block, new Item.Properties(), 16000), item -> item - .withModelProvider((prov, ctx) -> {}) + .setModelProvider((prov, ctx) -> {}) .withTab(EIOCreativeTabs.MACHINES) .withCapability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) ); @@ -82,7 +82,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() + .setBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() .withExistingParent(ctx.getName(), prov.mcLoc("block/block")) .customLoader(CompositeModelBuilder::begin) .child("tank", ModelHelper.getExistingAsBuilder(prov.models(), EnderIOBase.loc(String.format("block/%s_body", ctx.getName())))) @@ -92,7 +92,7 @@ public class MachineBlocks { )) .withBlockItem(ITEM_REGISTRY, (block) -> new FluidTankItem(block, new Item.Properties(), 32000), item -> item - .withModelProvider((prov, ctx) -> {}) + .setModelProvider((prov, ctx) -> {}) .withTab(EIOCreativeTabs.MACHINES) .withCapability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) ); @@ -102,7 +102,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion().isViewBlocking((pState, pLevel, pPos) -> false)) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockStateProvider(MachineModelUtil::machineBlock) + .setBlockStateProvider(MachineModelUtil::machineBlock) .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); public static final RegiliteBlock PRIMITIVE_ALLOY_SMELTER = @@ -144,7 +144,7 @@ public class MachineBlocks { .registerBlock("powered_spawner", properties -> new ProgressMachineBlock(MachineBlockEntities.POWERED_SPAWNER, properties), BlockBehaviour.Properties.of().strength(2.5f, 8)) .withLootTable((l,t) -> MachinesLootTable.copyStandardComponentsWith(l, t, EIODataComponents.STORED_ENTITY.get())) - .withBlockStateProvider(MachineModelUtil::progressMachineBlock) + .setBlockStateProvider(MachineModelUtil::progressMachineBlock) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withBlockItem(ITEM_REGISTRY, b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), item -> item @@ -157,7 +157,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withLootTable(MachinesLootTable::copyComponents) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); public static final RegiliteBlock XP_VACUUM = BLOCK_REGISTRY @@ -165,7 +165,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withLootTable(MachinesLootTable::copyComponents) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withTranslation("XP Vacuum") .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); @@ -173,7 +173,7 @@ public class MachineBlocks { .registerBlock("travel_anchor", TravelAnchorBlock::new, BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withLootTable(MachinesLootTable::copyComponents) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); public static final RegiliteBlock PAINTED_TRAVEL_ANCHOR = BLOCK_REGISTRY @@ -181,11 +181,11 @@ public class MachineBlocks { .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .withBlockColor(() -> PaintedBlockColor::new) .withLootTable(DecorLootTable::withPaint) - .withBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock("painted_travel_anchor", prov, ctx.get(), Blocks.DIRT, null)) //Any cube will do + .setBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock("painted_travel_anchor", prov, ctx.get(), Blocks.DIRT, null)) //Any cube will do .withBlockItem( ITEM_REGISTRY, b -> new PaintedBlockItem(b, new Item.Properties()), - item -> item.withItemColor(() -> PaintedBlockColor::new)); + item -> item.setColorSupplier(() -> PaintedBlockColor::new)); public static final Map> SOLAR_PANELS = Util.make(() -> { Map> panels = new HashMap<>(); @@ -211,7 +211,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockStateProvider(MachineModelUtil::progressMachineBlock) + .setBlockStateProvider(MachineModelUtil::progressMachineBlock) .withBlockItem(ITEM_REGISTRY, b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), item -> item .withTab(EIOCreativeTabs.MACHINES) @@ -226,7 +226,7 @@ public class MachineBlocks { public static final RegiliteBlock BLOCK_DETECTOR = BLOCK_REGISTRY .registerBlock("block_detector", BlockDetectorBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.OBSERVER)) .withTags(BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockStateProvider((prov, ctx) -> prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName()))) + .setBlockStateProvider((prov, ctx) -> prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName()))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); public static final RegiliteBlock XP_OBELISK = BLOCK_REGISTRY @@ -234,7 +234,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withTranslation("XP Obelisk") .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); @@ -243,7 +243,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); public static final RegiliteBlock AVERSION_OBELISK = BLOCK_REGISTRY @@ -251,7 +251,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); public static final RegiliteBlock RELOCATOR_OBELISK = BLOCK_REGISTRY @@ -259,7 +259,7 @@ public class MachineBlocks { BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); //used when single methods needs to be overridden in the block class @@ -268,7 +268,7 @@ private static RegiliteBlock baseMachine(RegiliteBlo return machineBlock .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockStateProvider(blockStateProvider) + .setBlockStateProvider(blockStateProvider) .withBlockItem(ITEM_REGISTRY, item -> item .withTab(EIOCreativeTabs.MACHINES) ); @@ -293,11 +293,11 @@ private static RegiliteBlock solarPanel(String name, Supplier new SolarPanelBlock(RegiliteBlockEntity.get(), props, tier), BlockBehaviour.Properties.of().strength(2.5f, 8)) - .withBlockStateProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) + .setBlockStateProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) .withTags(BlockTags.MINEABLE_WITH_PICKAXE) .withLootTable(MachinesLootTable::copyComponents) .withBlockItem(ITEM_REGISTRY, item -> item - .withModelProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) + .setModelProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) .withTab(EIOCreativeTabs.MACHINES) .withTags(EIOTags.Items.ENTITY_STORAGE) ); @@ -307,13 +307,13 @@ private static RegiliteBlock capacitorBank(String name, Supp return BLOCK_REGISTRY .registerBlock(name, props -> new CapacitorBankBlock(props, RegiliteBlockEntity.get(), tier), BlockBehaviour.Properties.of().strength(2.5f, 8)) - .withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc(ctx.getName())))) + .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc(ctx.getName())))) .withLootTable(MachinesLootTable::copyComponents) .withTags(BlockTags.MINEABLE_WITH_PICKAXE) .withBlockItem(ITEM_REGISTRY, block -> new CapacitorBankItem(block, new Item.Properties()), item -> item - .withModelProvider((prov, ctx) -> {}) + .setModelProvider((prov, ctx) -> {}) .withTab(EIOCreativeTabs.MACHINES) .withCapability(Capabilities.EnergyStorage.ITEM, CapacitorBankItem.ENERGY_STORAGE_PROVIDER) ); From d6a4c6c2b6f53f9f00b0f4e101364f606c17cdde Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Tue, 24 Sep 2024 23:14:01 +0100 Subject: [PATCH 4/7] chore: Upgrade enderio-base to rewritten Regilite Will not yet build as other modules need to be upgraded. --- .../enderio/core/data/model/ModelHelper.java | 2 +- .../main/java/com/enderio/EnderIOBase.java | 14 +- .../base/common/block/glass/GlassBlocks.java | 82 ++- .../base/common/block/light/LightNode.java | 2 +- .../base/common/block/light/PoweredLight.java | 2 +- .../common/block/skull/EnderSkullBlock.java | 2 +- .../block/skull/WallEnderSkullBlock.java | 2 +- .../base/common/config/BaseConfigLang.java | 3 +- .../base/common/init/EIOBlockEntities.java | 37 +- .../enderio/base/common/init/EIOBlocks.java | 481 ++++++++------- .../base/common/init/EIOCreativeTabs.java | 2 +- .../base/common/init/EIODataComponents.java | 5 +- .../enderio/base/common/init/EIOEntities.java | 20 +- .../enderio/base/common/init/EIOFluids.java | 95 ++- .../enderio/base/common/init/EIOItems.java | 573 ++++++++++-------- .../enderio/base/common/init/EIOMenus.java | 33 +- .../jei/category/FireCraftingCategory.java | 4 +- .../common/item/tool/ColdFireIgniter.java | 2 +- .../common/item/tool/ExperienceRodItem.java | 2 +- .../common/item/tool/LevitationStaffItem.java | 2 +- .../enderio/base/common/lang/EIOEnumLang.java | 3 +- .../com/enderio/base/common/lang/EIOLang.java | 4 +- .../block/PaintedCraftingTableBlock.java | 2 +- .../common/paint/block/PaintedFenceBlock.java | 2 +- .../paint/block/PaintedFenceGateBlock.java | 2 +- .../paint/block/PaintedRedstoneBlock.java | 2 +- .../common/paint/block/PaintedSandBlock.java | 2 +- .../common/paint/block/PaintedSlabBlock.java | 2 +- .../common/paint/block/PaintedStairBlock.java | 2 +- .../paint/block/PaintedTrapDoorBlock.java | 2 +- .../common/paint/block/PaintedWallBlock.java | 2 +- .../PaintedWoodenPressurePlateBlock.java | 2 +- .../paint/block/SinglePaintedBlock.java | 2 +- .../base/data/loot/DecorLootTable.java | 2 +- .../base/data/tags/EIOFluidTagsProvider.java | 4 +- gradle.properties | 2 +- 36 files changed, 733 insertions(+), 669 deletions(-) diff --git a/endercore/src/main/java/com/enderio/core/data/model/ModelHelper.java b/endercore/src/main/java/com/enderio/core/data/model/ModelHelper.java index 9f727e9b3..a6f50f668 100644 --- a/endercore/src/main/java/com/enderio/core/data/model/ModelHelper.java +++ b/endercore/src/main/java/com/enderio/core/data/model/ModelHelper.java @@ -1,7 +1,7 @@ package com.enderio.core.data.model; import com.enderio.regilite.data.DataGenContext; -import com.enderio.regilite.data.RegiliteItemModelProvider; +import com.enderio.regilite.items.RegiliteItemModelProvider; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.MissingTextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite; diff --git a/enderio-base/src/main/java/com/enderio/EnderIOBase.java b/enderio-base/src/main/java/com/enderio/EnderIOBase.java index 4c2a1f626..beae5f759 100644 --- a/enderio-base/src/main/java/com/enderio/EnderIOBase.java +++ b/enderio-base/src/main/java/com/enderio/EnderIOBase.java @@ -102,21 +102,21 @@ public EnderIOBase(IEventBus modEventBus, ModContainer modContainer) { BaseConfigLang.register(); // Perform initialization and registration for everything so things are registered. - EIODataComponents.register(modEventBus); + EIODataComponents.register(); EIOCreativeTabs.register(modEventBus); - EIOItems.register(modEventBus); - EIOBlocks.register(modEventBus); - EIOBlockEntities.register(modEventBus); - EIOFluids.register(modEventBus); + EIOItems.register(); + EIOBlocks.register(); + EIOBlockEntities.register(); + EIOFluids.register(); //EIOEnchantments.register(modEventBus); EIOTags.register(); - EIOMenus.register(modEventBus); + EIOMenus.register(); EIOLang.register(); EIOEnumLang.register(); EIORecipes.register(modEventBus); EIOLootModifiers.register(modEventBus); EIOParticles.register(modEventBus); - EIOEntities.register(modEventBus); + EIOEntities.register(); EIOAttachments.register(modEventBus); EIOCriterions.register(modEventBus); REGILITE.register(modEventBus); diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java b/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java index 78f3b0d4e..def898dbd 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java @@ -3,11 +3,10 @@ import com.enderio.EnderIOBase; import com.enderio.base.common.init.EIOCreativeTabs; import com.enderio.base.common.tag.EIOTags; -import com.enderio.regilite.holder.RegiliteBlock; -import com.enderio.regilite.registry.BlockRegistry; -import com.enderio.regilite.registry.ItemRegistry; +import com.enderio.regilite.Regilite; import com.google.common.collect.ImmutableMap; import net.minecraft.core.BlockPos; +import net.minecraft.core.Holder; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.DyeColor; @@ -15,6 +14,7 @@ import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.neoforge.registries.DeferredBlock; import java.util.HashMap; import java.util.Map; @@ -24,28 +24,28 @@ * Container helper for the fused glass/quartz blocks as theres a lot, and this will tidy stuff up. */ public class GlassBlocks { - public final RegiliteBlock CLEAR; - public final Map> COLORS; + public final DeferredBlock CLEAR; + public final Map> COLORS; private final GlassIdentifier glassIdentifier; /** * Create the entire color family for this configuration of fused glass. */ - public GlassBlocks(BlockRegistry blockRegistry, ItemRegistry itemRegistry, GlassIdentifier identifier) { + public GlassBlocks(Regilite regilite, GlassIdentifier identifier) { glassIdentifier = identifier; String name = identifier.glassName(); - CLEAR = register(blockRegistry, itemRegistry, name); - Map> tempMap = new HashMap<>(); + CLEAR = register(regilite, name); + Map> tempMap = new HashMap<>(); for (DyeColor color: DyeColor.values()) { tempMap.put(color, - register(blockRegistry, itemRegistry, name.concat("_").concat(color.getName()), color) + register(regilite, name.concat("_").concat(color.getName()), color) ); } COLORS = ImmutableMap.copyOf(tempMap); } - public Stream> getAllBlocks() { + public Stream> getAllBlocks() { return Stream.concat(Stream.of(CLEAR), COLORS.values().stream()); } @@ -65,9 +65,9 @@ private static boolean never(BlockState p_50779_, BlockGetter p_50780_, BlockPos /** * Register a non-colored glass */ - private RegiliteBlock register(BlockRegistry blockRegistry, ItemRegistry itemRegistry, String name) { - var block = blockRegistry - .registerBlock(name, + private DeferredBlock register(Regilite regilite, String name) { + var block = regilite.blocks() + .create(name, p -> new FusedQuartzBlock(p, glassIdentifier, null), BlockBehaviour.Properties.of() .noOcclusion() @@ -78,38 +78,36 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It .isRedstoneConductor(GlassBlocks::never) .isSuffocating(GlassBlocks::never) .isViewBlocking(GlassBlocks::never)) - .withTranslation("") - .setBlockStateProvider((cons, ctx) -> cons.simpleBlock(ctx.get(), cons.models().getExistingFile(getModelFile()))) - .withTags( - glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS - ); + .translation("") + .blockStateProvider((cons, ctx) -> cons.simpleBlock(ctx.get(), cons.models().getExistingFile(getModelFile()))) + .tag(glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS); - block.withBlockItem(itemRegistry, item -> { - item.withTab(EIOCreativeTabs.BLOCKS) - .withTags( + block.createSimpleBlockItem(item -> { + item.tab(EIOCreativeTabs.BLOCKS) + .tags( glassIdentifier.explosion_resistance() ? EIOTags.Items.FUSED_QUARTZ : EIOTags.Items.CLEAR_GLASS, EIOTags.Items.GLASS_TAGS.get(glassIdentifier) ) - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); + .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); if (glassIdentifier.lighting() == GlassLighting.EMITTING && glassIdentifier.explosion_resistance()) { - item.withTags(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); + item.tag(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); } if (glassIdentifier.lighting() == GlassLighting.BLOCKING && glassIdentifier.explosion_resistance()) { - item.withTags(EIOTags.Items.DARK_FUSED_QUARTZ); + item.tag(EIOTags.Items.DARK_FUSED_QUARTZ); } }); - return block; + return block.finish(); } /** * Register a colored glass. */ - private RegiliteBlock register(BlockRegistry blockRegistry, ItemRegistry itemRegistry, String name, DyeColor color) { - var block = blockRegistry - .registerBlock(name, + private DeferredBlock register(Regilite regilite, String name, DyeColor color) { + var block = regilite.blocks() + .create(name, p -> new FusedQuartzBlock(p, glassIdentifier, color), BlockBehaviour.Properties.of() .noOcclusion() @@ -121,32 +119,30 @@ private RegiliteBlock register(BlockRegistry blockRegistry, It .isSuffocating(GlassBlocks::never) .isViewBlocking(GlassBlocks::never) .mapColor(color)) - .withTranslation("") - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(getModelFile()))) - .withBlockColor(() -> () -> (state, level, pos, tintIndex) -> color.getMapColor().col) - .withTags( - glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS - ); - - block.withBlockItem(itemRegistry, item -> { - item.withTab(EIOCreativeTabs.BLOCKS) - .setColorSupplier(() -> () -> (stack, tintIndex) -> color.getMapColor().col) - .withTags( + .translation("") + .blockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(getModelFile()))) + .blockColor(() -> () -> (state, level, pos, tintIndex) -> color.getMapColor().col) + .tag(glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS); + + block.createSimpleBlockItem(item -> { + item.tab(EIOCreativeTabs.BLOCKS) + .itemColor(() -> () -> (stack, tintIndex) -> color.getMapColor().col) + .tags( glassIdentifier.explosion_resistance() ? EIOTags.Items.FUSED_QUARTZ : EIOTags.Items.CLEAR_GLASS, EIOTags.Items.GLASS_TAGS.get(glassIdentifier) ) - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); + .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); if (glassIdentifier.lighting() == GlassLighting.EMITTING && glassIdentifier.explosion_resistance()) { - item.withTags(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); + item.tag(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); } if (glassIdentifier.lighting() == GlassLighting.BLOCKING && glassIdentifier.explosion_resistance()) { - item.withTags(EIOTags.Items.DARK_FUSED_QUARTZ); + item.tag(EIOTags.Items.DARK_FUSED_QUARTZ); } }); - return block; + return block.finish(); } public GlassIdentifier getGlassIdentifier() { diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/light/LightNode.java b/enderio-base/src/main/java/com/enderio/base/common/block/light/LightNode.java index bc0ec8a7e..29652e2e8 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/light/LightNode.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/light/LightNode.java @@ -32,7 +32,7 @@ public RenderShape getRenderShape(BlockState state) { @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.LIGHT_NODE.create(pos, state); + return EIOBlockEntities.LIGHT_NODE.get().create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/light/PoweredLight.java b/enderio-base/src/main/java/com/enderio/base/common/block/light/PoweredLight.java index f1d1b13b2..4b68070fa 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/light/PoweredLight.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/light/PoweredLight.java @@ -48,7 +48,7 @@ public boolean isWireless() { @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.POWERED_LIGHT.create(pos, state); + return EIOBlockEntities.POWERED_LIGHT.get().create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/skull/EnderSkullBlock.java b/enderio-base/src/main/java/com/enderio/base/common/block/skull/EnderSkullBlock.java index 239835ebe..97db68ac6 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/skull/EnderSkullBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/skull/EnderSkullBlock.java @@ -30,7 +30,7 @@ public String getSerializedName() { @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.ENDER_SKULL.create(pos, state); + return EIOBlockEntities.ENDER_SKULL.get().create(pos, state); } @Nullable diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/skull/WallEnderSkullBlock.java b/enderio-base/src/main/java/com/enderio/base/common/block/skull/WallEnderSkullBlock.java index 277796df5..1de731923 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/skull/WallEnderSkullBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/skull/WallEnderSkullBlock.java @@ -18,7 +18,7 @@ public WallEnderSkullBlock(Properties properties) { @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.ENDER_SKULL.create(pos, state); + return EIOBlockEntities.ENDER_SKULL.get().create(pos, state); } @Nullable diff --git a/enderio-base/src/main/java/com/enderio/base/common/config/BaseConfigLang.java b/enderio-base/src/main/java/com/enderio/base/common/config/BaseConfigLang.java index c1a85e081..bb52681a6 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/config/BaseConfigLang.java +++ b/enderio-base/src/main/java/com/enderio/base/common/config/BaseConfigLang.java @@ -45,7 +45,6 @@ public static void register() { } private static void addTranslation(String key, String translation) { - // TODO: More translation options in Regilite - EnderIOBase.REGILITE.addTranslation(() -> EnderIOBase.MODULE_MOD_ID + "." + "configuration" + "." + key, translation); + EnderIOBase.REGILITE.lang().add(EnderIOBase.MODULE_MOD_ID + "." + "configuration" + "." + key, translation); } } diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java index bcb260088..fcec05194 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java @@ -6,15 +6,16 @@ import com.enderio.base.common.blockentity.PoweredLightBlockEntity; import com.enderio.base.common.paint.blockentity.DoublePaintedBlockEntity; import com.enderio.base.common.paint.blockentity.SinglePaintedBlockEntity; -import com.enderio.regilite.holder.RegiliteBlockEntity; -import com.enderio.regilite.registry.BlockEntityRegistry; -import net.neoforged.bus.api.IEventBus; +import com.enderio.regilite.blockentities.RegiliteBlockEntities; +import net.minecraft.world.level.block.entity.BlockEntityType; + +import java.util.function.Supplier; public class EIOBlockEntities { - private static final BlockEntityRegistry BLOCK_ENTITY_REGISTRY = EnderIOBase.REGILITE.blockEntityRegistry(); + private static final RegiliteBlockEntities BLOCK_ENTITIES = EnderIOBase.REGILITE.blockEntities(); - public static final RegiliteBlockEntity SINGLE_PAINTED = BLOCK_ENTITY_REGISTRY - .registerBlockEntity("single_painted", + public static final Supplier> SINGLE_PAINTED = BLOCK_ENTITIES + .create("single_painted", SinglePaintedBlockEntity::new, EIOBlocks.PAINTED_FENCE, EIOBlocks.PAINTED_FENCE_GATE, @@ -25,26 +26,26 @@ public class EIOBlockEntities { EIOBlocks.PAINTED_TRAPDOOR, EIOBlocks.PAINTED_WOODEN_PRESSURE_PLATE, EIOBlocks.PAINTED_GLOWSTONE, - EIOBlocks.PAINTED_WALL); + EIOBlocks.PAINTED_WALL).finish(); - public static final RegiliteBlockEntity DOUBLE_PAINTED = BLOCK_ENTITY_REGISTRY - .registerBlockEntity("double_painted", DoublePaintedBlockEntity::new, EIOBlocks.PAINTED_SLAB); + public static final Supplier> DOUBLE_PAINTED = BLOCK_ENTITIES + .create("double_painted", DoublePaintedBlockEntity::new, EIOBlocks.PAINTED_SLAB).finish(); - public static final RegiliteBlockEntity POWERED_LIGHT = BLOCK_ENTITY_REGISTRY - .registerBlockEntity("powered_light", + public static final Supplier> POWERED_LIGHT = BLOCK_ENTITIES + .create("powered_light", PoweredLightBlockEntity::new, EIOBlocks.POWERED_LIGHT, EIOBlocks.POWERED_LIGHT_INVERTED, EIOBlocks.POWERED_LIGHT_WIRELESS, - EIOBlocks.POWERED_LIGHT_INVERTED_WIRELESS); + EIOBlocks.POWERED_LIGHT_INVERTED_WIRELESS) + .finish(); - public static final RegiliteBlockEntity LIGHT_NODE = BLOCK_ENTITY_REGISTRY - .registerBlockEntity("light_node", LightNodeBlockEntity::new, EIOBlocks.LIGHT_NODE); + public static final Supplier> LIGHT_NODE = BLOCK_ENTITIES + .create("light_node", LightNodeBlockEntity::new, EIOBlocks.LIGHT_NODE).finish(); - public static final RegiliteBlockEntity ENDER_SKULL = BLOCK_ENTITY_REGISTRY - .registerBlockEntity("ender_skull", EnderSkullBlockEntity::new, EIOBlocks.WALL_ENDERMAN_HEAD, EIOBlocks.ENDERMAN_HEAD); + public static final Supplier> ENDER_SKULL = BLOCK_ENTITIES + .create("ender_skull", EnderSkullBlockEntity::new, EIOBlocks.WALL_ENDERMAN_HEAD, EIOBlocks.ENDERMAN_HEAD).finish(); - public static void register(IEventBus eventBus) { - BLOCK_ENTITY_REGISTRY.register(eventBus); + public static void register() { } } diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java index 9a42cf858..592b5520a 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java @@ -36,10 +36,9 @@ import com.enderio.base.common.tag.EIOTags; import com.enderio.base.data.loot.DecorLootTable; import com.enderio.base.data.model.block.EIOBlockState; -import com.enderio.regilite.data.RegiliteBlockLootProvider; -import com.enderio.regilite.holder.RegiliteBlock; -import com.enderio.regilite.registry.BlockRegistry; -import com.enderio.regilite.registry.ItemRegistry; +import com.enderio.regilite.blocks.BlockBuilder; +import com.enderio.regilite.blocks.RegiliteBlockLootProvider; +import com.enderio.regilite.blocks.RegiliteBlocks; import net.minecraft.core.Direction; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; @@ -63,12 +62,12 @@ import net.minecraft.world.level.block.state.properties.NoteBlockInstrument; import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.PushReaction; -import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.client.model.generators.BlockModelProvider; import net.neoforged.neoforge.client.model.generators.ConfiguredModel; import net.neoforged.neoforge.client.model.generators.ModelFile; import net.neoforged.neoforge.client.model.generators.VariantBlockStateBuilder; import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.registries.DeferredBlock; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; @@ -82,28 +81,27 @@ @SuppressWarnings("unused") public class EIOBlocks { - private static final BlockRegistry BLOCK_REGISTRY = EnderIOBase.REGILITE.blockRegistry(); - private static final ItemRegistry ITEM_REGISTRY = EnderIOBase.REGILITE.itemRegistry(); + private static final RegiliteBlocks BLOCKS = EnderIOBase.REGILITE.blocks(); // region Alloy Blocks - public static final RegiliteBlock COPPER_ALLOY_BLOCK = metalBlock("copper_alloy_block", EIOTags.Blocks.BLOCKS_COPPER_ALLOY, + public static final DeferredBlock COPPER_ALLOY_BLOCK = metalBlock("copper_alloy_block", EIOTags.Blocks.BLOCKS_COPPER_ALLOY, EIOTags.Items.BLOCKS_COPPER_ALLOY); - public static final RegiliteBlock ENERGETIC_ALLOY_BLOCK = metalBlock("energetic_alloy_block", EIOTags.Blocks.BLOCKS_ENERGETIC_ALLOY, + public static final DeferredBlock ENERGETIC_ALLOY_BLOCK = metalBlock("energetic_alloy_block", EIOTags.Blocks.BLOCKS_ENERGETIC_ALLOY, EIOTags.Items.BLOCKS_ENERGETIC_ALLOY); - public static final RegiliteBlock VIBRANT_ALLOY_BLOCK = metalBlock("vibrant_alloy_block", EIOTags.Blocks.BLOCKS_VIBRANT_ALLOY, + public static final DeferredBlock VIBRANT_ALLOY_BLOCK = metalBlock("vibrant_alloy_block", EIOTags.Blocks.BLOCKS_VIBRANT_ALLOY, EIOTags.Items.BLOCKS_VIBRANT_ALLOY); - public static final RegiliteBlock REDSTONE_ALLOY_BLOCK = metalBlock("redstone_alloy_block", EIOTags.Blocks.BLOCKS_REDSTONE_ALLOY, + public static final DeferredBlock REDSTONE_ALLOY_BLOCK = metalBlock("redstone_alloy_block", EIOTags.Blocks.BLOCKS_REDSTONE_ALLOY, EIOTags.Items.BLOCKS_REDSTONE_ALLOY); - public static final RegiliteBlock CONDUCTIVE_ALLOY_BLOCK = metalBlock("conductive_alloy_block", EIOTags.Blocks.BLOCKS_CONDUCTIVE_ALLOY, + public static final DeferredBlock CONDUCTIVE_ALLOY_BLOCK = metalBlock("conductive_alloy_block", EIOTags.Blocks.BLOCKS_CONDUCTIVE_ALLOY, EIOTags.Items.BLOCKS_CONDUCTIVE_ALLOY); - public static final RegiliteBlock PULSATING_ALLOY_BLOCK = metalBlock("pulsating_alloy_block", EIOTags.Blocks.BLOCKS_PULSATING_ALLOY, + public static final DeferredBlock PULSATING_ALLOY_BLOCK = metalBlock("pulsating_alloy_block", EIOTags.Blocks.BLOCKS_PULSATING_ALLOY, EIOTags.Items.BLOCKS_PULSATING_ALLOY); - public static final RegiliteBlock DARK_STEEL_BLOCK = metalBlock("dark_steel_block", EIOTags.Blocks.BLOCKS_DARK_STEEL, + public static final DeferredBlock DARK_STEEL_BLOCK = metalBlock("dark_steel_block", EIOTags.Blocks.BLOCKS_DARK_STEEL, EIOTags.Items.BLOCKS_DARK_STEEL); - public static final RegiliteBlock SOULARIUM_BLOCK = metalBlock("soularium_block", EIOTags.Blocks.BLOCKS_SOULARIUM, + public static final DeferredBlock SOULARIUM_BLOCK = metalBlock("soularium_block", EIOTags.Blocks.BLOCKS_SOULARIUM, EIOTags.Items.BLOCKS_SOULARIUM); - public static final RegiliteBlock END_STEEL_BLOCK = metalBlock("end_steel_block", EIOTags.Blocks.BLOCKS_END_STEEL, + public static final DeferredBlock END_STEEL_BLOCK = metalBlock("end_steel_block", EIOTags.Blocks.BLOCKS_END_STEEL, EIOTags.Items.BLOCKS_END_STEEL); // endregion @@ -111,20 +109,20 @@ public class EIOBlocks { // region Chassis // Iron tier - public static final RegiliteBlock VOID_CHASSIS = chassisBlock("void_chassis"); + public static final DeferredBlock VOID_CHASSIS = chassisBlock("void_chassis"); // Void chassis + some kind of dragons breath derrived process - // public static final RegiliteBlock REKINDLED_VOID_CHASSIS = chassisBlock("rekindled_void_chassis"); + // public static final DeferredBlock REKINDLED_VOID_CHASSIS = chassisBlock("rekindled_void_chassis"); // Soularium + soul/nether - public static final RegiliteBlock ENSOULED_CHASSIS = chassisBlock("ensouled_chassis"); + public static final DeferredBlock ENSOULED_CHASSIS = chassisBlock("ensouled_chassis"); // Ensnared + Some kind of other material // This is for machines that require a bound soul - // public static final RegiliteBlock TRAPPED_CHASSIS = chassisBlock("trapped_chassis"); + // public static final DeferredBlock TRAPPED_CHASSIS = chassisBlock("trapped_chassis"); // Dark steel + sculk - // public static final RegiliteBlock SCULK_CHASSIS = chassisBlock("sculk_chassis"); + // public static final DeferredBlock SCULK_CHASSIS = chassisBlock("sculk_chassis"); // endregion @@ -132,84 +130,90 @@ public class EIOBlocks { // region Dark Steel Building Blocks - public static final RegiliteBlock DARK_STEEL_LADDER = BLOCK_REGISTRY - .registerBlock("dark_steel_ladder", DarkSteelLadderBlock::new, BlockBehaviour.Properties.of().strength(0.4f).requiresCorrectToolForDrops().sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) - .setBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov + public static final DeferredBlock DARK_STEEL_LADDER = BLOCKS + .create("dark_steel_ladder", DarkSteelLadderBlock::new, BlockBehaviour.Properties.of().strength(0.4f).requiresCorrectToolForDrops().sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) + .blockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov .models() .withExistingParent(ctx.getName(), prov.mcLoc("block/ladder")) .renderType(prov.mcLoc("cutout_mipped")) .texture("particle", prov.blockTexture(ctx.get())) .texture("texture", prov.blockTexture(ctx.get())))) - .withTags(BlockTags.CLIMBABLE, BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_ladder"))) - .withTab(EIOCreativeTabs.BLOCKS)); - - public static final RegiliteBlock DARK_STEEL_BARS = BLOCK_REGISTRY - .registerBlock("dark_steel_bars", IronBarsBlock::new, + .tags(BlockTags.CLIMBABLE, BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .createSimpleBlockItem(item -> item + .modelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_ladder"))) + .tab(EIOCreativeTabs.BLOCKS)) + .finish(); + + public static final DeferredBlock DARK_STEEL_BARS = BLOCKS + .create("dark_steel_bars", IronBarsBlock::new, BlockBehaviour.Properties.of().strength(5.0f, 1000.0f).requiresCorrectToolForDrops().sound(SoundType.METAL).noOcclusion()) - .setBlockStateProvider(EIOBlockState::paneBlock) - .withTags( + .blockStateProvider(EIOBlockState::paneBlock) + .tags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) - .withBlockItem(ITEM_REGISTRY, item -> item - .withTab(EIOCreativeTabs.BLOCKS) - .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_bars"))) - ); + .createSimpleBlockItem(item -> item + .tab(EIOCreativeTabs.BLOCKS) + .modelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_bars"))) + ) + .finish(); - public static final RegiliteBlock DARK_STEEL_DOOR = BLOCK_REGISTRY - .registerBlock("dark_steel_door", props -> new DoorBlock(BlockSetType.IRON, props), + public static final DeferredBlock DARK_STEEL_DOOR = BLOCKS + .create("dark_steel_door", props -> new DoorBlock(BlockSetType.IRON, props), BlockBehaviour.Properties.of().strength(5.0f, 2000.0f).sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) - .withLootTable(RegiliteBlockLootProvider::createDoor) - .setBlockStateProvider( + .lootTable(RegiliteBlockLootProvider::createDoor) + .blockStateProvider( (prov, ctx) -> prov.doorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_door_bottom"), prov.modLoc("block/dark_steel_door_top"), prov.mcLoc("cutout"))) - .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.DOORS) - .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get())) - .withTab(EIOCreativeTabs.BLOCKS) - ); - - public static final RegiliteBlock DARK_STEEL_TRAPDOOR = BLOCK_REGISTRY - .registerBlock("dark_steel_trapdoor", props -> new TrapDoorBlock(BlockSetType.IRON, props), + .tags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.DOORS) + .createSimpleBlockItem(item -> item + .modelProvider((prov, ctx) -> prov.basicItem(ctx.get())) + .tab(EIOCreativeTabs.BLOCKS) + ) + .finish(); + + public static final DeferredBlock DARK_STEEL_TRAPDOOR = BLOCKS + .create("dark_steel_trapdoor", props -> new TrapDoorBlock(BlockSetType.IRON, props), BlockBehaviour.Properties.of().strength(5.0f, 2000.0f).sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) - .setBlockStateProvider((prov, ctx) -> prov.trapdoorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_trapdoor"), true, prov.mcLoc("cutout"))) - .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.TRAPDOORS) - .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.modLoc("block/dark_steel_trapdoor_bottom"))) - .withTab(EIOCreativeTabs.BLOCKS) - ); - - public static final RegiliteBlock END_STEEL_BARS = BLOCK_REGISTRY - .registerBlock("end_steel_bars", IronBarsBlock::new, + .blockStateProvider((prov, ctx) -> prov.trapdoorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_trapdoor"), true, prov.mcLoc("cutout"))) + .tags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.TRAPDOORS) + .createSimpleBlockItem(item -> item + .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.modLoc("block/dark_steel_trapdoor_bottom"))) + .tab(EIOCreativeTabs.BLOCKS) + ) + .finish(); + + public static final DeferredBlock END_STEEL_BARS = BLOCKS + .create("end_steel_bars", IronBarsBlock::new, BlockBehaviour.Properties.of().strength(5.0f, 1000.0f).requiresCorrectToolForDrops().sound(SoundType.METAL).noOcclusion()) - .setBlockStateProvider(EIOBlockState::paneBlock) - .withTags( + .blockStateProvider(EIOBlockState::paneBlock) + .tags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) - .withBlockItem(ITEM_REGISTRY, item -> item - .withTab(EIOCreativeTabs.BLOCKS) - .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/end_steel_bars"))) - ); + .createSimpleBlockItem(item -> item + .tab(EIOCreativeTabs.BLOCKS) + .modelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/end_steel_bars"))) + ) + .finish(); - public static final RegiliteBlock REINFORCED_OBSIDIAN = BLOCK_REGISTRY - .registerBlock("reinforced_obsidian_block", ReinforcedObsidianBlock::new, + public static final DeferredBlock REINFORCED_OBSIDIAN = BLOCKS + .create("reinforced_obsidian_block", ReinforcedObsidianBlock::new, BlockBehaviour.Properties.of() .sound(SoundType.STONE) .strength(50, 2000) .requiresCorrectToolForDrops() .mapColor(MapColor.COLOR_BLACK) .instrument(NoteBlockInstrument.BASEDRUM)) - .withTags( + .tags( BlockTags.WITHER_IMMUNE, BlockTags.NEEDS_DIAMOND_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) - .withBlockItem(ITEM_REGISTRY, item -> item - .withTab(EIOCreativeTabs.BLOCKS) - ); + .createSimpleBlockItem(item -> item + .tab(EIOCreativeTabs.BLOCKS) + ) + .finish(); // endregion @@ -223,7 +227,7 @@ private static Map fillGlassMap() { for (GlassCollisionPredicate collisionPredicate : GlassCollisionPredicate.values()) { for (Boolean isFused : new boolean[] { false, true }) { GlassIdentifier identifier = new GlassIdentifier(lighting, collisionPredicate, isFused); - map.put(identifier, new GlassBlocks(BLOCK_REGISTRY, ITEM_REGISTRY, identifier)); + map.put(identifier, new GlassBlocks(EnderIOBase.REGILITE, identifier)); } } } @@ -234,20 +238,20 @@ private static Map fillGlassMap() { // region Miscellaneous - public static final RegiliteBlock SOUL_CHAIN = BLOCK_REGISTRY - .registerBlock("soul_chain", ChainBlock::new, + public static final DeferredBlock SOUL_CHAIN = BLOCKS + .create("soul_chain", ChainBlock::new, BlockBehaviour.Properties.of() .requiresCorrectToolForDrops() .strength(5.0F, 6.0F) .sound(SoundType.CHAIN) .noOcclusion() .mapColor(MapColor.NONE)) - .withTags( + .tags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE, Tags.Blocks.CHAINS ) - .setBlockStateProvider((prov, ctx) -> { + .blockStateProvider((prov, ctx) -> { var model = prov .models() .withExistingParent(ctx.getName(), prov.mcLoc("block/chain")) @@ -257,15 +261,16 @@ private static Map fillGlassMap() { prov.axisBlock(ctx.get(), model, model); }) - .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("item/soul_chain"))) - .withTags(Tags.Items.CHAINS) - .withTab(EIOCreativeTabs.BLOCKS) - ); - - public static final RegiliteBlock COLD_FIRE = BLOCK_REGISTRY - .registerBlock("cold_fire", ColdFireBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.FIRE).noLootTable()) - .setBlockStateProvider((prov, ctx) -> { + .createSimpleBlockItem(item -> item + .modelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("item/soul_chain"))) + .tags(Tags.Items.CHAINS) + .tab(EIOCreativeTabs.BLOCKS) + ) + .finish(); + + public static final DeferredBlock COLD_FIRE = BLOCKS + .create("cold_fire", ColdFireBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.FIRE).noLootTable()) + .blockStateProvider((prov, ctx) -> { // This generates the models used for the blockstate in our resources. // One day we may bother to datagen that file. String[] toCopy = { "fire_floor0", "fire_floor1", "fire_side0", "fire_side1", "fire_side_alt0", "fire_side_alt1", "fire_up0", "fire_up1", @@ -274,189 +279,195 @@ private static Map fillGlassMap() { for (String name : toCopy) { prov.models().withExistingParent(name, prov.mcLoc(name)).renderType("cutout"); } - }); + }) + .finish(); // endregion // region Pressure Plates - public static final RegiliteBlock DARK_STEEL_PRESSURE_PLATE = pressurePlateBlock("dark_steel_pressure_plate", + public static final DeferredBlock DARK_STEEL_PRESSURE_PLATE = pressurePlateBlock("dark_steel_pressure_plate", EnderIOBase.loc("block/dark_steel_pressure_plate"), EIOPressurePlateBlock.PLAYER, false); - public static final RegiliteBlock SILENT_DARK_STEEL_PRESSURE_PLATE = pressurePlateBlock("silent_dark_steel_pressure_plate", + public static final DeferredBlock SILENT_DARK_STEEL_PRESSURE_PLATE = pressurePlateBlock("silent_dark_steel_pressure_plate", EnderIOBase.loc("block/dark_steel_pressure_plate"), EIOPressurePlateBlock.PLAYER, true); - public static final RegiliteBlock SOULARIUM_PRESSURE_PLATE = pressurePlateBlock("soularium_pressure_plate", + public static final DeferredBlock SOULARIUM_PRESSURE_PLATE = pressurePlateBlock("soularium_pressure_plate", EnderIOBase.loc("block/soularium_pressure_plate"), EIOPressurePlateBlock.HOSTILE_MOB, false); - public static final RegiliteBlock SILENT_SOULARIUM_PRESSURE_PLATE = pressurePlateBlock("silent_soularium_pressure_plate", + public static final DeferredBlock SILENT_SOULARIUM_PRESSURE_PLATE = pressurePlateBlock("silent_soularium_pressure_plate", EnderIOBase.loc("block/soularium_pressure_plate"), EIOPressurePlateBlock.HOSTILE_MOB, true); - public static final RegiliteBlock SILENT_OAK_PRESSURE_PLATE = silentPressurePlateBlock( + public static final DeferredBlock SILENT_OAK_PRESSURE_PLATE = silentPressurePlateBlock( (PressurePlateBlock) Blocks.OAK_PRESSURE_PLATE); - public static final RegiliteBlock SILENT_ACACIA_PRESSURE_PLATE = silentPressurePlateBlock( + public static final DeferredBlock SILENT_ACACIA_PRESSURE_PLATE = silentPressurePlateBlock( (PressurePlateBlock) Blocks.ACACIA_PRESSURE_PLATE); - public static final RegiliteBlock SILENT_DARK_OAK_PRESSURE_PLATE = silentPressurePlateBlock( + public static final DeferredBlock SILENT_DARK_OAK_PRESSURE_PLATE = silentPressurePlateBlock( (PressurePlateBlock) Blocks.DARK_OAK_PRESSURE_PLATE); - public static final RegiliteBlock SILENT_SPRUCE_PRESSURE_PLATE = silentPressurePlateBlock( + public static final DeferredBlock SILENT_SPRUCE_PRESSURE_PLATE = silentPressurePlateBlock( (PressurePlateBlock) Blocks.SPRUCE_PRESSURE_PLATE); - public static final RegiliteBlock SILENT_BIRCH_PRESSURE_PLATE = silentPressurePlateBlock( + public static final DeferredBlock SILENT_BIRCH_PRESSURE_PLATE = silentPressurePlateBlock( (PressurePlateBlock) Blocks.BIRCH_PRESSURE_PLATE); - public static final RegiliteBlock SILENT_JUNGLE_PRESSURE_PLATE = silentPressurePlateBlock( + public static final DeferredBlock SILENT_JUNGLE_PRESSURE_PLATE = silentPressurePlateBlock( (PressurePlateBlock) Blocks.JUNGLE_PRESSURE_PLATE); - public static final RegiliteBlock SILENT_CRIMSON_PRESSURE_PLATE = silentPressurePlateBlock( + public static final DeferredBlock SILENT_CRIMSON_PRESSURE_PLATE = silentPressurePlateBlock( (PressurePlateBlock) Blocks.CRIMSON_PRESSURE_PLATE); - public static final RegiliteBlock SILENT_WARPED_PRESSURE_PLATE = silentPressurePlateBlock( + public static final DeferredBlock SILENT_WARPED_PRESSURE_PLATE = silentPressurePlateBlock( (PressurePlateBlock) Blocks.WARPED_PRESSURE_PLATE); - public static final RegiliteBlock SILENT_STONE_PRESSURE_PLATE = silentPressurePlateBlock( + public static final DeferredBlock SILENT_STONE_PRESSURE_PLATE = silentPressurePlateBlock( (PressurePlateBlock) Blocks.STONE_PRESSURE_PLATE); - public static final RegiliteBlock SILENT_POLISHED_BLACKSTONE_PRESSURE_PLATE = silentPressurePlateBlock( + public static final DeferredBlock SILENT_POLISHED_BLACKSTONE_PRESSURE_PLATE = silentPressurePlateBlock( (PressurePlateBlock) Blocks.POLISHED_BLACKSTONE_PRESSURE_PLATE); - public static final RegiliteBlock SILENT_HEAVY_WEIGHTED_PRESSURE_PLATE = silentWeightedPressurePlateBlock( + public static final DeferredBlock SILENT_HEAVY_WEIGHTED_PRESSURE_PLATE = silentWeightedPressurePlateBlock( (WeightedPressurePlateBlock) Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE); - public static final RegiliteBlock SILENT_LIGHT_WEIGHTED_PRESSURE_PLATE = silentWeightedPressurePlateBlock( + public static final DeferredBlock SILENT_LIGHT_WEIGHTED_PRESSURE_PLATE = silentWeightedPressurePlateBlock( (WeightedPressurePlateBlock) Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE); // endregion // region resetting levers - public static final RegiliteBlock RESETTING_LEVER_FIVE = resettingLeverBlock("resetting_lever_five", 5, false); + public static final DeferredBlock RESETTING_LEVER_FIVE = resettingLeverBlock("resetting_lever_five", 5, false); - public static final RegiliteBlock RESETTING_LEVER_FIVE_INV = resettingLeverBlock("resetting_lever_five_inv", 5, true); + public static final DeferredBlock RESETTING_LEVER_FIVE_INV = resettingLeverBlock("resetting_lever_five_inv", 5, true); - public static final RegiliteBlock RESETTING_LEVER_TEN = resettingLeverBlock("resetting_lever_ten", 10, false); + public static final DeferredBlock RESETTING_LEVER_TEN = resettingLeverBlock("resetting_lever_ten", 10, false); - public static final RegiliteBlock RESETTING_LEVER_TEN_INV = resettingLeverBlock("resetting_lever_ten_inv", 10, true); + public static final DeferredBlock RESETTING_LEVER_TEN_INV = resettingLeverBlock("resetting_lever_ten_inv", 10, true); - public static final RegiliteBlock RESETTING_LEVER_THIRTY = resettingLeverBlock("resetting_lever_thirty", 30, false); + public static final DeferredBlock RESETTING_LEVER_THIRTY = resettingLeverBlock("resetting_lever_thirty", 30, false); - public static final RegiliteBlock RESETTING_LEVER_THIRTY_INV = resettingLeverBlock("resetting_lever_thirty_inv", 30, true); + public static final DeferredBlock RESETTING_LEVER_THIRTY_INV = resettingLeverBlock("resetting_lever_thirty_inv", 30, true); - public static final RegiliteBlock RESETTING_LEVER_SIXTY = resettingLeverBlock("resetting_lever_sixty", 60, false); + public static final DeferredBlock RESETTING_LEVER_SIXTY = resettingLeverBlock("resetting_lever_sixty", 60, false); - public static final RegiliteBlock RESETTING_LEVER_SIXTY_INV = resettingLeverBlock("resetting_lever_sixty_inv", 60, true); + public static final DeferredBlock RESETTING_LEVER_SIXTY_INV = resettingLeverBlock("resetting_lever_sixty_inv", 60, true); - public static final RegiliteBlock RESETTING_LEVER_THREE_HUNDRED = resettingLeverBlock("resetting_lever_three_hundred", 300, false); + public static final DeferredBlock RESETTING_LEVER_THREE_HUNDRED = resettingLeverBlock("resetting_lever_three_hundred", 300, false); - public static final RegiliteBlock RESETTING_LEVER_THREE_HUNDRED_INV = resettingLeverBlock("resetting_lever_three_hundred_inv", 300, true); + public static final DeferredBlock RESETTING_LEVER_THREE_HUNDRED_INV = resettingLeverBlock("resetting_lever_three_hundred_inv", 300, true); // endregion private static final List> PAINTED = new ArrayList<>(); - public static final RegiliteBlock PAINTED_FENCE = paintedBlock("painted_fence", PaintedFenceBlock::new, Blocks.OAK_FENCE, - BlockTags.WOODEN_FENCES, BlockTags.MINEABLE_WITH_AXE); + public static final DeferredBlock PAINTED_FENCE = paintedBlock("painted_fence", PaintedFenceBlock::new, Blocks.OAK_FENCE, + BlockTags.WOODEN_FENCES, BlockTags.MINEABLE_WITH_AXE).finish(); - public static final RegiliteBlock PAINTED_FENCE_GATE = paintedBlock("painted_fence_gate", PaintedFenceGateBlock::new, - Blocks.OAK_FENCE_GATE, BlockTags.FENCE_GATES, BlockTags.MINEABLE_WITH_AXE); + public static final DeferredBlock PAINTED_FENCE_GATE = paintedBlock("painted_fence_gate", PaintedFenceGateBlock::new, + Blocks.OAK_FENCE_GATE, BlockTags.FENCE_GATES, BlockTags.MINEABLE_WITH_AXE).finish(); - public static final RegiliteBlock PAINTED_SAND = paintedBlock("painted_sand", PaintedSandBlock::new, Blocks.SAND, BlockTags.SAND, - BlockTags.MINEABLE_WITH_SHOVEL); + public static final DeferredBlock PAINTED_SAND = paintedBlock("painted_sand", PaintedSandBlock::new, Blocks.SAND, BlockTags.SAND, + BlockTags.MINEABLE_WITH_SHOVEL).finish(); - public static final RegiliteBlock PAINTED_STAIRS = paintedBlock("painted_stairs", PaintedStairBlock::new, Blocks.OAK_STAIRS, Direction.WEST, - BlockTags.WOODEN_STAIRS, BlockTags.MINEABLE_WITH_AXE); + public static final DeferredBlock PAINTED_STAIRS = paintedBlock("painted_stairs", PaintedStairBlock::new, Blocks.OAK_STAIRS, Direction.WEST, + BlockTags.WOODEN_STAIRS, BlockTags.MINEABLE_WITH_AXE).finish(); - public static final RegiliteBlock PAINTED_CRAFTING_TABLE = paintedBlock("painted_crafting_table", PaintedCraftingTableBlock::new, - Blocks.CRAFTING_TABLE, BlockTags.MINEABLE_WITH_AXE); + public static final DeferredBlock PAINTED_CRAFTING_TABLE = paintedBlock("painted_crafting_table", PaintedCraftingTableBlock::new, + Blocks.CRAFTING_TABLE, BlockTags.MINEABLE_WITH_AXE).finish(); - public static final RegiliteBlock PAINTED_REDSTONE_BLOCK = paintedBlock("painted_redstone_block", PaintedRedstoneBlock::new, - Blocks.REDSTONE_BLOCK, BlockTags.MINEABLE_WITH_PICKAXE); + public static final DeferredBlock PAINTED_REDSTONE_BLOCK = paintedBlock("painted_redstone_block", PaintedRedstoneBlock::new, + Blocks.REDSTONE_BLOCK, BlockTags.MINEABLE_WITH_PICKAXE).finish(); - public static final RegiliteBlock PAINTED_TRAPDOOR = paintedBlock("painted_trapdoor", PaintedTrapDoorBlock::new, Blocks.OAK_TRAPDOOR, - BlockTags.WOODEN_TRAPDOORS, BlockTags.MINEABLE_WITH_AXE); + public static final DeferredBlock PAINTED_TRAPDOOR = paintedBlock("painted_trapdoor", PaintedTrapDoorBlock::new, Blocks.OAK_TRAPDOOR, + BlockTags.WOODEN_TRAPDOORS, BlockTags.MINEABLE_WITH_AXE).finish(); - public static final RegiliteBlock PAINTED_WOODEN_PRESSURE_PLATE = paintedBlock("painted_wooden_pressure_plate", - PaintedWoodenPressurePlateBlock::new, Blocks.OAK_PRESSURE_PLATE, BlockTags.WOODEN_PRESSURE_PLATES, BlockTags.MINEABLE_WITH_AXE); + public static final DeferredBlock PAINTED_WOODEN_PRESSURE_PLATE = paintedBlock("painted_wooden_pressure_plate", + PaintedWoodenPressurePlateBlock::new, Blocks.OAK_PRESSURE_PLATE, BlockTags.WOODEN_PRESSURE_PLATES, BlockTags.MINEABLE_WITH_AXE).finish(); - public static final RegiliteBlock PAINTED_SLAB = paintedBlock("painted_slab", PaintedSlabBlock::new, PaintedSlabBlockItem::new, - Blocks.OAK_SLAB, BlockTags.WOODEN_SLABS, BlockTags.MINEABLE_WITH_AXE).withLootTable(DecorLootTable::paintedSlab); + public static final DeferredBlock PAINTED_SLAB = paintedBlock("painted_slab", PaintedSlabBlock::new, PaintedSlabBlockItem::new, + Blocks.OAK_SLAB, BlockTags.WOODEN_SLABS, BlockTags.MINEABLE_WITH_AXE).lootTable(DecorLootTable::paintedSlab).finish(); - public static final RegiliteBlock PAINTED_GLOWSTONE = paintedBlock("painted_glowstone", SinglePaintedBlock::new, - Blocks.GLOWSTONE); + public static final DeferredBlock PAINTED_GLOWSTONE = paintedBlock("painted_glowstone", SinglePaintedBlock::new, + Blocks.GLOWSTONE).finish(); - public static RegiliteBlock PAINTED_WALL = paintedBlock("painted_wall", PaintedWallBlock::new, Blocks.COBBLESTONE_WALL, - BlockTags.WALLS, BlockTags.MINEABLE_WITH_PICKAXE); + public static DeferredBlock PAINTED_WALL = paintedBlock("painted_wall", PaintedWallBlock::new, Blocks.COBBLESTONE_WALL, + BlockTags.WALLS, BlockTags.MINEABLE_WITH_PICKAXE).finish(); // endregion // region Light - public static final RegiliteBlock LIGHT = lightBlock("light", s -> new Light(false, s)); - public static final RegiliteBlock LIGHT_INVERTED = lightBlock("light_inverted", s -> new Light(true, s)); - public static final RegiliteBlock POWERED_LIGHT = lightBlock("powered_light", s -> new PoweredLight(false, false, s)); - public static final RegiliteBlock POWERED_LIGHT_INVERTED = lightBlock("powered_light_inverted", s -> new PoweredLight(true, false, s)); - public static final RegiliteBlock POWERED_LIGHT_WIRELESS = lightBlock("powered_light_wireless", s -> new PoweredLight(false, true, s)); - public static final RegiliteBlock POWERED_LIGHT_INVERTED_WIRELESS = lightBlock("powered_light_inverted_wireless", + public static final DeferredBlock LIGHT = lightBlock("light", s -> new Light(false, s)); + public static final DeferredBlock LIGHT_INVERTED = lightBlock("light_inverted", s -> new Light(true, s)); + public static final DeferredBlock POWERED_LIGHT = lightBlock("powered_light", s -> new PoweredLight(false, false, s)); + public static final DeferredBlock POWERED_LIGHT_INVERTED = lightBlock("powered_light_inverted", s -> new PoweredLight(true, false, s)); + public static final DeferredBlock POWERED_LIGHT_WIRELESS = lightBlock("powered_light_wireless", s -> new PoweredLight(false, true, s)); + public static final DeferredBlock POWERED_LIGHT_INVERTED_WIRELESS = lightBlock("powered_light_inverted_wireless", s -> new PoweredLight(true, true, s)); - public static final RegiliteBlock LIGHT_NODE = BLOCK_REGISTRY - .registerBlock("light_node", LightNode::new, BlockBehaviour.Properties.ofFullCopy(Blocks.AIR).lightLevel(l -> 15).noLootTable().noCollission().noOcclusion()) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().withExistingParent("light_node", "block/air"))); + public static final DeferredBlock LIGHT_NODE = BLOCKS + .create("light_node", LightNode::new, BlockBehaviour.Properties.ofFullCopy(Blocks.AIR).lightLevel(l -> 15).noLootTable().noCollission().noOcclusion()) + .blockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().withExistingParent("light_node", "block/air"))) + .finish(); - public static final RegiliteBlock ENDERMAN_HEAD = BLOCK_REGISTRY - .registerBlock("enderman_head", EnderSkullBlock::new, + public static final DeferredBlock ENDERMAN_HEAD = BLOCKS + .create("enderman_head", EnderSkullBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SKELETON_SKULL).instrument(NoteBlockInstrument.SKELETON).strength(1.0F).pushReaction(PushReaction.DESTROY)) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) - .withBlockItem(ITEM_REGISTRY, + .blockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) + .withBlockItem( // TODO: Properties being handled right? Maybe cleaner if we have a factory that takes properties, then a properties arg. (enderSkullBlock) -> new EnderSkullBlockItem(enderSkullBlock, new Item.Properties(), Direction.DOWN), item -> item - .withTab(EIOCreativeTabs.MAIN) - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), "item/template_skull"))); + .tab(EIOCreativeTabs.MAIN) + .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), "item/template_skull"))) + .finish(); - public static final RegiliteBlock WALL_ENDERMAN_HEAD = BLOCK_REGISTRY - .registerBlock("wall_enderman_head", WallEnderSkullBlock::new, + public static final DeferredBlock WALL_ENDERMAN_HEAD = BLOCKS + .create("wall_enderman_head", WallEnderSkullBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SKELETON_SKULL).strength(1.0F).lootFrom(ENDERMAN_HEAD).pushReaction(PushReaction.DESTROY)) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) - .withTranslation(""); - - private static RegiliteBlock metalBlock(String name, TagKey blockTag, TagKey itemTag) { - return BLOCK_REGISTRY - .registerBlock(name, Block::new, BlockBehaviour.Properties.of().sound(SoundType.METAL).mapColor(MapColor.METAL).strength(5, 6).requiresCorrectToolForDrops()) - .withTags( + .blockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) + .translation("") + .finish(); + + private static DeferredBlock metalBlock(String name, TagKey blockTag, TagKey itemTag) { + return BLOCKS + .create(name, Block::new, BlockBehaviour.Properties.of().sound(SoundType.METAL).mapColor(MapColor.METAL).strength(5, 6).requiresCorrectToolForDrops()) + .tags( BlockTags.NEEDS_STONE_TOOL, BlockTags.MINEABLE_WITH_PICKAXE, blockTag ) - .withBlockItem(ITEM_REGISTRY, item -> item - .withTab(EIOCreativeTabs.BLOCKS) - .withTags(itemTag) - ); + .createSimpleBlockItem(item -> item + .tab(EIOCreativeTabs.BLOCKS) + .tags(itemTag) + ) + .finish(); } - private static RegiliteBlock chassisBlock(String name) { - return BLOCK_REGISTRY - .registerBlock(name, Block::new, BlockBehaviour.Properties.of().noOcclusion().sound(SoundType.METAL).mapColor(MapColor.METAL).strength(5, 6)) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), + private static DeferredBlock chassisBlock(String name) { + return BLOCKS + .create(name, Block::new, BlockBehaviour.Properties.of().noOcclusion().sound(SoundType.METAL).mapColor(MapColor.METAL).strength(5, 6)) + .blockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().cubeAll(name, prov.blockTexture(ctx.get())).renderType(prov.mcLoc("translucent")))) - .withTags( + .tags( BlockTags.NEEDS_STONE_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) - .withBlockItem(ITEM_REGISTRY, item -> item - .withTab(EIOCreativeTabs.BLOCKS) - ); + .createSimpleBlockItem(item -> item + .tab(EIOCreativeTabs.BLOCKS) + ) + .finish(); } - private static RegiliteBlock pressurePlateBlock(String name, ResourceLocation texture, EIOPressurePlateBlock.Detector type, + private static DeferredBlock pressurePlateBlock(String name, ResourceLocation texture, EIOPressurePlateBlock.Detector type, boolean silent) { - return BLOCK_REGISTRY - .registerBlock(name, props -> new EIOPressurePlateBlock(props, type, silent), + return BLOCKS + .create(name, props -> new EIOPressurePlateBlock(props, type, silent), BlockBehaviour.Properties.of().strength(5, 6).mapColor(MapColor.METAL)) - .setBlockStateProvider((prov, ctx) -> { + .blockStateProvider((prov, ctx) -> { BlockModelProvider modProv = prov.models(); ModelFile dm = modProv.withExistingParent(name + "_down", prov.mcLoc("block/pressure_plate_down")).texture("texture", texture); ModelFile um = modProv.withExistingParent(name, prov.mcLoc("block/pressure_plate_up")).texture("texture", texture); @@ -465,58 +476,61 @@ private static RegiliteBlock pressurePlateBlock(String na vb.partialState().with(PressurePlateBlock.POWERED, true).addModels(new ConfiguredModel(dm)); vb.partialState().with(PressurePlateBlock.POWERED, false).addModels(new ConfiguredModel(um)); }) - .withTags(BlockTags.NEEDS_STONE_TOOL, BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) - .withBlockItem(ITEM_REGISTRY, item -> item - .withTab(EIOCreativeTabs.BLOCKS) - ); + .tags(BlockTags.NEEDS_STONE_TOOL, BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) + .createSimpleBlockItem(item -> item + .tab(EIOCreativeTabs.BLOCKS) + ) + .finish(); } - private static RegiliteBlock silentPressurePlateBlock(final PressurePlateBlock block) { + private static DeferredBlock silentPressurePlateBlock(final PressurePlateBlock block) { ResourceLocation upModelLoc = Objects.requireNonNull(BuiltInRegistries.BLOCK.getKey(block)); ResourceLocation downModelLoc = ResourceLocation.fromNamespaceAndPath(upModelLoc.getNamespace(), upModelLoc.getPath() + "_down"); - return BLOCK_REGISTRY - .registerBlock("silent_" + upModelLoc.getPath(), props -> new SilentPressurePlateBlock(block), + return BLOCKS + .create("silent_" + upModelLoc.getPath(), props -> new SilentPressurePlateBlock(block), BlockBehaviour.Properties.of()) - .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) - .setBlockStateProvider((prov, ctx) -> { + .tags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) + .blockStateProvider((prov, ctx) -> { VariantBlockStateBuilder vb = prov.getVariantBuilder(ctx.get()); vb.partialState().with(PressurePlateBlock.POWERED, true).addModels(new ConfiguredModel(prov.models().getExistingFile(downModelLoc))); vb.partialState().with(PressurePlateBlock.POWERED, false).addModels(new ConfiguredModel(prov.models().getExistingFile(upModelLoc))); }) - .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) - .withTab(EIOCreativeTabs.BLOCKS) - ); + .createSimpleBlockItem(item -> item + .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) + .tab(EIOCreativeTabs.BLOCKS) + ) + .finish(); } - private static RegiliteBlock silentWeightedPressurePlateBlock(WeightedPressurePlateBlock block) { + private static DeferredBlock silentWeightedPressurePlateBlock(WeightedPressurePlateBlock block) { ResourceLocation upModelLoc = Objects.requireNonNull(BuiltInRegistries.BLOCK.getKey(block)); ResourceLocation downModelLoc = ResourceLocation.fromNamespaceAndPath(upModelLoc.getNamespace(), upModelLoc.getPath() + "_down"); - return BLOCK_REGISTRY - .registerBlock("silent_" + upModelLoc.getPath(), props -> new SilentWeightedPressurePlateBlock(block), + return BLOCKS + .create("silent_" + upModelLoc.getPath(), props -> new SilentWeightedPressurePlateBlock(block), BlockBehaviour.Properties.of()) - .setBlockStateProvider((prov, ctx) -> prov.getVariantBuilder(ctx.get()).forAllStates(blockState -> { + .blockStateProvider((prov, ctx) -> prov.getVariantBuilder(ctx.get()).forAllStates(blockState -> { if (blockState.getValue(WeightedPressurePlateBlock.POWER) == 0) { return new ConfiguredModel[] { new ConfiguredModel(prov.models().getExistingFile(upModelLoc)) }; } return new ConfiguredModel[] { new ConfiguredModel(prov.models().getExistingFile(downModelLoc)) }; })) - .withTags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) - .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) - .withTab(EIOCreativeTabs.BLOCKS) - ); + .tags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) + .createSimpleBlockItem(item -> item + .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) + .tab(EIOCreativeTabs.BLOCKS) + ) + .finish(); } - private static RegiliteBlock resettingLeverBlock(String name, int duration, boolean inverted) { + private static DeferredBlock resettingLeverBlock(String name, int duration, boolean inverted) { String durationLabel = "(" + (duration >= 60 ? duration / 60 : duration) + " " + (duration == 60 ? "minute" : duration > 60 ? "minutes" : "seconds") + ")"; - return BLOCK_REGISTRY - .registerBlock(name, props -> new ResettingLeverBlock(duration, inverted), BlockBehaviour.Properties.of()) - .withTranslation("Resetting Lever " + (inverted ? "Inverted " : "") + durationLabel) - .setBlockStateProvider((prov, ctx) -> { + return BLOCKS + .create(name, props -> new ResettingLeverBlock(duration, inverted), BlockBehaviour.Properties.of()) + .translation("Resetting Lever " + (inverted ? "Inverted " : "") + durationLabel) + .blockStateProvider((prov, ctx) -> { BlockModelProvider modProv = prov.models(); ModelFile.ExistingModelFile baseModel = modProv.getExistingFile(prov.mcLoc("block/lever")); ModelFile.ExistingModelFile onModel = modProv.getExistingFile(prov.mcLoc("block/lever_on")); @@ -535,73 +549,72 @@ private static RegiliteBlock resettingLeverBlock(String nam return new ConfiguredModel[] { new ConfiguredModel(model, rotationX, rotationY, false) }; }); }) - .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.mcLoc("item/lever"))) - .withTab(EIOCreativeTabs.BLOCKS) - ); + .createSimpleBlockItem(item -> item + .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.mcLoc("item/lever"))) + .tab(EIOCreativeTabs.BLOCKS) + ) + .finish(); } - public static final RegiliteBlock INDUSTRIAL_INSULATION = BLOCK_REGISTRY - .registerBlock("industrial_insulation_block", IndustrialInsulationBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SPONGE)) - .withTranslation("Industrial Insulation") - .withBlockItem(ITEM_REGISTRY, item -> item - .withTab(EIOCreativeTabs.BLOCKS) - ); + public static final DeferredBlock INDUSTRIAL_INSULATION = BLOCKS + .create("industrial_insulation_block", IndustrialInsulationBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SPONGE)) + .translation("Industrial Insulation") + .createSimpleBlockItem(item -> item + .tab(EIOCreativeTabs.BLOCKS) + ) + .finish(); @SafeVarargs - private static RegiliteBlock paintedBlock(String name, Function blockFactory, + private static BlockBuilder paintedBlock(String name, Function blockFactory, Block copyFrom, TagKey... tags) { return paintedBlock(name, blockFactory, copyFrom, null, tags); } @SafeVarargs - private static RegiliteBlock paintedBlock(String name, Function blockFactory, + private static BlockBuilder paintedBlock(String name, Function blockFactory, Block copyFrom, @Nullable Direction itemTextureRotation, TagKey... tags) { return paintedBlock(name, blockFactory, PaintedBlockItem::new, copyFrom, itemTextureRotation, tags); } @SafeVarargs - private static RegiliteBlock paintedBlock(String name, Function blockFactory, + private static BlockBuilder paintedBlock(String name, Function blockFactory, BiFunction itemFactory, Block copyFrom, TagKey... tags) { return paintedBlock(name, blockFactory, itemFactory, copyFrom, null, tags); } @SafeVarargs - private static RegiliteBlock paintedBlock(String name, Function blockFactory, + private static BlockBuilder paintedBlock(String name, Function blockFactory, BiFunction itemFactory, Block copyFrom, @Nullable Direction itemTextureRotation, TagKey... tags) { - return BLOCK_REGISTRY - .registerBlock(name, blockFactory, BlockBehaviour.Properties.ofFullCopy(copyFrom).noOcclusion()) - .setBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock(name, prov, ctx.get(), copyFrom, itemTextureRotation)) - .withBlockColor(() -> PaintedBlockColor::new) - .withLootTable(DecorLootTable::withPaint) - .withTags(tags) + return BLOCKS + .create(name, blockFactory, BlockBehaviour.Properties.ofFullCopy(copyFrom).noOcclusion()) + .blockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock(name, prov, ctx.get(), copyFrom, itemTextureRotation)) + .blockColor(() -> PaintedBlockColor::new) + .lootTable(DecorLootTable::withPaint) + .tags(tags) .withBlockItem( - ITEM_REGISTRY, b -> itemFactory.apply(b, new Item.Properties()), item -> item - .setColorSupplier(() -> PaintedBlockColor::new)); + .itemColor(() -> PaintedBlockColor::new)); } - public static RegiliteBlock lightBlock(String name, Function blockFactory) { - return BLOCK_REGISTRY - .registerBlock(name, blockFactory, BlockBehaviour.Properties.of().sound(SoundType.METAL).mapColor(MapColor.METAL).lightLevel(l -> { + public static DeferredBlock lightBlock(String name, Function blockFactory) { + return BLOCKS + .create(name, blockFactory, BlockBehaviour.Properties.of().sound(SoundType.METAL).mapColor(MapColor.METAL).lightLevel(l -> { if (l.getValue(Light.ENABLED)) { return 15; } return 0; })) - .setBlockStateProvider(EIOBlockState::lightBlock) - .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> prov.withExistingParent(name, "block/button_inventory")) - .withTab(EIOCreativeTabs.BLOCKS) - ); + .blockStateProvider(EIOBlockState::lightBlock) + .createSimpleBlockItem(item -> item + .modelProvider((prov, ctx) -> prov.withExistingParent(name, "block/button_inventory")) + .tab(EIOCreativeTabs.BLOCKS) + ) + .finish(); } - public static void register(IEventBus bus) { - BLOCK_REGISTRY.register(bus); - ITEM_REGISTRY.register(bus); + public static void register() { } - } diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOCreativeTabs.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOCreativeTabs.java index 27a0a4d01..14e10c698 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOCreativeTabs.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOCreativeTabs.java @@ -43,7 +43,7 @@ public class EIOCreativeTabs { private static DeferredHolder createTab(ResourceKey key, String name, String translation, Consumer builder) { return CREATIVE_MODE_TABS.register(name, () -> { CreativeModeTab.Builder config = CreativeModeTab.builder() - .title(EnderIOBase.REGILITE.addTranslation("itemGroup", key.location(), translation)); + .title(EnderIOBase.REGILITE.lang().add("itemGroup", key.location(), translation)); builder.accept(config); return config.build(); }); diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIODataComponents.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIODataComponents.java index f7b16f9d2..0260543e6 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIODataComponents.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIODataComponents.java @@ -20,7 +20,7 @@ import java.util.function.Supplier; public class EIODataComponents { - private static final DeferredRegister.DataComponents DATA_COMPONENT_TYPES = DeferredRegister.createDataComponents(EnderIOBase.REGISTRY_NAMESPACE); + private static final DeferredRegister.DataComponents DATA_COMPONENT_TYPES = EnderIOBase.REGILITE.dataComponents(); public static Supplier> ITEM_FLUID_CONTENT = DATA_COMPONENT_TYPES.registerComponentType("item_fluid_content", builder -> builder.persistent(SimpleFluidContent.CODEC).networkSynchronized(SimpleFluidContent.STREAM_CODEC)); @@ -58,7 +58,6 @@ public class EIODataComponents { public static final Supplier> ENTITY_FILTER = DATA_COMPONENT_TYPES .registerComponentType("entity_filter", builder -> builder.persistent(EntityFilterCapability.Component.CODEC).networkSynchronized(EntityFilterCapability.Component.STREAM_CODEC)); - public static void register(IEventBus bus) { - DATA_COMPONENT_TYPES.register(bus); + public static void register() { } } diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java index 7d550f0e3..488c982fd 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java @@ -3,22 +3,22 @@ import com.enderio.EnderIOBase; import com.enderio.base.client.paint.PaintedSandRenderer; import com.enderio.base.common.paint.PaintedSandEntity; -import com.enderio.regilite.holder.RegiliteEntity; -import com.enderio.regilite.registry.EntityRegistry; +import com.enderio.regilite.entities.RegiliteEntities; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; -import net.neoforged.bus.api.IEventBus; + +import java.util.function.Supplier; public class EIOEntities { - private static final EntityRegistry ENTITY_REGISTRY = EnderIOBase.REGILITE.entityRegistry(); + private static final RegiliteEntities ENTITIES = EnderIOBase.REGILITE.entities(); - public static final RegiliteEntity PAINTED_SAND = ENTITY_REGISTRY - .registerEntity("painted_sand", (EntityType.EntityFactory) PaintedSandEntity::new, MobCategory.MISC) - .withRenderer(() -> PaintedSandRenderer::new) - .withTranslation("Painted Sand"); + public static final Supplier> PAINTED_SAND = ENTITIES + .create("painted_sand", (EntityType.EntityFactory) PaintedSandEntity::new, MobCategory.MISC) + .renderer(() -> PaintedSandRenderer::new) + .translation("Painted Sand") + .finish(); - public static void register(IEventBus bus) { - ENTITY_REGISTRY.register(bus); + public static void register() { } } diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java index 2676479f2..75eb71392 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java @@ -2,21 +2,14 @@ import com.enderio.EnderIOBase; import com.enderio.base.common.tag.EIOTags; -import com.enderio.regilite.holder.RegiliteFluid; -import com.enderio.regilite.registry.BlockRegistry; -import com.enderio.regilite.registry.FluidRegistry; -import com.enderio.regilite.registry.ItemRegistry; +import com.enderio.regilite.fluids.FluidTypeBuilder; +import com.enderio.regilite.fluids.FluidTypeHolder; +import com.enderio.regilite.fluids.RegiliteFluidTypes; import net.minecraft.client.renderer.RenderType; -import net.minecraft.core.registries.Registries; -import net.minecraft.world.item.BucketItem; -import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.LiquidBlock; import net.minecraft.world.level.block.state.BlockBehaviour; -import net.minecraft.world.level.material.Fluid; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.fluids.FluidType; -import net.neoforged.neoforge.registries.DeferredRegister; // TODO: Fluid behaviours and some cleaning. https://github.com/SleepyTrousers/EnderIO-Rewrite/issues/34 @@ -24,71 +17,63 @@ @SuppressWarnings("unused") public class EIOFluids { - private static final FluidRegistry FLUID_TYPE_REGISTRY = EnderIOBase.REGILITE.fluidRegistry(); - private static final DeferredRegister FLUID_REGISTRY = DeferredRegister.create(Registries.FLUID, EnderIOBase.REGISTRY_NAMESPACE); - private static final ItemRegistry ITEM_REGISTRY = EnderIOBase.REGILITE.itemRegistry(); - private static final BlockRegistry BLOCK_REGISTRY = EnderIOBase.REGILITE.blockRegistry(); + private static final RegiliteFluidTypes FLUID_TYPES = EnderIOBase.REGILITE.fluidTypes(); - public static final RegiliteFluid NUTRIENT_DISTILLATION = - fluid("nutrient_distillation", "Nutrient Distillation", FluidType.Properties.create().density(1500).viscosity(3000)); + public static final FluidTypeHolder NUTRIENT_DISTILLATION = + fluid("nutrient_distillation", "Nutrient Distillation", FluidType.Properties.create().density(1500).viscosity(3000)).finish(); - public static final RegiliteFluid DEW_OF_THE_VOID = - fluid("dew_of_the_void", "Fluid of the Void", FluidType.Properties.create().density(200).viscosity(1000).temperature(175)); + public static final FluidTypeHolder DEW_OF_THE_VOID = + fluid("dew_of_the_void", "Fluid of the Void", FluidType.Properties.create().density(200).viscosity(1000).temperature(175)).finish(); - public static final RegiliteFluid VAPOR_OF_LEVITY = - gasFluid("vapor_of_levity", "Vapor of Levity", FluidType.Properties.create().density(-10).viscosity(100).temperature(5)); + public static final FluidTypeHolder VAPOR_OF_LEVITY = + gasFluid("vapor_of_levity", "Vapor of Levity", FluidType.Properties.create().density(-10).viscosity(100).temperature(5)).finish(); - public static final RegiliteFluid HOOTCH = - fluid("hootch", "Hootch", FluidType.Properties.create().density(900).viscosity(1000)); + public static final FluidTypeHolder HOOTCH = + fluid("hootch", "Hootch", FluidType.Properties.create().density(900).viscosity(1000)).finish(); - public static final RegiliteFluid ROCKET_FUEL = - fluid("rocket_fuel", "Rocket Fuel", FluidType.Properties.create().density(900).viscosity(1000)); + public static final FluidTypeHolder ROCKET_FUEL = + fluid("rocket_fuel", "Rocket Fuel", FluidType.Properties.create().density(900).viscosity(1000)).finish(); - public static final RegiliteFluid FIRE_WATER = - fluid("fire_water", "Fire Water", FluidType.Properties.create().density(900).viscosity(1000).temperature(2000)); + public static final FluidTypeHolder FIRE_WATER = + fluid("fire_water", "Fire Water", FluidType.Properties.create().density(900).viscosity(1000).temperature(2000)).finish(); - public static final RegiliteFluid XP_JUICE = + public static final FluidTypeHolder XP_JUICE = fluid("xp_juice", "XP Juice", FluidType.Properties.create().lightLevel(10).density(800).viscosity(1500)) - .withTags(EIOTags.Fluids.EXPERIENCE); + .tag(EIOTags.Fluids.EXPERIENCE).finish(); - public static final RegiliteFluid LIQUID_SUNSHINE = + public static final FluidTypeHolder LIQUID_SUNSHINE = fluid("liquid_sunshine", "Liquid Sunshine", FluidType.Properties.create().density(200).viscosity(400)) - .withTags(EIOTags.Fluids.SOLAR_PANEL_LIGHT); + .tag(EIOTags.Fluids.SOLAR_PANEL_LIGHT).finish(); - public static final RegiliteFluid CLOUD_SEED = - fluid("cloud_seed", "Cloud Seed", FluidType.Properties.create().density(500).viscosity(800)); + public static final FluidTypeHolder CLOUD_SEED = + fluid("cloud_seed", "Cloud Seed", FluidType.Properties.create().density(500).viscosity(800)).finish(); - public static final RegiliteFluid CLOUD_SEED_CONCENTRATED = - fluid("cloud_seed_concentrated", "Cloud Seed Concentrated", FluidType.Properties.create().density(1000).viscosity(1200)); + public static final FluidTypeHolder CLOUD_SEED_CONCENTRATED = + fluid("cloud_seed_concentrated", "Cloud Seed Concentrated", FluidType.Properties.create().density(1000).viscosity(1200)).finish(); - private static RegiliteFluid fluid(String name, String translation, FluidType.Properties properties) { + private static FluidTypeBuilder fluid(String name, String translation, FluidType.Properties properties) { return baseFluid(name, properties) - .withTranslation(translation) - .withBucket(ITEM_REGISTRY, item -> item - .withTab(EIOCreativeTabs.MAIN) - .withTranslation(translation + " Bucket")); + .translation(translation) + .bucket(item -> item + .tab(EIOCreativeTabs.MAIN) + .translation(translation + " Bucket")); } - private static RegiliteFluid gasFluid(String name, String translation, FluidType.Properties properties) { + private static FluidTypeBuilder gasFluid(String name, String translation, FluidType.Properties properties) { return baseFluid(name, properties) - .withTranslation(translation) - .withBucket(ITEM_REGISTRY, item -> item - .withTab(EIOCreativeTabs.MAIN) - .withTranslation(translation + " Bucket")); + .translation(translation) + .bucket(item -> item + .tab(EIOCreativeTabs.MAIN) + .translation(translation + " Bucket")); } - private static RegiliteFluid baseFluid(String name, FluidType.Properties properties) { - return FLUID_TYPE_REGISTRY - .registerFluid(name, properties) - .withRenderType(() -> RenderType::translucent) - .createFluid(FLUID_REGISTRY) - .withBlock(BLOCK_REGISTRY, BlockBehaviour.Properties.ofFullCopy(Blocks.WATER)); + private static FluidTypeBuilder baseFluid(String name, FluidType.Properties properties) { + return FLUID_TYPES + .create(name, properties) + .renderType(() -> RenderType::translucent) + .block(BlockBehaviour.Properties.ofFullCopy(Blocks.WATER)); } - public static void register(IEventBus bus) { - FLUID_TYPE_REGISTRY.register(bus); - FLUID_REGISTRY.register(bus); - BLOCK_REGISTRY.register(bus); - ITEM_REGISTRY.register(bus); + public static void register() { } } diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java index e1ff89eac..d91f21eee 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java @@ -29,8 +29,8 @@ import com.enderio.base.common.tag.EIOTags; import com.enderio.base.data.model.item.GliderItemModel; import com.enderio.core.data.model.ModelHelper; -import com.enderio.regilite.holder.RegiliteItem; -import com.enderio.regilite.registry.ItemRegistry; +import com.enderio.regilite.items.ItemBuilder; +import com.enderio.regilite.items.RegiliteItems; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceKey; @@ -39,163 +39,205 @@ import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.registries.DeferredItem; import java.util.function.Function; @SuppressWarnings("unused") public class EIOItems { - private static final ItemRegistry ITEM_REGISTRY = EnderIOBase.REGILITE.itemRegistry(); + private static final RegiliteItems ITEMS = EnderIOBase.REGILITE.items(); // region Alloys - public static final RegiliteItem COPPER_ALLOY_INGOT = materialItem("copper_alloy_ingot").withTags(EIOTags.Items.INGOTS_COPPER_ALLOY); - public static final RegiliteItem ENERGETIC_ALLOY_INGOT = materialItem("energetic_alloy_ingot").withTags(EIOTags.Items.INGOTS_ENERGETIC_ALLOY); - public static final RegiliteItem VIBRANT_ALLOY_INGOT = materialItem("vibrant_alloy_ingot").withTags(EIOTags.Items.INGOTS_VIBRANT_ALLOY); - public static final RegiliteItem REDSTONE_ALLOY_INGOT = materialItem("redstone_alloy_ingot").withTags(EIOTags.Items.INGOTS_REDSTONE_ALLOY); - public static final RegiliteItem CONDUCTIVE_ALLOY_INGOT = materialItem("conductive_alloy_ingot").withTags(EIOTags.Items.INGOTS_CONDUCTIVE_ALLOY); - public static final RegiliteItem PULSATING_ALLOY_INGOT = materialItem("pulsating_alloy_ingot").withTags(EIOTags.Items.INGOTS_PULSATING_ALLOY); - public static final RegiliteItem DARK_STEEL_INGOT = materialItem("dark_steel_ingot").withTags(EIOTags.Items.INGOTS_DARK_STEEL); - public static final RegiliteItem SOULARIUM_INGOT = materialItem("soularium_ingot").withTags(EIOTags.Items.INGOTS_SOULARIUM); - public static final RegiliteItem END_STEEL_INGOT = materialItem("end_steel_ingot").withTags(EIOTags.Items.INGOTS_END_STEEL); - - public static final RegiliteItem COPPER_ALLOY_NUGGET = materialItem("copper_alloy_nugget").withTags(EIOTags.Items.NUGGETS_COPPER_ALLOY); - public static final RegiliteItem ENERGETIC_ALLOY_NUGGET = materialItem("energetic_alloy_nugget").withTags(EIOTags.Items.NUGGETS_ENERGETIC_ALLOY); - public static final RegiliteItem VIBRANT_ALLOY_NUGGET = materialItem("vibrant_alloy_nugget").withTags(EIOTags.Items.NUGGETS_VIBRANT_ALLOY); - public static final RegiliteItem REDSTONE_ALLOY_NUGGET = materialItem("redstone_alloy_nugget").withTags(EIOTags.Items.NUGGETS_REDSTONE_ALLOY); - public static final RegiliteItem CONDUCTIVE_ALLOY_NUGGET = materialItem("conductive_alloy_nugget").withTags(EIOTags.Items.NUGGETS_CONDUCTIVE_ALLOY); - public static final RegiliteItem PULSATING_ALLOY_NUGGET = materialItem("pulsating_alloy_nugget").withTags(EIOTags.Items.NUGGETS_PULSATING_ALLOY); - public static final RegiliteItem DARK_STEEL_NUGGET = materialItem("dark_steel_nugget").withTags(EIOTags.Items.NUGGETS_DARK_STEEL); - public static final RegiliteItem SOULARIUM_NUGGET = materialItem("soularium_nugget").withTags(EIOTags.Items.NUGGETS_SOULARIUM); - public static final RegiliteItem END_STEEL_NUGGET = materialItem("end_steel_nugget").withTags(EIOTags.Items.NUGGETS_END_STEEL); + public static final DeferredItem COPPER_ALLOY_INGOT = materialItem("copper_alloy_ingot").tags(EIOTags.Items.INGOTS_COPPER_ALLOY).finish(); + public static final DeferredItem ENERGETIC_ALLOY_INGOT = materialItem("energetic_alloy_ingot").tags(EIOTags.Items.INGOTS_ENERGETIC_ALLOY).finish(); + public static final DeferredItem VIBRANT_ALLOY_INGOT = materialItem("vibrant_alloy_ingot").tags(EIOTags.Items.INGOTS_VIBRANT_ALLOY).finish(); + public static final DeferredItem REDSTONE_ALLOY_INGOT = materialItem("redstone_alloy_ingot").tags(EIOTags.Items.INGOTS_REDSTONE_ALLOY).finish(); + public static final DeferredItem CONDUCTIVE_ALLOY_INGOT = materialItem("conductive_alloy_ingot").tags(EIOTags.Items.INGOTS_CONDUCTIVE_ALLOY).finish(); + public static final DeferredItem PULSATING_ALLOY_INGOT = materialItem("pulsating_alloy_ingot").tags(EIOTags.Items.INGOTS_PULSATING_ALLOY).finish(); + public static final DeferredItem DARK_STEEL_INGOT = materialItem("dark_steel_ingot").tags(EIOTags.Items.INGOTS_DARK_STEEL).finish(); + public static final DeferredItem SOULARIUM_INGOT = materialItem("soularium_ingot").tags(EIOTags.Items.INGOTS_SOULARIUM).finish(); + public static final DeferredItem END_STEEL_INGOT = materialItem("end_steel_ingot").tags(EIOTags.Items.INGOTS_END_STEEL).finish(); + + public static final DeferredItem COPPER_ALLOY_NUGGET = materialItem("copper_alloy_nugget").tags(EIOTags.Items.NUGGETS_COPPER_ALLOY).finish(); + public static final DeferredItem ENERGETIC_ALLOY_NUGGET = materialItem("energetic_alloy_nugget").tags(EIOTags.Items.NUGGETS_ENERGETIC_ALLOY).finish(); + public static final DeferredItem VIBRANT_ALLOY_NUGGET = materialItem("vibrant_alloy_nugget").tags(EIOTags.Items.NUGGETS_VIBRANT_ALLOY).finish(); + public static final DeferredItem REDSTONE_ALLOY_NUGGET = materialItem("redstone_alloy_nugget").tags(EIOTags.Items.NUGGETS_REDSTONE_ALLOY).finish(); + public static final DeferredItem CONDUCTIVE_ALLOY_NUGGET = materialItem("conductive_alloy_nugget").tags(EIOTags.Items.NUGGETS_CONDUCTIVE_ALLOY).finish(); + public static final DeferredItem PULSATING_ALLOY_NUGGET = materialItem("pulsating_alloy_nugget").tags(EIOTags.Items.NUGGETS_PULSATING_ALLOY).finish(); + public static final DeferredItem DARK_STEEL_NUGGET = materialItem("dark_steel_nugget").tags(EIOTags.Items.NUGGETS_DARK_STEEL).finish(); + public static final DeferredItem SOULARIUM_NUGGET = materialItem("soularium_nugget").tags(EIOTags.Items.NUGGETS_SOULARIUM).finish(); + public static final DeferredItem END_STEEL_NUGGET = materialItem("end_steel_nugget").tags(EIOTags.Items.NUGGETS_END_STEEL).finish(); // endregion // region Crafting Components - public static final RegiliteItem SILICON = materialItem("silicon").withTags(EIOTags.Items.SILICON); + public static final DeferredItem SILICON = materialItem("silicon") + .tags(EIOTags.Items.SILICON) + .finish(); - public static final RegiliteItem GRAINS_OF_INFINITY = materialItem("grains_of_infinity") - .withTags(EIOTags.Items.DUSTS_GRAINS_OF_INFINITY) - .withTranslation("Grains of Infinity"); + public static final DeferredItem GRAINS_OF_INFINITY = materialItem("grains_of_infinity") + .tags(EIOTags.Items.DUSTS_GRAINS_OF_INFINITY) + .translation("Grains of Infinity") + .finish(); - public static final RegiliteItem INFINITY_ROD = materialItem("infinity_rod"); + public static final DeferredItem INFINITY_ROD = materialItem("infinity_rod").finish(); - public static final RegiliteItem CONDUIT_BINDER_COMPOSITE = materialItem("conduit_binder_composite"); + public static final DeferredItem CONDUIT_BINDER_COMPOSITE = materialItem("conduit_binder_composite").finish(); - public static final RegiliteItem CONDUIT_BINDER = materialItem("conduit_binder"); + public static final DeferredItem CONDUIT_BINDER = materialItem("conduit_binder").finish(); - public static final RegiliteItem ZOMBIE_ELECTRODE = materialItem("zombie_electrode"); + public static final DeferredItem ZOMBIE_ELECTRODE = materialItem("zombie_electrode").finish(); - public static final RegiliteItem Z_LOGIC_CONTROLLER = materialItem("z_logic_controller") - .withTranslation("Z-Logic Controller"); + public static final DeferredItem Z_LOGIC_CONTROLLER = materialItem("z_logic_controller") + .translation("Z-Logic Controller") + .finish(); - public static final RegiliteItem FRANK_N_ZOMBIE = materialItemGlinted("frank_n_zombie") - .withTranslation("Frank'N'Zombie") - .setModelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.Z_LOGIC_CONTROLLER)); + public static final DeferredItem FRANK_N_ZOMBIE = materialItemGlinted("frank_n_zombie") + .translation("Frank'N'Zombie") + .modelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.Z_LOGIC_CONTROLLER)) + .finish(); - public static final RegiliteItem ENDER_RESONATOR = materialItem("ender_resonator"); + public static final DeferredItem ENDER_RESONATOR = materialItem("ender_resonator").finish(); - public static final RegiliteItem SENTIENT_ENDER = materialItemGlinted("sentient_ender") - .setModelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.ENDER_RESONATOR)); + public static final DeferredItem SENTIENT_ENDER = materialItemGlinted("sentient_ender") + .modelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.ENDER_RESONATOR)) + .finish(); - public static final RegiliteItem SKELETAL_CONTRACTOR = materialItem("skeletal_contractor"); - public static final RegiliteItem GUARDIAN_DIODE = materialItem("guardian_diode"); + public static final DeferredItem SKELETAL_CONTRACTOR = materialItem("skeletal_contractor").finish(); + public static final DeferredItem GUARDIAN_DIODE = materialItem("guardian_diode").finish(); // endregion // region Capacitors - public static final RegiliteItem BASIC_CAPACITOR = ITEM_REGISTRY - .registerItem("basic_capacitor", + public static final DeferredItem BASIC_CAPACITOR = ITEMS + .create("basic_capacitor", props -> new CapacitorItem( props.component(EIODataComponents.CAPACITOR_DATA, CapacitorData.simple(1))), new Item.Properties().stacksTo(1)) - .withTab(EIOCreativeTabs.MAIN); + .tab(EIOCreativeTabs.MAIN) + .finish(); - public static final RegiliteItem DOUBLE_LAYER_CAPACITOR = ITEM_REGISTRY - .registerItem("double_layer_capacitor", + public static final DeferredItem DOUBLE_LAYER_CAPACITOR = ITEMS + .create("double_layer_capacitor", props -> new CapacitorItem( props.component(EIODataComponents.CAPACITOR_DATA, CapacitorData.simple(2))), new Item.Properties().stacksTo(1)) - .withTab(EIOCreativeTabs.MAIN); + .tab(EIOCreativeTabs.MAIN) + .finish(); - public static final RegiliteItem OCTADIC_CAPACITOR = ITEM_REGISTRY - .registerItem("octadic_capacitor", + public static final DeferredItem OCTADIC_CAPACITOR = ITEMS + .create("octadic_capacitor", props -> new CapacitorItem( props.component(EIODataComponents.CAPACITOR_DATA, CapacitorData.simple(3))), new Item.Properties().stacksTo(1)) - .withTab(EIOCreativeTabs.MAIN); + .tab(EIOCreativeTabs.MAIN) + .finish(); - public static final RegiliteItem LOOT_CAPACITOR = ITEM_REGISTRY - .registerItem("loot_capacitor", LootCapacitorItem::new, new Item.Properties() - .stacksTo(1)); + public static final DeferredItem LOOT_CAPACITOR = ITEMS + .create("loot_capacitor", LootCapacitorItem::new, new Item.Properties() + .stacksTo(1)) + .finish(); // endregion // region Crystals - public static final RegiliteItem PULSATING_CRYSTAL = materialItemGlinted("pulsating_crystal").withTags(EIOTags.Items.GEMS_PULSATING_CRYSTAL); - public static final RegiliteItem VIBRANT_CRYSTAL = materialItemGlinted("vibrant_crystal").withTags(EIOTags.Items.GEMS_VIBRANT_CRYSTAL); - public static final RegiliteItem ENDER_CRYSTAL = materialItemGlinted("ender_crystal").withTags(EIOTags.Items.GEMS_ENDER_CRYSTAL); - public static final RegiliteItem ENTICING_CRYSTAL = materialItemGlinted("enticing_crystal").withTags(EIOTags.Items.GEMS_ENTICING_CRYSTAL); - public static final RegiliteItem WEATHER_CRYSTAL = materialItemGlinted("weather_crystal").withTags(EIOTags.Items.GEMS_WEATHER_CRYSTAL); - public static final RegiliteItem PRESCIENT_CRYSTAL = materialItemGlinted("prescient_crystal").withTags(EIOTags.Items.GEMS_PRESCIENT_CRYSTAL); + public static final DeferredItem PULSATING_CRYSTAL = materialItemGlinted("pulsating_crystal") + .tags(EIOTags.Items.GEMS_PULSATING_CRYSTAL) + .finish(); + + public static final DeferredItem VIBRANT_CRYSTAL = materialItemGlinted("vibrant_crystal") + .tags(EIOTags.Items.GEMS_VIBRANT_CRYSTAL) + .finish(); + + public static final DeferredItem ENDER_CRYSTAL = materialItemGlinted("ender_crystal") + .tags(EIOTags.Items.GEMS_ENDER_CRYSTAL) + .finish(); + + public static final DeferredItem ENTICING_CRYSTAL = materialItemGlinted("enticing_crystal") + .tags(EIOTags.Items.GEMS_ENTICING_CRYSTAL) + .finish(); + + public static final DeferredItem WEATHER_CRYSTAL = materialItemGlinted("weather_crystal") + .tags(EIOTags.Items.GEMS_WEATHER_CRYSTAL) + .finish(); + + public static final DeferredItem PRESCIENT_CRYSTAL = materialItemGlinted("prescient_crystal") + .tags(EIOTags.Items.GEMS_PRESCIENT_CRYSTAL) + .finish(); // endregion // region Powders and Fragments - public static final RegiliteItem FLOUR = materialItem("flour"); - public static final RegiliteItem POWDERED_COAL = materialItem("powdered_coal") - .withTags(EIOTags.Items.DUSTS_COAL); + public static final DeferredItem FLOUR = materialItem("flour").finish(); + public static final DeferredItem POWDERED_COAL = materialItem("powdered_coal") + .tags(EIOTags.Items.DUSTS_COAL) + .finish(); - public static final RegiliteItem POWDERED_IRON = materialItem("powdered_iron") - .withTags(EIOTags.Items.DUSTS_IRON); + public static final DeferredItem POWDERED_IRON = materialItem("powdered_iron") + .tags(EIOTags.Items.DUSTS_IRON) + .finish(); - public static final RegiliteItem POWDERED_GOLD = materialItem("powdered_gold") - .withTags(EIOTags.Items.DUSTS_GOLD); + public static final DeferredItem POWDERED_GOLD = materialItem("powdered_gold") + .tags(EIOTags.Items.DUSTS_GOLD) + .finish(); - public static final RegiliteItem POWDERED_COPPER = materialItem("powdered_copper") - .withTags(EIOTags.Items.DUSTS_COPPER); + public static final DeferredItem POWDERED_COPPER = materialItem("powdered_copper") + .tags(EIOTags.Items.DUSTS_COPPER) + .finish(); - public static final RegiliteItem POWDERED_TIN = materialItem("powdered_tin") - .withTags(EIOTags.Items.DUSTS_TIN); // TODO: hide if tin isn't present + public static final DeferredItem POWDERED_TIN = materialItem("powdered_tin") + .tags(EIOTags.Items.DUSTS_TIN) + .finish(); // TODO: hide if tin isn't present - public static final RegiliteItem POWDERED_ENDER_PEARL = materialItem("powdered_ender_pearl") - .withTags(EIOTags.Items.DUSTS_ENDER); + public static final DeferredItem POWDERED_ENDER_PEARL = materialItem("powdered_ender_pearl") + .tags(EIOTags.Items.DUSTS_ENDER) + .finish(); - public static final RegiliteItem POWDERED_OBSIDIAN = materialItem("powdered_obsidian") - .withTags(EIOTags.Items.DUSTS_OBSIDIAN); + public static final DeferredItem POWDERED_OBSIDIAN = materialItem("powdered_obsidian") + .tags(EIOTags.Items.DUSTS_OBSIDIAN) + .finish(); - public static final RegiliteItem POWDERED_COBALT = materialItem("powdered_cobalt") - .withTags(EIOTags.Items.DUSTS_COBALT); // TODO: hide if cobalt isnt present + public static final DeferredItem POWDERED_COBALT = materialItem("powdered_cobalt") + .tags(EIOTags.Items.DUSTS_COBALT) + .finish(); // TODO: hide if cobalt isnt present - public static final RegiliteItem POWDERED_LAPIS_LAZULI = materialItem("powdered_lapis_lazuli") - .withTags(EIOTags.Items.DUSTS_LAPIS); + public static final DeferredItem POWDERED_LAPIS_LAZULI = materialItem("powdered_lapis_lazuli") + .tags(EIOTags.Items.DUSTS_LAPIS) + .finish(); - public static final RegiliteItem POWDERED_QUARTZ = materialItem("powdered_quartz") - .withTags(EIOTags.Items.DUSTS_QUARTZ); + public static final DeferredItem POWDERED_QUARTZ = materialItem("powdered_quartz") + .tags(EIOTags.Items.DUSTS_QUARTZ) + .finish(); - public static final RegiliteItem PRESCIENT_POWDER = materialItemGlinted("prescient_powder") - .withTags(EIOTags.Items.DUSTS_GRAINS_OF_PRESCIENCE) - .withTranslation("Grains of Prescience"); + public static final DeferredItem PRESCIENT_POWDER = materialItemGlinted("prescient_powder") + .tags(EIOTags.Items.DUSTS_GRAINS_OF_PRESCIENCE) + .translation("Grains of Prescience") + .finish(); - public static final RegiliteItem VIBRANT_POWDER = materialItemGlinted("vibrant_powder") - .withTags(EIOTags.Items.DUSTS_GRAINS_OF_VIBRANCY) - .withTranslation("Grains of Vibrancy"); + public static final DeferredItem VIBRANT_POWDER = materialItemGlinted("vibrant_powder") + .tags(EIOTags.Items.DUSTS_GRAINS_OF_VIBRANCY) + .translation("Grains of Vibrancy") + .finish(); - public static final RegiliteItem PULSATING_POWDER = materialItemGlinted("pulsating_powder") - .withTags(EIOTags.Items.DUSTS_GRAINS_OF_PIZEALLITY) - .withTranslation("Grains of Piezallity"); + public static final DeferredItem PULSATING_POWDER = materialItemGlinted("pulsating_powder") + .tags(EIOTags.Items.DUSTS_GRAINS_OF_PIZEALLITY) + .translation("Grains of Piezallity") + .finish(); - public static final RegiliteItem ENDER_CRYSTAL_POWDER = materialItemGlinted("ender_crystal_powder") - .withTags(EIOTags.Items.DUSTS_GRAINS_OF_THE_END) - .withTranslation("Grains of the End"); + public static final DeferredItem ENDER_CRYSTAL_POWDER = materialItemGlinted("ender_crystal_powder") + .tags(EIOTags.Items.DUSTS_GRAINS_OF_THE_END) + .translation("Grains of the End") + .finish(); - public static final RegiliteItem PHOTOVOLTAIC_COMPOSITE = materialItem("photovoltaic_composite"); - public static final RegiliteItem SOUL_POWDER = materialItem("soul_powder"); - public static final RegiliteItem CONFUSION_POWDER = materialItem("confusing_powder"); - public static final RegiliteItem WITHERING_POWDER = materialItem("withering_powder"); + public static final DeferredItem PHOTOVOLTAIC_COMPOSITE = materialItem("photovoltaic_composite").finish(); + public static final DeferredItem SOUL_POWDER = materialItem("soul_powder").finish(); + public static final DeferredItem CONFUSION_POWDER = materialItem("confusing_powder").finish(); + public static final DeferredItem WITHERING_POWDER = materialItem("withering_powder").finish(); // endregion @@ -203,74 +245,86 @@ public class EIOItems { // region Gears - public static final RegiliteItem GEAR_WOOD = materialItem("wood_gear") - .withTranslation("Wooden Gear") - .withTags(EIOTags.Items.GEARS_WOOD); + public static final DeferredItem GEAR_WOOD = materialItem("wood_gear") + .translation("Wooden Gear") + .tags(EIOTags.Items.GEARS_WOOD) + .finish(); - public static final RegiliteItem GEAR_STONE = materialItem("stone_gear") - .withTranslation("Stone Compound Gear") - .withTags(EIOTags.Items.GEARS_STONE); + public static final DeferredItem GEAR_STONE = materialItem("stone_gear") + .translation("Stone Compound Gear") + .tags(EIOTags.Items.GEARS_STONE) + .finish(); - public static final RegiliteItem GEAR_IRON = materialItem("iron_gear") - .withTranslation("Infinity Bimetal Gear") - .withTags(EIOTags.Items.GEARS_IRON); + public static final DeferredItem GEAR_IRON = materialItem("iron_gear") + .translation("Infinity Bimetal Gear") + .tags(EIOTags.Items.GEARS_IRON) + .finish(); - public static final RegiliteItem GEAR_ENERGIZED = materialItem("energized_gear") - .withTranslation("Energized Bimetal Gear") - .withTags(EIOTags.Items.GEARS_ENERGIZED); + public static final DeferredItem GEAR_ENERGIZED = materialItem("energized_gear") + .translation("Energized Bimetal Gear") + .tags(EIOTags.Items.GEARS_ENERGIZED) + .finish(); - public static final RegiliteItem GEAR_VIBRANT = materialItem("vibrant_gear") - .withTranslation("Vibrant Bimetal Gear") - .withTags(EIOTags.Items.GEARS_VIBRANT); + public static final DeferredItem GEAR_VIBRANT = materialItem("vibrant_gear") + .translation("Vibrant Bimetal Gear") + .tags(EIOTags.Items.GEARS_VIBRANT) + .finish(); - public static final RegiliteItem GEAR_DARK_STEEL = materialItem("dark_bimetal_gear") - .withTranslation("Dark Bimetal Gear") - .withTags(EIOTags.Items.GEARS_DARK_STEEL); + public static final DeferredItem GEAR_DARK_STEEL = materialItem("dark_bimetal_gear") + .translation("Dark Bimetal Gear") + .tags(EIOTags.Items.GEARS_DARK_STEEL) + .finish(); // endregion // region Dyes - public static final RegiliteItem DYE_GREEN = materialItem("organic_green_dye") - .withTags(Tags.Items.DYES_GREEN, Tags.Items.DYES); + public static final DeferredItem DYE_GREEN = materialItem("organic_green_dye") + .tags(Tags.Items.DYES_GREEN, Tags.Items.DYES) + .finish(); - public static final RegiliteItem DYE_BROWN = materialItem("organic_brown_dye") - .withTags(Tags.Items.DYES_BROWN, Tags.Items.DYES); + public static final DeferredItem DYE_BROWN = materialItem("organic_brown_dye") + .tags(Tags.Items.DYES_BROWN, Tags.Items.DYES) + .finish(); - public static final RegiliteItem DYE_BLACK = materialItem("organic_black_dye") - .withTags(Tags.Items.DYES_BLACK, Tags.Items.DYES); + public static final DeferredItem DYE_BLACK = materialItem("organic_black_dye") + .tags(Tags.Items.DYES_BLACK, Tags.Items.DYES) + .finish(); // endregion // region Misc Materials - public static final RegiliteItem PHOTOVOLTAIC_PLATE = materialItem("photovoltaic_plate"); + public static final DeferredItem PHOTOVOLTAIC_PLATE = materialItem("photovoltaic_plate").finish(); - public static final RegiliteItem NUTRITIOUS_STICK = materialItem("nutritious_stick"); + public static final DeferredItem NUTRITIOUS_STICK = materialItem("nutritious_stick").finish(); - public static final RegiliteItem PLANT_MATTER_GREEN = materialItem("plant_matter_green") - .withTranslation("Clippings and Trimmings"); + public static final DeferredItem PLANT_MATTER_GREEN = materialItem("plant_matter_green") + .translation("Clippings and Trimmings") + .finish(); - public static final RegiliteItem PLANT_MATTER_BROWN = materialItem("plant_matter_brown") - .withTranslation("Twigs and Prunings"); + public static final DeferredItem PLANT_MATTER_BROWN = materialItem("plant_matter_brown") + .translation("Twigs and Prunings") + .finish(); - public static final RegiliteItem GLIDER_WING = materialItem("glider_wing"); + public static final DeferredItem GLIDER_WING = materialItem("glider_wing").finish(); - public static final RegiliteItem ANIMAL_TOKEN = materialItemGlinted("animal_token"); - public static final RegiliteItem MONSTER_TOKEN = materialItemGlinted("monster_token"); - public static final RegiliteItem PLAYER_TOKEN = materialItemGlinted("player_token"); - public static final RegiliteItem CAKE_BASE = materialItem("cake_base"); - public static final RegiliteItem BLACK_PAPER = materialItem("black_paper"); - public static final RegiliteItem CLAYED_GLOWSTONE = materialItem("clayed_glowstone"); - public static final RegiliteItem NETHERCOTTA = materialItem("nethercotta"); - public static final RegiliteItem REDSTONE_FILTER_BASE = materialItem("redstone_filter_base"); + public static final DeferredItem ANIMAL_TOKEN = materialItemGlinted("animal_token").finish(); + public static final DeferredItem MONSTER_TOKEN = materialItemGlinted("monster_token").finish(); + public static final DeferredItem PLAYER_TOKEN = materialItemGlinted("player_token").finish(); + public static final DeferredItem CAKE_BASE = materialItem("cake_base").finish(); + public static final DeferredItem BLACK_PAPER = materialItem("black_paper").finish(); + public static final DeferredItem CLAYED_GLOWSTONE = materialItem("clayed_glowstone").finish(); + public static final DeferredItem NETHERCOTTA = materialItem("nethercotta").finish(); + public static final DeferredItem REDSTONE_FILTER_BASE = materialItem("redstone_filter_base").finish(); - public static final RegiliteItem BROKEN_SPAWNER = ITEM_REGISTRY - .registerItem("broken_spawner", BrokenSpawnerItem::new) - .withTags(EIOTags.Items.ENTITY_STORAGE) - .setModelProvider(ModelHelper::fakeBlockModel) - .withTab(EIOCreativeTabs.MAIN) - .withTab(EIOCreativeTabs.SOULS, modifier -> modifier.acceptAll(BrokenSpawnerItem.getPossibleStacks())); + public static final DeferredItem BROKEN_SPAWNER = ITEMS + .create("broken_spawner", BrokenSpawnerItem::new) + .tags(EIOTags.Items.ENTITY_STORAGE) + .modelProvider(ModelHelper::fakeBlockModel) + .tab(EIOCreativeTabs.MAIN) + .tab(EIOCreativeTabs.SOULS, modifier -> modifier.acceptAll(BrokenSpawnerItem.getPossibleStacks())) + .finish(); // endregion @@ -278,35 +332,35 @@ public class EIOItems { // TODO: 20.6: Config for grinding balls? - public static final RegiliteItem SOULARIUM_BALL = grindingBall("soularium_grinding_ball", + public static final DeferredItem SOULARIUM_BALL = grindingBall("soularium_grinding_ball", new GrindingBallData(1.2F, 2.15F, 0.9F, 80000)); - public static final RegiliteItem CONDUCTIVE_ALLOY_BALL = grindingBall("conductive_alloy_grinding_ball", + public static final DeferredItem CONDUCTIVE_ALLOY_BALL = grindingBall("conductive_alloy_grinding_ball", new GrindingBallData(1.35F, 1.00F, 1.0F, 40000)); - public static final RegiliteItem PULSATING_ALLOY_BALL = grindingBall("pulsating_alloy_grinding_ball", + public static final DeferredItem PULSATING_ALLOY_BALL = grindingBall("pulsating_alloy_grinding_ball", new GrindingBallData(1.00F, 1.85F, 1.0F, 100000)); - public static final RegiliteItem REDSTONE_ALLOY_BALL = grindingBall("redstone_alloy_grinding_ball", + public static final DeferredItem REDSTONE_ALLOY_BALL = grindingBall("redstone_alloy_grinding_ball", new GrindingBallData(1.00F, 1.00F, 0.35F, 30000)); - public static final RegiliteItem ENERGETIC_ALLOY_BALL = grindingBall("energetic_alloy_grinding_ball", + public static final DeferredItem ENERGETIC_ALLOY_BALL = grindingBall("energetic_alloy_grinding_ball", new GrindingBallData(1.6F, 1.1F, 1.1F, 80000)); - public static final RegiliteItem VIBRANT_ALLOY_BALL = grindingBall("vibrant_alloy_grinding_ball", + public static final DeferredItem VIBRANT_ALLOY_BALL = grindingBall("vibrant_alloy_grinding_ball", new GrindingBallData(1.75F, 1.35F, 1.13F, 80000)); - public static final RegiliteItem COPPER_ALLOY_BALL = grindingBall("copper_alloy_grinding_ball", + public static final DeferredItem COPPER_ALLOY_BALL = grindingBall("copper_alloy_grinding_ball", new GrindingBallData(1.2F, 1.65F, 0.8F, 40000)); - public static final RegiliteItem DARK_STEEL_BALL = grindingBall("dark_steel_grinding_ball", + public static final DeferredItem DARK_STEEL_BALL = grindingBall("dark_steel_grinding_ball", new GrindingBallData(1.35F, 2.00F, 0.7F, 125000)); - public static final RegiliteItem END_STEEL_BALL = grindingBall("end_steel_grinding_ball", + public static final DeferredItem END_STEEL_BALL = grindingBall("end_steel_grinding_ball", new GrindingBallData(1.4F, 2.4F, 0.7F, 75000)); - // public static final Map> COLORED_HANG_GLIDERS = Util.make(() -> { - // Map> tempMap = new EnumMap<>(DyeColor.class); + // public static final Map> COLORED_HANG_GLIDERS = Util.make(() -> { + // Map> tempMap = new EnumMap<>(DyeColor.class); // for (DyeColor color: DyeColor.values()) { // var entry = gliderItem(color.getName() + "_glider"); // tempMap.put(color, entry); @@ -314,123 +368,139 @@ public class EIOItems { // return tempMap; // }); - // public static final RegiliteItem GLIDER = gliderItem("glider"); + // public static final DeferredItem GLIDER = gliderItem("glider"); - private static RegiliteItem grindingBall(String name, GrindingBallData grindingBallData) { - return ITEM_REGISTRY - .registerItem(name, props -> new MaterialItem( + private static DeferredItem grindingBall(String name, GrindingBallData grindingBallData) { + return ITEMS + .create(name, props -> new MaterialItem( props .component(EIODataComponents.GRINDING_BALL, grindingBallData), false)) - .withTags(EIOTags.Items.GRINDING_BALLS) - .withTab(EIOCreativeTabs.MAIN); + .tags(EIOTags.Items.GRINDING_BALLS) + .tab(EIOCreativeTabs.MAIN) + .finish(); } // endregion // region Builders - private static RegiliteItem gliderItem(String name) { + private static DeferredItem gliderItem(String name) { return dumbItem(name, HangGliderItem::new) - .withTags(EIOTags.Items.GLIDER) - .withTab(EIOCreativeTabs.MAIN) - .setModelProvider((prov, ctx) -> GliderItemModel.create(ctx.get(), prov)); + .tags(EIOTags.Items.GLIDER) + .tab(EIOCreativeTabs.MAIN) + .modelProvider((prov, ctx) -> GliderItemModel.create(ctx.get(), prov)) + .finish(); } - private static RegiliteItem materialItem(String name) { - return ITEM_REGISTRY - .registerItem(name, props -> new MaterialItem(props, false)) - .withTab(EIOCreativeTabs.MAIN); + private static ItemBuilder materialItem(String name) { + return ITEMS + .create(name, props -> new MaterialItem(props, false)) + .tab(EIOCreativeTabs.MAIN); } - private static RegiliteItem materialItemGlinted(String name) { - return ITEM_REGISTRY - .registerItem(name, props -> new MaterialItem(props, true)) - .withTab(EIOCreativeTabs.MAIN); + private static ItemBuilder materialItemGlinted(String name) { + return ITEMS + .create(name, props -> new MaterialItem(props, true)) + .tab(EIOCreativeTabs.MAIN); } // endregion // region Items - public static final RegiliteItem EMPTY_SOUL_VIAL = groupedItem("empty_soul_vial", SoulVialItem::new, EIOCreativeTabs.SOULS); + public static final DeferredItem EMPTY_SOUL_VIAL = groupedItem("empty_soul_vial", SoulVialItem::new, EIOCreativeTabs.SOULS).finish(); - public static final RegiliteItem FILLED_SOUL_VIAL = ITEM_REGISTRY - .registerItem("filled_soul_vial", SoulVialItem::new, new Item.Properties().stacksTo(1)) - .withTags(EIOTags.Items.ENTITY_STORAGE) - .withTab(EIOCreativeTabs.SOULS, modifier -> modifier.acceptAll(SoulVialItem.getAllFilled(), CreativeModeTab.TabVisibility.PARENT_TAB_ONLY)); + public static final DeferredItem FILLED_SOUL_VIAL = ITEMS + .create("filled_soul_vial", SoulVialItem::new, new Item.Properties().stacksTo(1)) + .tags(EIOTags.Items.ENTITY_STORAGE) + .tab(EIOCreativeTabs.SOULS, modifier -> modifier.acceptAll(SoulVialItem.getAllFilled(), CreativeModeTab.TabVisibility.PARENT_TAB_ONLY)) + .finish(); - public static final RegiliteItem ENDERIOS = ITEM_REGISTRY - .registerItem("enderios", EnderiosItem::new, new Item.Properties().stacksTo(1)) - .withTab(EIOCreativeTabs.MAIN) - .withTranslation("\"Enderios\""); + public static final DeferredItem ENDERIOS = ITEMS + .create("enderios", EnderiosItem::new, new Item.Properties().stacksTo(1)) + .tab(EIOCreativeTabs.MAIN) + .translation("\"Enderios\"") + .finish(); // endregion // region Tools - public static final RegiliteItem YETA_WRENCH = ITEM_REGISTRY - .registerItem("yeta_wrench", YetaWrenchItem::new, new Item.Properties().stacksTo(1)) - .withTab(EIOCreativeTabs.GEAR) - .withTags(EIOTags.Items.WRENCH); - - public static final RegiliteItem LOCATION_PRINTOUT = ITEM_REGISTRY - .registerItem("location_printout", LocationPrintoutItem::new, new Item.Properties().stacksTo(1)) - .withTab(EIOCreativeTabs.GEAR); - - public static final RegiliteItem COORDINATE_SELECTOR = ITEM_REGISTRY - .registerItem("coordinate_selector", CoordinateSelectorItem::new, new Item.Properties().stacksTo(1)) - .withTab(EIOCreativeTabs.GEAR); - - public static final RegiliteItem EXPERIENCE_ROD = ITEM_REGISTRY - .registerItem("experience_rod", ExperienceRodItem::new) - .withTab(EIOCreativeTabs.GEAR); - - public static final RegiliteItem LEVITATION_STAFF = ITEM_REGISTRY - .registerItem("staff_of_levity", LevitationStaffItem::new) - .withTab(EIOCreativeTabs.GEAR, modifier -> EIOItems.LEVITATION_STAFF.get().addAllVariants(modifier)) - .withCapability(Capabilities.FluidHandler.ITEM, LevitationStaffItem.FLUID_HANDLER_PROVIDER) - .with(EIOItems::poweredToggledItemCapabilities); - - public static final RegiliteItem TRAVEL_STAFF = ITEM_REGISTRY - .registerItem("staff_of_travelling", TravelStaffItem::new, new Item.Properties().stacksTo(1)) - .withTab(EIOCreativeTabs.GEAR, modifier -> EIOItems.TRAVEL_STAFF.get().addAllVariants(modifier)) - .withCapability(Capabilities.EnergyStorage.ITEM, TravelStaffItem.ENERGY_STORAGE_PROVIDER); - - public static final RegiliteItem ELECTROMAGNET = ITEM_REGISTRY - .registerItem("electromagnet", ElectromagnetItem::new) - .withTab(EIOCreativeTabs.GEAR, modifier -> EIOItems.ELECTROMAGNET.get().addAllVariants(modifier)) - .with(EIOItems::poweredToggledItemCapabilities); - - public static final RegiliteItem COLD_FIRE_IGNITER = ITEM_REGISTRY - .registerItem("cold_fire_igniter", ColdFireIgniter::new) - .withTab(EIOCreativeTabs.GEAR, + public static final DeferredItem YETA_WRENCH = ITEMS + .create("yeta_wrench", YetaWrenchItem::new, new Item.Properties().stacksTo(1)) + .tab(EIOCreativeTabs.GEAR) + .tags(EIOTags.Items.WRENCH) + .finish(); + + public static final DeferredItem LOCATION_PRINTOUT = ITEMS + .create("location_printout", LocationPrintoutItem::new, new Item.Properties().stacksTo(1)) + .tab(EIOCreativeTabs.GEAR) + .finish(); + + public static final DeferredItem COORDINATE_SELECTOR = ITEMS + .create("coordinate_selector", CoordinateSelectorItem::new, new Item.Properties().stacksTo(1)) + .tab(EIOCreativeTabs.GEAR) + .finish(); + + public static final DeferredItem EXPERIENCE_ROD = ITEMS + .create("experience_rod", ExperienceRodItem::new) + .tab(EIOCreativeTabs.GEAR) + .finish(); + + public static final DeferredItem LEVITATION_STAFF = ITEMS + .create("staff_of_levity", LevitationStaffItem::new) + .tab(EIOCreativeTabs.GEAR, modifier -> EIOItems.LEVITATION_STAFF.get().addAllVariants(modifier)) + .capability(Capabilities.FluidHandler.ITEM, LevitationStaffItem.FLUID_HANDLER_PROVIDER) + .with(EIOItems::poweredToggledItemCapabilities) + .finish(); + + public static final DeferredItem TRAVEL_STAFF = ITEMS + .create("staff_of_travelling", TravelStaffItem::new, new Item.Properties().stacksTo(1)) + .tab(EIOCreativeTabs.GEAR, modifier -> EIOItems.TRAVEL_STAFF.get().addAllVariants(modifier)) + .capability(Capabilities.EnergyStorage.ITEM, TravelStaffItem.ENERGY_STORAGE_PROVIDER) + .finish(); + + public static final DeferredItem ELECTROMAGNET = ITEMS + .create("electromagnet", ElectromagnetItem::new) + .tab(EIOCreativeTabs.GEAR, modifier -> EIOItems.ELECTROMAGNET.get().addAllVariants(modifier)) + .with(EIOItems::poweredToggledItemCapabilities) + .finish(); + + public static final DeferredItem COLD_FIRE_IGNITER = ITEMS + .create("cold_fire_igniter", ColdFireIgniter::new) + .tab(EIOCreativeTabs.GEAR, modifier -> EIOItems.COLD_FIRE_IGNITER.get().addAllVariants(modifier)) // TODO: Might PR this to ITEM_REGISTRY so its nicer, but I like the footprint. - .withCapability(Capabilities.FluidHandler.ITEM, ColdFireIgniter.FLUID_HANDLER_PROVIDER); + .capability(Capabilities.FluidHandler.ITEM, ColdFireIgniter.FLUID_HANDLER_PROVIDER) + .finish(); // endregion // region filter - public static final RegiliteItem BASIC_ITEM_FILTER = ITEM_REGISTRY - .registerItem("basic_filter", properties -> new ItemFilter(properties.component(EIODataComponents.ITEM_FILTER, new ItemFilterCapability.Component(5)))) - .withTab(EIOCreativeTabs.GEAR) - .withCapability(EIOCapabilities.Filter.ITEM, ItemFilter.FILTER_PROVIDER); - - public static final RegiliteItem ADVANCED_ITEM_FILTER = ITEM_REGISTRY - .registerItem("advanced_filter", properties -> new ItemFilter(properties.component(EIODataComponents.ITEM_FILTER, new ItemFilterCapability.Component(10)))) - .withTab(EIOCreativeTabs.GEAR) - .withCapability(EIOCapabilities.Filter.ITEM, ItemFilter.FILTER_PROVIDER); - - public static final RegiliteItem BASIC_FLUID_FILTER = ITEM_REGISTRY - .registerItem("fluid_filter", properties -> new FluidFilter(properties.component(EIODataComponents.FLUID_FILTER, new FluidFilterCapability.Component(5)))) - .withTab(EIOCreativeTabs.GEAR) - .withCapability(EIOCapabilities.Filter.ITEM, FluidFilter.FILTER_PROVIDER); - - public static final RegiliteItem ENTITY_FILTER = ITEM_REGISTRY - .registerItem("entity_filter", properties -> new EntityFilter(properties.component(EIODataComponents.ENTITY_FILTER, new EntityFilterCapability.Component(5)))) - .withTranslation("Soul Filter") - .withTab(EIOCreativeTabs.GEAR) - .withCapability(EIOCapabilities.Filter.ITEM, EntityFilter.ENTITY_FILTER); + public static final DeferredItem BASIC_ITEM_FILTER = ITEMS + .create("basic_filter", properties -> new ItemFilter(properties.component(EIODataComponents.ITEM_FILTER, new ItemFilterCapability.Component(5)))) + .tab(EIOCreativeTabs.GEAR) + .capability(EIOCapabilities.Filter.ITEM, ItemFilter.FILTER_PROVIDER) + .finish(); + + public static final DeferredItem ADVANCED_ITEM_FILTER = ITEMS + .create("advanced_filter", properties -> new ItemFilter(properties.component(EIODataComponents.ITEM_FILTER, new ItemFilterCapability.Component(10)))) + .tab(EIOCreativeTabs.GEAR) + .capability(EIOCapabilities.Filter.ITEM, ItemFilter.FILTER_PROVIDER) + .finish(); + + public static final DeferredItem BASIC_FLUID_FILTER = ITEMS + .create("fluid_filter", properties -> new FluidFilter(properties.component(EIODataComponents.FLUID_FILTER, new FluidFilterCapability.Component(5)))) + .tab(EIOCreativeTabs.GEAR) + .capability(EIOCapabilities.Filter.ITEM, FluidFilter.FILTER_PROVIDER) + .finish(); + + public static final DeferredItem ENTITY_FILTER = ITEMS + .create("entity_filter", properties -> new EntityFilter(properties.component(EIODataComponents.ENTITY_FILTER, new EntityFilterCapability.Component(5)))) + .translation("Soul Filter") + .tab(EIOCreativeTabs.GEAR) + .capability(EIOCapabilities.Filter.ITEM, EntityFilter.ENTITY_FILTER) + .finish(); // endregion @@ -446,37 +516,36 @@ public static MutableComponent capacitorDescriptionBuilder(String type, String v // region Creative Tab Icons - public static final RegiliteItem CREATIVE_ICON_NONE = dumbItem("enderface_none", CreativeTabIconItem::new); - public static final RegiliteItem CREATIVE_ICON_ITEMS = dumbItem("enderface_items", CreativeTabIconItem::new); - public static final RegiliteItem CREATIVE_ICON_MATERIALS = dumbItem("enderface_materials", CreativeTabIconItem::new); - public static final RegiliteItem CREATIVE_ICON_MACHINES = dumbItem("enderface_machines", CreativeTabIconItem::new); - public static final RegiliteItem CREATIVE_ICON_CONDUITS = dumbItem("enderface_conduits", CreativeTabIconItem::new); - public static final RegiliteItem CREATIVE_ICON_MOBS = dumbItem("enderface_mobs", CreativeTabIconItem::new); - public static final RegiliteItem CREATIVE_ICON_INVPANEL = dumbItem("enderface_invpanel", CreativeTabIconItem::new); + public static final DeferredItem CREATIVE_ICON_NONE = dumbItem("enderface_none", CreativeTabIconItem::new).finish(); + public static final DeferredItem CREATIVE_ICON_ITEMS = dumbItem("enderface_items", CreativeTabIconItem::new).finish(); + public static final DeferredItem CREATIVE_ICON_MATERIALS = dumbItem("enderface_materials", CreativeTabIconItem::new).finish(); + public static final DeferredItem CREATIVE_ICON_MACHINES = dumbItem("enderface_machines", CreativeTabIconItem::new).finish(); + public static final DeferredItem CREATIVE_ICON_CONDUITS = dumbItem("enderface_conduits", CreativeTabIconItem::new).finish(); + public static final DeferredItem CREATIVE_ICON_MOBS = dumbItem("enderface_mobs", CreativeTabIconItem::new).finish(); + public static final DeferredItem CREATIVE_ICON_INVPANEL = dumbItem("enderface_invpanel", CreativeTabIconItem::new).finish(); // endregion // region Helpers - public static RegiliteItem dumbItem(String name, Function factory) { - return ITEM_REGISTRY.registerItem(name, factory); + public static ItemBuilder dumbItem(String name, Function factory) { + return ITEMS.create(name, factory); } - public static RegiliteItem dumbItem(String name) { - return ITEM_REGISTRY.registerItem(name); + public static ItemBuilder dumbItem(String name) { + return ITEMS.createSimple(name); } - public static RegiliteItem groupedItem(String name, Function factory, ResourceKey tab) { - return ITEM_REGISTRY.registerItem(name, factory).withTab(tab); + public static ItemBuilder groupedItem(String name, Function factory, ResourceKey tab) { + return ITEMS.create(name, factory).tab(tab); } - private static void poweredToggledItemCapabilities(RegiliteItem item) { - item.withCapability(Capabilities.EnergyStorage.ITEM, PoweredToggledItem.ENERGY_STORAGE_PROVIDER); + private static ItemBuilder poweredToggledItemCapabilities(ItemBuilder item) { + return item.capability(Capabilities.EnergyStorage.ITEM, PoweredToggledItem.ENERGY_STORAGE_PROVIDER); } // endregion - public static void register(IEventBus bus) { - ITEM_REGISTRY.register(bus); + public static void register() { } } diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOMenus.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOMenus.java index 6dce7cb64..3428b7a5f 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOMenus.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOMenus.java @@ -9,27 +9,30 @@ import com.enderio.base.common.menu.EntityFilterMenu; import com.enderio.base.common.menu.FluidFilterMenu; import com.enderio.base.common.menu.ItemFilterMenu; -import com.enderio.regilite.holder.RegiliteMenu; -import com.enderio.regilite.registry.MenuRegistry; -import net.neoforged.bus.api.IEventBus; +import com.enderio.regilite.menus.RegiliteMenus; +import net.minecraft.world.inventory.MenuType; -public class EIOMenus { - private static final MenuRegistry MENU_REGISTRY = EnderIOBase.REGILITE.menuRegistry(); +import java.util.function.Supplier; - public static final RegiliteMenu COORDINATE = MENU_REGISTRY - .registerMenu("coordinate", CoordinateMenu::factory, () -> CoordinateMenuScreen::new); +public class EIOMenus { + private static final RegiliteMenus MENUS = EnderIOBase.REGILITE.menus(); - public static final RegiliteMenu ITEM_FILTER = MENU_REGISTRY - .registerMenu("item_filter", ItemFilterMenu::factory, () -> ItemFilterScreen::new); + public static final Supplier> COORDINATE = MENUS + .create("coordinate", CoordinateMenu::factory, () -> CoordinateMenuScreen::new) + .finish(); - public static final RegiliteMenu FLUID_FILTER = MENU_REGISTRY - .registerMenu("fluid_filter", FluidFilterMenu::factory, () -> FluidFilterScreen::new); + public static final Supplier> ITEM_FILTER = MENUS + .create("item_filter", ItemFilterMenu::factory, () -> ItemFilterScreen::new) + .finish(); - public static final RegiliteMenu ENTITY_FILTER = MENU_REGISTRY - .registerMenu("entity_filter", EntityFilterMenu::factory, () -> EntityFilterScreen::new); + public static final Supplier> FLUID_FILTER = MENUS + .create("fluid_filter", FluidFilterMenu::factory, () -> FluidFilterScreen::new) + .finish(); + public static final Supplier> ENTITY_FILTER = MENUS + .create("entity_filter", EntityFilterMenu::factory, () -> EntityFilterScreen::new) + .finish(); - public static void register(IEventBus eventBus) { - MENU_REGISTRY.register(eventBus); + public static void register() { } } diff --git a/enderio-base/src/main/java/com/enderio/base/common/integrations/jei/category/FireCraftingCategory.java b/enderio-base/src/main/java/com/enderio/base/common/integrations/jei/category/FireCraftingCategory.java index c04e959c2..f84fae278 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/integrations/jei/category/FireCraftingCategory.java +++ b/enderio-base/src/main/java/com/enderio/base/common/integrations/jei/category/FireCraftingCategory.java @@ -141,7 +141,7 @@ public void setRecipe(IRecipeLayoutBuilder builder, RecipeHolder 0) { player.giveExperiencePoints(-takenVolume / ExperienceUtil.EXP_TO_FLUID); diff --git a/enderio-base/src/main/java/com/enderio/base/common/item/tool/LevitationStaffItem.java b/enderio-base/src/main/java/com/enderio/base/common/item/tool/LevitationStaffItem.java index 9c9601913..dd5cff2b7 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/item/tool/LevitationStaffItem.java +++ b/enderio-base/src/main/java/com/enderio/base/common/item/tool/LevitationStaffItem.java @@ -69,7 +69,7 @@ protected void setFullCharge(ItemStack pStack) { var fluidHandler = pStack.getCapability(Capabilities.FluidHandler.ITEM); if (fluidHandler != null) { if (fluidHandler instanceof StrictFluidHandlerItemStack strictFluidHandlerItemStack) { - strictFluidHandlerItemStack.setFluid(new FluidStack(EIOFluids.VAPOR_OF_LEVITY.getSource(), fluidHandler.getTankCapacity(0))); + strictFluidHandlerItemStack.setFluid(new FluidStack(EIOFluids.VAPOR_OF_LEVITY.sourceFluid(), fluidHandler.getTankCapacity(0))); } } } diff --git a/enderio-base/src/main/java/com/enderio/base/common/lang/EIOEnumLang.java b/enderio-base/src/main/java/com/enderio/base/common/lang/EIOEnumLang.java index 26da01122..3409dd02c 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/lang/EIOEnumLang.java +++ b/enderio-base/src/main/java/com/enderio/base/common/lang/EIOEnumLang.java @@ -33,8 +33,7 @@ private static > EnumTranslationMap.Builder builder(Class Date: Mon, 30 Sep 2024 16:21:16 +0100 Subject: [PATCH 5/7] chore: Added DeferredBlockEntityType to simplify BE creation again --- .../base/common/block/light/LightNode.java | 2 +- .../base/common/block/light/PoweredLight.java | 2 +- .../common/block/skull/EnderSkullBlock.java | 2 +- .../block/skull/WallEnderSkullBlock.java | 2 +- .../base/common/init/EIOBlockEntities.java | 14 +++++------ .../enderio/base/common/init/EIOFluids.java | 23 +++++++++---------- .../block/PaintedCraftingTableBlock.java | 2 +- .../common/paint/block/PaintedFenceBlock.java | 2 +- .../paint/block/PaintedFenceGateBlock.java | 2 +- .../paint/block/PaintedRedstoneBlock.java | 2 +- .../common/paint/block/PaintedSandBlock.java | 2 +- .../common/paint/block/PaintedSlabBlock.java | 2 +- .../common/paint/block/PaintedStairBlock.java | 2 +- .../paint/block/PaintedTrapDoorBlock.java | 2 +- .../common/paint/block/PaintedWallBlock.java | 2 +- .../PaintedWoodenPressurePlateBlock.java | 2 +- .../paint/block/SinglePaintedBlock.java | 2 +- gradle.properties | 2 +- 18 files changed, 33 insertions(+), 36 deletions(-) diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/light/LightNode.java b/enderio-base/src/main/java/com/enderio/base/common/block/light/LightNode.java index 29652e2e8..bc0ec8a7e 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/light/LightNode.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/light/LightNode.java @@ -32,7 +32,7 @@ public RenderShape getRenderShape(BlockState state) { @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.LIGHT_NODE.get().create(pos, state); + return EIOBlockEntities.LIGHT_NODE.create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/light/PoweredLight.java b/enderio-base/src/main/java/com/enderio/base/common/block/light/PoweredLight.java index 4b68070fa..f1d1b13b2 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/light/PoweredLight.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/light/PoweredLight.java @@ -48,7 +48,7 @@ public boolean isWireless() { @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.POWERED_LIGHT.get().create(pos, state); + return EIOBlockEntities.POWERED_LIGHT.create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/skull/EnderSkullBlock.java b/enderio-base/src/main/java/com/enderio/base/common/block/skull/EnderSkullBlock.java index 97db68ac6..239835ebe 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/skull/EnderSkullBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/skull/EnderSkullBlock.java @@ -30,7 +30,7 @@ public String getSerializedName() { @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.ENDER_SKULL.get().create(pos, state); + return EIOBlockEntities.ENDER_SKULL.create(pos, state); } @Nullable diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/skull/WallEnderSkullBlock.java b/enderio-base/src/main/java/com/enderio/base/common/block/skull/WallEnderSkullBlock.java index 1de731923..277796df5 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/skull/WallEnderSkullBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/skull/WallEnderSkullBlock.java @@ -18,7 +18,7 @@ public WallEnderSkullBlock(Properties properties) { @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.ENDER_SKULL.get().create(pos, state); + return EIOBlockEntities.ENDER_SKULL.create(pos, state); } @Nullable diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java index fcec05194..f5a2278b8 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java @@ -6,15 +6,13 @@ import com.enderio.base.common.blockentity.PoweredLightBlockEntity; import com.enderio.base.common.paint.blockentity.DoublePaintedBlockEntity; import com.enderio.base.common.paint.blockentity.SinglePaintedBlockEntity; +import com.enderio.regilite.blockentities.DeferredBlockEntityType; import com.enderio.regilite.blockentities.RegiliteBlockEntities; -import net.minecraft.world.level.block.entity.BlockEntityType; - -import java.util.function.Supplier; public class EIOBlockEntities { private static final RegiliteBlockEntities BLOCK_ENTITIES = EnderIOBase.REGILITE.blockEntities(); - public static final Supplier> SINGLE_PAINTED = BLOCK_ENTITIES + public static final DeferredBlockEntityType SINGLE_PAINTED = BLOCK_ENTITIES .create("single_painted", SinglePaintedBlockEntity::new, EIOBlocks.PAINTED_FENCE, @@ -28,10 +26,10 @@ public class EIOBlockEntities { EIOBlocks.PAINTED_GLOWSTONE, EIOBlocks.PAINTED_WALL).finish(); - public static final Supplier> DOUBLE_PAINTED = BLOCK_ENTITIES + public static final DeferredBlockEntityType DOUBLE_PAINTED = BLOCK_ENTITIES .create("double_painted", DoublePaintedBlockEntity::new, EIOBlocks.PAINTED_SLAB).finish(); - public static final Supplier> POWERED_LIGHT = BLOCK_ENTITIES + public static final DeferredBlockEntityType POWERED_LIGHT = BLOCK_ENTITIES .create("powered_light", PoweredLightBlockEntity::new, EIOBlocks.POWERED_LIGHT, @@ -40,10 +38,10 @@ public class EIOBlockEntities { EIOBlocks.POWERED_LIGHT_INVERTED_WIRELESS) .finish(); - public static final Supplier> LIGHT_NODE = BLOCK_ENTITIES + public static final DeferredBlockEntityType LIGHT_NODE = BLOCK_ENTITIES .create("light_node", LightNodeBlockEntity::new, EIOBlocks.LIGHT_NODE).finish(); - public static final Supplier> ENDER_SKULL = BLOCK_ENTITIES + public static final DeferredBlockEntityType ENDER_SKULL = BLOCK_ENTITIES .create("ender_skull", EnderSkullBlockEntity::new, EIOBlocks.WALL_ENDERMAN_HEAD, EIOBlocks.ENDERMAN_HEAD).finish(); public static void register() { diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java index 75eb71392..e69762dde 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOFluids.java @@ -2,13 +2,12 @@ import com.enderio.EnderIOBase; import com.enderio.base.common.tag.EIOTags; +import com.enderio.regilite.fluids.DeferredFluidType; import com.enderio.regilite.fluids.FluidTypeBuilder; -import com.enderio.regilite.fluids.FluidTypeHolder; import com.enderio.regilite.fluids.RegiliteFluidTypes; import net.minecraft.client.renderer.RenderType; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockBehaviour; -import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.fluids.FluidType; // TODO: Fluid behaviours and some cleaning. https://github.com/SleepyTrousers/EnderIO-Rewrite/issues/34 @@ -19,36 +18,36 @@ public class EIOFluids { private static final RegiliteFluidTypes FLUID_TYPES = EnderIOBase.REGILITE.fluidTypes(); - public static final FluidTypeHolder NUTRIENT_DISTILLATION = + public static final DeferredFluidType NUTRIENT_DISTILLATION = fluid("nutrient_distillation", "Nutrient Distillation", FluidType.Properties.create().density(1500).viscosity(3000)).finish(); - public static final FluidTypeHolder DEW_OF_THE_VOID = + public static final DeferredFluidType DEW_OF_THE_VOID = fluid("dew_of_the_void", "Fluid of the Void", FluidType.Properties.create().density(200).viscosity(1000).temperature(175)).finish(); - public static final FluidTypeHolder VAPOR_OF_LEVITY = + public static final DeferredFluidType VAPOR_OF_LEVITY = gasFluid("vapor_of_levity", "Vapor of Levity", FluidType.Properties.create().density(-10).viscosity(100).temperature(5)).finish(); - public static final FluidTypeHolder HOOTCH = + public static final DeferredFluidType HOOTCH = fluid("hootch", "Hootch", FluidType.Properties.create().density(900).viscosity(1000)).finish(); - public static final FluidTypeHolder ROCKET_FUEL = + public static final DeferredFluidType ROCKET_FUEL = fluid("rocket_fuel", "Rocket Fuel", FluidType.Properties.create().density(900).viscosity(1000)).finish(); - public static final FluidTypeHolder FIRE_WATER = + public static final DeferredFluidType FIRE_WATER = fluid("fire_water", "Fire Water", FluidType.Properties.create().density(900).viscosity(1000).temperature(2000)).finish(); - public static final FluidTypeHolder XP_JUICE = + public static final DeferredFluidType XP_JUICE = fluid("xp_juice", "XP Juice", FluidType.Properties.create().lightLevel(10).density(800).viscosity(1500)) .tag(EIOTags.Fluids.EXPERIENCE).finish(); - public static final FluidTypeHolder LIQUID_SUNSHINE = + public static final DeferredFluidType LIQUID_SUNSHINE = fluid("liquid_sunshine", "Liquid Sunshine", FluidType.Properties.create().density(200).viscosity(400)) .tag(EIOTags.Fluids.SOLAR_PANEL_LIGHT).finish(); - public static final FluidTypeHolder CLOUD_SEED = + public static final DeferredFluidType CLOUD_SEED = fluid("cloud_seed", "Cloud Seed", FluidType.Properties.create().density(500).viscosity(800)).finish(); - public static final FluidTypeHolder CLOUD_SEED_CONCENTRATED = + public static final DeferredFluidType CLOUD_SEED_CONCENTRATED = fluid("cloud_seed_concentrated", "Cloud Seed Concentrated", FluidType.Properties.create().density(1000).viscosity(1200)).finish(); private static FluidTypeBuilder fluid(String name, String translation, FluidType.Properties properties) { diff --git a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedCraftingTableBlock.java b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedCraftingTableBlock.java index 555c546e8..0c3c061bd 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedCraftingTableBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedCraftingTableBlock.java @@ -36,7 +36,7 @@ public PaintedCraftingTableBlock(Properties properties) { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.SINGLE_PAINTED.get().create(pos, state); + return EIOBlockEntities.SINGLE_PAINTED.create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedFenceBlock.java b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedFenceBlock.java index 3d1bd68e1..db616d246 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedFenceBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedFenceBlock.java @@ -21,7 +21,7 @@ public PaintedFenceBlock(Properties properties) { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.SINGLE_PAINTED.get().create(pos, state); + return EIOBlockEntities.SINGLE_PAINTED.create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedFenceGateBlock.java b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedFenceGateBlock.java index 2459f79ba..d552d342f 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedFenceGateBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedFenceGateBlock.java @@ -22,7 +22,7 @@ public PaintedFenceGateBlock(Properties properties) { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.SINGLE_PAINTED.get().create(pos, state); + return EIOBlockEntities.SINGLE_PAINTED.create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedRedstoneBlock.java b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedRedstoneBlock.java index e28d3a086..8684b97ff 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedRedstoneBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedRedstoneBlock.java @@ -27,7 +27,7 @@ public PaintedRedstoneBlock(Properties properties) { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.SINGLE_PAINTED.get().create(pos, state); + return EIOBlockEntities.SINGLE_PAINTED.create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedSandBlock.java b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedSandBlock.java index 8c84a20bc..e3be1ed0b 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedSandBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedSandBlock.java @@ -32,7 +32,7 @@ public PaintedSandBlock(Properties properties) { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.SINGLE_PAINTED.get().create(pos, state); + return EIOBlockEntities.SINGLE_PAINTED.create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedSlabBlock.java b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedSlabBlock.java index 8f97f4208..3d7c3b343 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedSlabBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedSlabBlock.java @@ -32,7 +32,7 @@ public PaintedSlabBlock(Properties properties) { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.DOUBLE_PAINTED.get().create(pos, state); + return EIOBlockEntities.DOUBLE_PAINTED.create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedStairBlock.java b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedStairBlock.java index 9cdb3636c..c3f3573cb 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedStairBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedStairBlock.java @@ -25,7 +25,7 @@ public PaintedStairBlock(Properties properties) { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.SINGLE_PAINTED.get().create(pos, state); + return EIOBlockEntities.SINGLE_PAINTED.create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedTrapDoorBlock.java b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedTrapDoorBlock.java index e9a8d2f78..6d0b89375 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedTrapDoorBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedTrapDoorBlock.java @@ -22,7 +22,7 @@ public PaintedTrapDoorBlock(Properties properties) { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.SINGLE_PAINTED.get().create(pos, state); + return EIOBlockEntities.SINGLE_PAINTED.create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedWallBlock.java b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedWallBlock.java index 7cd7c75eb..904b2655a 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedWallBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedWallBlock.java @@ -21,7 +21,7 @@ public PaintedWallBlock(Properties p_57964_) { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) { - return EIOBlockEntities.SINGLE_PAINTED.get().create(pPos, pState); + return EIOBlockEntities.SINGLE_PAINTED.create(pPos, pState); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedWoodenPressurePlateBlock.java b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedWoodenPressurePlateBlock.java index fd3047d87..ba43d9c93 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedWoodenPressurePlateBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/paint/block/PaintedWoodenPressurePlateBlock.java @@ -22,7 +22,7 @@ public PaintedWoodenPressurePlateBlock(Properties properties) { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return EIOBlockEntities.SINGLE_PAINTED.get().create(pos, state); + return EIOBlockEntities.SINGLE_PAINTED.create(pos, state); } @Override diff --git a/enderio-base/src/main/java/com/enderio/base/common/paint/block/SinglePaintedBlock.java b/enderio-base/src/main/java/com/enderio/base/common/paint/block/SinglePaintedBlock.java index 77f940e47..39f378f99 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/paint/block/SinglePaintedBlock.java +++ b/enderio-base/src/main/java/com/enderio/base/common/paint/block/SinglePaintedBlock.java @@ -25,7 +25,7 @@ public SinglePaintedBlock(Properties properties) { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) { - return EIOBlockEntities.SINGLE_PAINTED.get().create(pPos, pState); + return EIOBlockEntities.SINGLE_PAINTED.create(pPos, pState); } @Override diff --git a/gradle.properties b/gradle.properties index 4c91ac646..dd5518cdd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,7 @@ neoForge.parchment.minecraftVersion=1.21 neoForge.parchment.mappingsVersion=2024.07.28 # Dependencies -regiliteVersion=0.1-dev+cb8577e +regiliteVersion=0.1-dev+e18b37c jeiMinecraftVersion=1.21.1 jeiVersion=19.18.10.218 From 7f84cc9829f8c27b3a27dc1f22a673bd7b0edffd Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:26:15 +0100 Subject: [PATCH 6/7] chore: Updated to work with latest Regilite 1.21.1 --- .../com/enderio/armory/EnderIOArmory.java | 2 +- .../armory/common/init/ArmoryItems.java | 21 +- .../armory/common/lang/ArmoryLang.java | 4 +- .../base/common/block/glass/GlassBlocks.java | 8 +- .../base/common/init/EIOBlockEntities.java | 14 +- .../enderio/base/common/init/EIOBlocks.java | 60 +-- .../enderio/base/common/init/EIOEntities.java | 6 +- .../enderio/base/common/init/EIOItems.java | 8 +- .../enderio/base/common/init/EIOMenus.java | 24 +- .../mods/appeng/AE2ConduitsModule.java | 2 +- .../mods/mekanism/MekanismModule.java | 29 +- .../refinedstorage/RefinedStorageModule.java | 2 +- .../com/enderio/conduits/EnderIOConduits.java | 8 +- .../common/init/ConduitBlockEntities.java | 18 +- .../conduits/common/init/ConduitBlocks.java | 30 +- .../conduits/common/init/ConduitItems.java | 78 ++-- .../conduits/common/init/ConduitLang.java | 4 +- .../conduits/common/init/ConduitMenus.java | 28 +- .../com/enderio/machines/EnderIOMachines.java | 6 +- .../common/block/CapacitorBankBlock.java | 5 +- .../machines/common/block/MachineBlock.java | 4 +- .../common/block/ProgressMachineBlock.java | 4 +- .../common/block/SolarPanelBlock.java | 4 +- .../common/block/TravelAnchorBlock.java | 4 +- .../blockentity/SoulBinderBlockEntity.java | 4 +- .../blockentity/XPObeliskBlockEntity.java | 4 +- .../blockentity/XPVacuumBlockEntity.java | 4 +- .../common/config/MachinesConfigLang.java | 3 +- .../common/init/MachineBlockEntities.java | 193 +++++---- .../machines/common/init/MachineBlocks.java | 409 +++++++++--------- .../machines/common/init/MachineMenus.java | 129 +++--- .../machines/common/lang/MachineEnumLang.java | 3 +- .../machines/common/lang/MachineLang.java | 4 +- .../machines/data/loot/MachinesLootTable.java | 2 +- .../machines/data/model/MachineModelUtil.java | 2 +- .../recipes/FermentingRecipeProvider.java | 2 +- .../data/recipes/TankRecipeProvider.java | 6 +- .../data/souldata/SoulDataProvider.java | 8 +- gradle.properties | 2 +- 39 files changed, 604 insertions(+), 544 deletions(-) diff --git a/enderio-armory/src/main/java/com/enderio/armory/EnderIOArmory.java b/enderio-armory/src/main/java/com/enderio/armory/EnderIOArmory.java index 8096114f5..ae2d16b51 100644 --- a/enderio-armory/src/main/java/com/enderio/armory/EnderIOArmory.java +++ b/enderio-armory/src/main/java/com/enderio/armory/EnderIOArmory.java @@ -41,7 +41,7 @@ public EnderIOArmory(IEventBus modEventBus, ModContainer modContainer) { modContainer.registerConfig(ModConfig.Type.CLIENT, ArmoryConfig.CLIENT_SPEC, "enderio/armory-client.toml"); // Perform initialization and registration for everything so things are registered. - ArmoryItems.register(modEventBus); + ArmoryItems.register(); ArmoryRecipes.register(modEventBus); ArmoryLootModifiers.register(modEventBus); ArmoryTags.register(); diff --git a/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java b/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java index 4fd7dd594..ba097e2a3 100644 --- a/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java +++ b/enderio-armory/src/main/java/com/enderio/armory/common/init/ArmoryItems.java @@ -5,17 +5,16 @@ import com.enderio.armory.common.tag.ArmoryTags; import com.enderio.base.common.init.EIOCreativeTabs; import com.enderio.base.common.tag.EIOTags; -import com.enderio.regilite.holder.RegiliteItem; -import com.enderio.regilite.registry.ItemRegistry; +import com.enderio.regilite.items.RegiliteItems; import net.minecraft.world.item.Item; import net.minecraft.world.item.Tier; import net.minecraft.world.item.crafting.Ingredient; -import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.common.SimpleTier; +import net.neoforged.neoforge.registries.DeferredItem; @SuppressWarnings("unused") public class ArmoryItems { - private static final ItemRegistry ITEM_REGISTRY = EnderIOArmory.REGILITE.itemRegistry(); + private static final RegiliteItems ITEMS = EnderIOArmory.REGILITE.items(); /*public static final Tier DARK_STEEL_TIER = TierSortingRegistry.registerTier( new SimpleTier(3, 2000, 8.0F, 3, 25, ArmoryTags.Blocks.DARK_STEEL_TIER, () -> Ingredient.of(EIOItems.DARK_STEEL_INGOT.get())), @@ -24,11 +23,12 @@ public class ArmoryItems { public static final Tier DARK_STEEL_TIER = new SimpleTier(ArmoryTags.Blocks.INCORRECT_FOR_DARK_STEEL_TOOL, 2000, 8.0f, 3.0f, 25, () -> Ingredient.of( EIOTags.Items.INGOTS_DARK_STEEL)); - public static final RegiliteItem DARK_STEEL_SWORD = ITEM_REGISTRY - .registerItem("dark_steel_sword", DarkSteelSwordItem::new, new Item.Properties().durability(2000)) - .withTab(EIOCreativeTabs.GEAR) - .withTranslation("The Ender") - .setModelProvider((prov, ctx) -> prov.handheld(ctx.get())); + public static final DeferredItem DARK_STEEL_SWORD = ITEMS + .create("dark_steel_sword", DarkSteelSwordItem::new, new Item.Properties().durability(2000)) + .tab(EIOCreativeTabs.GEAR) + .translation("The Ender") + .model((prov, ctx) -> prov.handheld(ctx.get())) + .finish(); // TODO: Bring these back when they are finished. // public static final ItemEntry DARK_STEEL_PICKAXE = REGISTRATE @@ -134,7 +134,6 @@ public class ArmoryItems { // .lang("Explosive Penetration II" + UPGRADE_TEXT) // .register(); - public static void register(IEventBus bus) { - ITEM_REGISTRY.register(bus); + public static void register() { } } diff --git a/enderio-armory/src/main/java/com/enderio/armory/common/lang/ArmoryLang.java b/enderio-armory/src/main/java/com/enderio/armory/common/lang/ArmoryLang.java index 078316258..86ad411a4 100644 --- a/enderio-armory/src/main/java/com/enderio/armory/common/lang/ArmoryLang.java +++ b/enderio-armory/src/main/java/com/enderio/armory/common/lang/ArmoryLang.java @@ -62,11 +62,11 @@ public class ArmoryLang { // endregion private static MutableComponent addTranslation(String prefix, ResourceLocation id, String translation) { - return EnderIOArmory.REGILITE.addTranslation(prefix, id, translation); + return EnderIOArmory.REGILITE.lang().add(prefix, id, translation); } private static MutableComponent addTranslation(String prefix, ResourceLocation path, String name, String translation) { - return EnderIOArmory.REGILITE.addTranslation(prefix, ResourceLocation.fromNamespaceAndPath(path.getNamespace(), path.getPath() + "/" + name), translation); + return EnderIOArmory.REGILITE.lang().add(prefix, ResourceLocation.fromNamespaceAndPath(path.getNamespace(), path.getPath() + "/" + name), translation); } public static void register() {} diff --git a/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java b/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java index def898dbd..063c3d17a 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java +++ b/enderio-base/src/main/java/com/enderio/base/common/block/glass/GlassBlocks.java @@ -79,7 +79,7 @@ private DeferredBlock register(Regilite regilite, String name) .isSuffocating(GlassBlocks::never) .isViewBlocking(GlassBlocks::never)) .translation("") - .blockStateProvider((cons, ctx) -> cons.simpleBlock(ctx.get(), cons.models().getExistingFile(getModelFile()))) + .blockState((cons, ctx) -> cons.simpleBlock(ctx.get(), cons.models().getExistingFile(getModelFile()))) .tag(glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS); block.createSimpleBlockItem(item -> { @@ -88,7 +88,7 @@ private DeferredBlock register(Regilite regilite, String name) glassIdentifier.explosion_resistance() ? EIOTags.Items.FUSED_QUARTZ : EIOTags.Items.CLEAR_GLASS, EIOTags.Items.GLASS_TAGS.get(glassIdentifier) ) - .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); + .model((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); if (glassIdentifier.lighting() == GlassLighting.EMITTING && glassIdentifier.explosion_resistance()) { item.tag(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); @@ -120,7 +120,7 @@ private DeferredBlock register(Regilite regilite, String name, .isViewBlocking(GlassBlocks::never) .mapColor(color)) .translation("") - .blockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(getModelFile()))) + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(getModelFile()))) .blockColor(() -> () -> (state, level, pos, tintIndex) -> color.getMapColor().col) .tag(glassIdentifier.explosion_resistance() ? EIOTags.Blocks.FUSED_QUARTZ : EIOTags.Blocks.CLEAR_GLASS); @@ -131,7 +131,7 @@ private DeferredBlock register(Regilite regilite, String name, glassIdentifier.explosion_resistance() ? EIOTags.Items.FUSED_QUARTZ : EIOTags.Items.CLEAR_GLASS, EIOTags.Items.GLASS_TAGS.get(glassIdentifier) ) - .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); + .model((prov, ctx) -> prov.withExistingParent(ctx.getName(), getModelFile())); if (glassIdentifier.lighting() == GlassLighting.EMITTING && glassIdentifier.explosion_resistance()) { item.tag(EIOTags.Items.ENLIGHTENED_FUSED_QUARTZ); diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java index f5a2278b8..2597b7391 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlockEntities.java @@ -7,12 +7,12 @@ import com.enderio.base.common.paint.blockentity.DoublePaintedBlockEntity; import com.enderio.base.common.paint.blockentity.SinglePaintedBlockEntity; import com.enderio.regilite.blockentities.DeferredBlockEntityType; -import com.enderio.regilite.blockentities.RegiliteBlockEntities; +import com.enderio.regilite.blockentities.RegiliteBlockEntityTypes; public class EIOBlockEntities { - private static final RegiliteBlockEntities BLOCK_ENTITIES = EnderIOBase.REGILITE.blockEntities(); + private static final RegiliteBlockEntityTypes BLOCK_ENTITY_TYPES = EnderIOBase.REGILITE.blockEntityTypes(); - public static final DeferredBlockEntityType SINGLE_PAINTED = BLOCK_ENTITIES + public static final DeferredBlockEntityType SINGLE_PAINTED = BLOCK_ENTITY_TYPES .create("single_painted", SinglePaintedBlockEntity::new, EIOBlocks.PAINTED_FENCE, @@ -26,10 +26,10 @@ public class EIOBlockEntities { EIOBlocks.PAINTED_GLOWSTONE, EIOBlocks.PAINTED_WALL).finish(); - public static final DeferredBlockEntityType DOUBLE_PAINTED = BLOCK_ENTITIES + public static final DeferredBlockEntityType DOUBLE_PAINTED = BLOCK_ENTITY_TYPES .create("double_painted", DoublePaintedBlockEntity::new, EIOBlocks.PAINTED_SLAB).finish(); - public static final DeferredBlockEntityType POWERED_LIGHT = BLOCK_ENTITIES + public static final DeferredBlockEntityType POWERED_LIGHT = BLOCK_ENTITY_TYPES .create("powered_light", PoweredLightBlockEntity::new, EIOBlocks.POWERED_LIGHT, @@ -38,10 +38,10 @@ public class EIOBlockEntities { EIOBlocks.POWERED_LIGHT_INVERTED_WIRELESS) .finish(); - public static final DeferredBlockEntityType LIGHT_NODE = BLOCK_ENTITIES + public static final DeferredBlockEntityType LIGHT_NODE = BLOCK_ENTITY_TYPES .create("light_node", LightNodeBlockEntity::new, EIOBlocks.LIGHT_NODE).finish(); - public static final DeferredBlockEntityType ENDER_SKULL = BLOCK_ENTITIES + public static final DeferredBlockEntityType ENDER_SKULL = BLOCK_ENTITY_TYPES .create("ender_skull", EnderSkullBlockEntity::new, EIOBlocks.WALL_ENDERMAN_HEAD, EIOBlocks.ENDERMAN_HEAD).finish(); public static void register() { diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java index 592b5520a..a2da856d8 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOBlocks.java @@ -132,7 +132,7 @@ public class EIOBlocks { public static final DeferredBlock DARK_STEEL_LADDER = BLOCKS .create("dark_steel_ladder", DarkSteelLadderBlock::new, BlockBehaviour.Properties.of().strength(0.4f).requiresCorrectToolForDrops().sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) - .blockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov + .blockState((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov .models() .withExistingParent(ctx.getName(), prov.mcLoc("block/ladder")) .renderType(prov.mcLoc("cutout_mipped")) @@ -140,21 +140,21 @@ public class EIOBlocks { .texture("texture", prov.blockTexture(ctx.get())))) .tags(BlockTags.CLIMBABLE, BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) .createSimpleBlockItem(item -> item - .modelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_ladder"))) + .model((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_ladder"))) .tab(EIOCreativeTabs.BLOCKS)) .finish(); public static final DeferredBlock DARK_STEEL_BARS = BLOCKS .create("dark_steel_bars", IronBarsBlock::new, BlockBehaviour.Properties.of().strength(5.0f, 1000.0f).requiresCorrectToolForDrops().sound(SoundType.METAL).noOcclusion()) - .blockStateProvider(EIOBlockState::paneBlock) + .blockState(EIOBlockState::paneBlock) .tags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) .createSimpleBlockItem(item -> item .tab(EIOCreativeTabs.BLOCKS) - .modelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_bars"))) + .model((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/dark_steel_bars"))) ) .finish(); @@ -162,12 +162,12 @@ public class EIOBlocks { .create("dark_steel_door", props -> new DoorBlock(BlockSetType.IRON, props), BlockBehaviour.Properties.of().strength(5.0f, 2000.0f).sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) .lootTable(RegiliteBlockLootProvider::createDoor) - .blockStateProvider( + .blockState( (prov, ctx) -> prov.doorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_door_bottom"), prov.modLoc("block/dark_steel_door_top"), prov.mcLoc("cutout"))) .tags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.DOORS) .createSimpleBlockItem(item -> item - .modelProvider((prov, ctx) -> prov.basicItem(ctx.get())) + .model((prov, ctx) -> prov.basicItem(ctx.get())) .tab(EIOCreativeTabs.BLOCKS) ) .finish(); @@ -175,10 +175,10 @@ public class EIOBlocks { public static final DeferredBlock DARK_STEEL_TRAPDOOR = BLOCKS .create("dark_steel_trapdoor", props -> new TrapDoorBlock(BlockSetType.IRON, props), BlockBehaviour.Properties.of().strength(5.0f, 2000.0f).sound(SoundType.METAL).mapColor(MapColor.METAL).noOcclusion()) - .blockStateProvider((prov, ctx) -> prov.trapdoorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_trapdoor"), true, prov.mcLoc("cutout"))) + .blockState((prov, ctx) -> prov.trapdoorBlockWithRenderType(ctx.get(), prov.modLoc("block/dark_steel_trapdoor"), true, prov.mcLoc("cutout"))) .tags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_IRON_TOOL, BlockTags.TRAPDOORS) .createSimpleBlockItem(item -> item - .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.modLoc("block/dark_steel_trapdoor_bottom"))) + .model((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.modLoc("block/dark_steel_trapdoor_bottom"))) .tab(EIOCreativeTabs.BLOCKS) ) .finish(); @@ -186,14 +186,14 @@ public class EIOBlocks { public static final DeferredBlock END_STEEL_BARS = BLOCKS .create("end_steel_bars", IronBarsBlock::new, BlockBehaviour.Properties.of().strength(5.0f, 1000.0f).requiresCorrectToolForDrops().sound(SoundType.METAL).noOcclusion()) - .blockStateProvider(EIOBlockState::paneBlock) + .blockState(EIOBlockState::paneBlock) .tags( BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE ) .createSimpleBlockItem(item -> item .tab(EIOCreativeTabs.BLOCKS) - .modelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/end_steel_bars"))) + .model((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("block/end_steel_bars"))) ) .finish(); @@ -251,7 +251,7 @@ private static Map fillGlassMap() { BlockTags.MINEABLE_WITH_PICKAXE, Tags.Blocks.CHAINS ) - .blockStateProvider((prov, ctx) -> { + .blockState((prov, ctx) -> { var model = prov .models() .withExistingParent(ctx.getName(), prov.mcLoc("block/chain")) @@ -262,7 +262,7 @@ private static Map fillGlassMap() { prov.axisBlock(ctx.get(), model, model); }) .createSimpleBlockItem(item -> item - .modelProvider((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("item/soul_chain"))) + .model((prov, ctx) -> prov.basicItem(ctx.get(), prov.modLoc("item/soul_chain"))) .tags(Tags.Items.CHAINS) .tab(EIOCreativeTabs.BLOCKS) ) @@ -270,7 +270,7 @@ private static Map fillGlassMap() { public static final DeferredBlock COLD_FIRE = BLOCKS .create("cold_fire", ColdFireBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.FIRE).noLootTable()) - .blockStateProvider((prov, ctx) -> { + .blockState((prov, ctx) -> { // This generates the models used for the blockstate in our resources. // One day we may bother to datagen that file. String[] toCopy = { "fire_floor0", "fire_floor1", "fire_side0", "fire_side1", "fire_side_alt0", "fire_side_alt1", "fire_up0", "fire_up1", @@ -409,25 +409,25 @@ private static Map fillGlassMap() { public static final DeferredBlock LIGHT_NODE = BLOCKS .create("light_node", LightNode::new, BlockBehaviour.Properties.ofFullCopy(Blocks.AIR).lightLevel(l -> 15).noLootTable().noCollission().noOcclusion()) - .blockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().withExistingParent("light_node", "block/air"))) + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().withExistingParent("light_node", "block/air"))) .finish(); public static final DeferredBlock ENDERMAN_HEAD = BLOCKS .create("enderman_head", EnderSkullBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SKELETON_SKULL).instrument(NoteBlockInstrument.SKELETON).strength(1.0F).pushReaction(PushReaction.DESTROY)) - .blockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) - .withBlockItem( + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) + .createBlockItem( // TODO: Properties being handled right? Maybe cleaner if we have a factory that takes properties, then a properties arg. (enderSkullBlock) -> new EnderSkullBlockItem(enderSkullBlock, new Item.Properties(), Direction.DOWN), item -> item .tab(EIOCreativeTabs.MAIN) - .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), "item/template_skull"))) + .model((prov, ctx) -> prov.withExistingParent(ctx.getName(), "item/template_skull"))) .finish(); public static final DeferredBlock WALL_ENDERMAN_HEAD = BLOCKS .create("wall_enderman_head", WallEnderSkullBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.SKELETON_SKULL).strength(1.0F).lootFrom(ENDERMAN_HEAD).pushReaction(PushReaction.DESTROY)) - .blockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(prov.mcLoc("block/skull")))) .translation("") .finish(); @@ -449,7 +449,7 @@ private static DeferredBlock metalBlock(String name, TagKey blockT private static DeferredBlock chassisBlock(String name) { return BLOCKS .create(name, Block::new, BlockBehaviour.Properties.of().noOcclusion().sound(SoundType.METAL).mapColor(MapColor.METAL).strength(5, 6)) - .blockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().cubeAll(name, prov.blockTexture(ctx.get())).renderType(prov.mcLoc("translucent")))) .tags( BlockTags.NEEDS_STONE_TOOL, @@ -467,7 +467,7 @@ private static DeferredBlock pressurePlateBlock(String na return BLOCKS .create(name, props -> new EIOPressurePlateBlock(props, type, silent), BlockBehaviour.Properties.of().strength(5, 6).mapColor(MapColor.METAL)) - .blockStateProvider((prov, ctx) -> { + .blockState((prov, ctx) -> { BlockModelProvider modProv = prov.models(); ModelFile dm = modProv.withExistingParent(name + "_down", prov.mcLoc("block/pressure_plate_down")).texture("texture", texture); ModelFile um = modProv.withExistingParent(name, prov.mcLoc("block/pressure_plate_up")).texture("texture", texture); @@ -491,13 +491,13 @@ private static DeferredBlock silentPressurePlateBlock( .create("silent_" + upModelLoc.getPath(), props -> new SilentPressurePlateBlock(block), BlockBehaviour.Properties.of()) .tags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) - .blockStateProvider((prov, ctx) -> { + .blockState((prov, ctx) -> { VariantBlockStateBuilder vb = prov.getVariantBuilder(ctx.get()); vb.partialState().with(PressurePlateBlock.POWERED, true).addModels(new ConfiguredModel(prov.models().getExistingFile(downModelLoc))); vb.partialState().with(PressurePlateBlock.POWERED, false).addModels(new ConfiguredModel(prov.models().getExistingFile(upModelLoc))); }) .createSimpleBlockItem(item -> item - .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) + .model((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) .tab(EIOCreativeTabs.BLOCKS) ) .finish(); @@ -510,7 +510,7 @@ private static DeferredBlock silentWeightedPre return BLOCKS .create("silent_" + upModelLoc.getPath(), props -> new SilentWeightedPressurePlateBlock(block), BlockBehaviour.Properties.of()) - .blockStateProvider((prov, ctx) -> prov.getVariantBuilder(ctx.get()).forAllStates(blockState -> { + .blockState((prov, ctx) -> prov.getVariantBuilder(ctx.get()).forAllStates(blockState -> { if (blockState.getValue(WeightedPressurePlateBlock.POWER) == 0) { return new ConfiguredModel[] { new ConfiguredModel(prov.models().getExistingFile(upModelLoc)) }; } @@ -518,7 +518,7 @@ private static DeferredBlock silentWeightedPre })) .tags(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.PRESSURE_PLATES) .createSimpleBlockItem(item -> item - .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) + .model((prov, ctx) -> prov.withExistingParent(ctx.getName(), upModelLoc)) .tab(EIOCreativeTabs.BLOCKS) ) .finish(); @@ -530,7 +530,7 @@ private static DeferredBlock resettingLeverBlock(String nam return BLOCKS .create(name, props -> new ResettingLeverBlock(duration, inverted), BlockBehaviour.Properties.of()) .translation("Resetting Lever " + (inverted ? "Inverted " : "") + durationLabel) - .blockStateProvider((prov, ctx) -> { + .blockState((prov, ctx) -> { BlockModelProvider modProv = prov.models(); ModelFile.ExistingModelFile baseModel = modProv.getExistingFile(prov.mcLoc("block/lever")); ModelFile.ExistingModelFile onModel = modProv.getExistingFile(prov.mcLoc("block/lever_on")); @@ -550,7 +550,7 @@ private static DeferredBlock resettingLeverBlock(String nam }); }) .createSimpleBlockItem(item -> item - .modelProvider((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.mcLoc("item/lever"))) + .model((prov, ctx) -> prov.withExistingParent(ctx.getName(), prov.mcLoc("item/lever"))) .tab(EIOCreativeTabs.BLOCKS) ) .finish(); @@ -589,11 +589,11 @@ private static BlockBuilder paintedBlock(String name, Funct return BLOCKS .create(name, blockFactory, BlockBehaviour.Properties.ofFullCopy(copyFrom).noOcclusion()) - .blockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock(name, prov, ctx.get(), copyFrom, itemTextureRotation)) + .blockState((prov, ctx) -> EIOBlockState.paintedBlock(name, prov, ctx.get(), copyFrom, itemTextureRotation)) .blockColor(() -> PaintedBlockColor::new) .lootTable(DecorLootTable::withPaint) .tags(tags) - .withBlockItem( + .createBlockItem( b -> itemFactory.apply(b, new Item.Properties()), item -> item .itemColor(() -> PaintedBlockColor::new)); @@ -607,9 +607,9 @@ public static DeferredBlock lightBlock(String name, Functio } return 0; })) - .blockStateProvider(EIOBlockState::lightBlock) + .blockState(EIOBlockState::lightBlock) .createSimpleBlockItem(item -> item - .modelProvider((prov, ctx) -> prov.withExistingParent(name, "block/button_inventory")) + .model((prov, ctx) -> prov.withExistingParent(name, "block/button_inventory")) .tab(EIOCreativeTabs.BLOCKS) ) .finish(); diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java index 488c982fd..2173a3b68 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOEntities.java @@ -3,7 +3,7 @@ import com.enderio.EnderIOBase; import com.enderio.base.client.paint.PaintedSandRenderer; import com.enderio.base.common.paint.PaintedSandEntity; -import com.enderio.regilite.entities.RegiliteEntities; +import com.enderio.regilite.entities.RegiliteEntityTypes; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; @@ -11,9 +11,9 @@ public class EIOEntities { - private static final RegiliteEntities ENTITIES = EnderIOBase.REGILITE.entities(); + private static final RegiliteEntityTypes ENTITY_TYPES = EnderIOBase.REGILITE.entityTypes(); - public static final Supplier> PAINTED_SAND = ENTITIES + public static final Supplier> PAINTED_SAND = ENTITY_TYPES .create("painted_sand", (EntityType.EntityFactory) PaintedSandEntity::new, MobCategory.MISC) .renderer(() -> PaintedSandRenderer::new) .translation("Painted Sand") diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java index d91f21eee..ff7d6f61d 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOItems.java @@ -96,13 +96,13 @@ public class EIOItems { public static final DeferredItem FRANK_N_ZOMBIE = materialItemGlinted("frank_n_zombie") .translation("Frank'N'Zombie") - .modelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.Z_LOGIC_CONTROLLER)) + .model((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.Z_LOGIC_CONTROLLER)) .finish(); public static final DeferredItem ENDER_RESONATOR = materialItem("ender_resonator").finish(); public static final DeferredItem SENTIENT_ENDER = materialItemGlinted("sentient_ender") - .modelProvider((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.ENDER_RESONATOR)) + .model((prov, ctx) -> ModelHelper.mimicItem(prov, ctx, EIOItems.ENDER_RESONATOR)) .finish(); public static final DeferredItem SKELETAL_CONTRACTOR = materialItem("skeletal_contractor").finish(); @@ -321,7 +321,7 @@ public class EIOItems { public static final DeferredItem BROKEN_SPAWNER = ITEMS .create("broken_spawner", BrokenSpawnerItem::new) .tags(EIOTags.Items.ENTITY_STORAGE) - .modelProvider(ModelHelper::fakeBlockModel) + .model(ModelHelper::fakeBlockModel) .tab(EIOCreativeTabs.MAIN) .tab(EIOCreativeTabs.SOULS, modifier -> modifier.acceptAll(BrokenSpawnerItem.getPossibleStacks())) .finish(); @@ -389,7 +389,7 @@ private static DeferredItem gliderItem(String name) { return dumbItem(name, HangGliderItem::new) .tags(EIOTags.Items.GLIDER) .tab(EIOCreativeTabs.MAIN) - .modelProvider((prov, ctx) -> GliderItemModel.create(ctx.get(), prov)) + .model((prov, ctx) -> GliderItemModel.create(ctx.get(), prov)) .finish(); } diff --git a/enderio-base/src/main/java/com/enderio/base/common/init/EIOMenus.java b/enderio-base/src/main/java/com/enderio/base/common/init/EIOMenus.java index 3428b7a5f..3c82ad761 100644 --- a/enderio-base/src/main/java/com/enderio/base/common/init/EIOMenus.java +++ b/enderio-base/src/main/java/com/enderio/base/common/init/EIOMenus.java @@ -9,29 +9,25 @@ import com.enderio.base.common.menu.EntityFilterMenu; import com.enderio.base.common.menu.FluidFilterMenu; import com.enderio.base.common.menu.ItemFilterMenu; -import com.enderio.regilite.menus.RegiliteMenus; +import com.enderio.regilite.menus.RegiliteMenuTypes; import net.minecraft.world.inventory.MenuType; import java.util.function.Supplier; public class EIOMenus { - private static final RegiliteMenus MENUS = EnderIOBase.REGILITE.menus(); + private static final RegiliteMenuTypes MENU_TYPES = EnderIOBase.REGILITE.menuTypes(); - public static final Supplier> COORDINATE = MENUS - .create("coordinate", CoordinateMenu::factory, () -> CoordinateMenuScreen::new) - .finish(); + public static final Supplier> COORDINATE = MENU_TYPES + .createOnly("coordinate", CoordinateMenu::factory, () -> CoordinateMenuScreen::new); - public static final Supplier> ITEM_FILTER = MENUS - .create("item_filter", ItemFilterMenu::factory, () -> ItemFilterScreen::new) - .finish(); + public static final Supplier> ITEM_FILTER = MENU_TYPES + .createOnly("item_filter", ItemFilterMenu::factory, () -> ItemFilterScreen::new); - public static final Supplier> FLUID_FILTER = MENUS - .create("fluid_filter", FluidFilterMenu::factory, () -> FluidFilterScreen::new) - .finish(); + public static final Supplier> FLUID_FILTER = MENU_TYPES + .createOnly("fluid_filter", FluidFilterMenu::factory, () -> FluidFilterScreen::new); - public static final Supplier> ENTITY_FILTER = MENUS - .create("entity_filter", EntityFilterMenu::factory, () -> EntityFilterScreen::new) - .finish(); + public static final Supplier> ENTITY_FILTER = MENU_TYPES + .createOnly("entity_filter", EntityFilterMenu::factory, () -> EntityFilterScreen::new); public static void register() { } diff --git a/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/appeng/AE2ConduitsModule.java b/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/appeng/AE2ConduitsModule.java index 7a50148ed..5fff9f150 100644 --- a/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/appeng/AE2ConduitsModule.java +++ b/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/appeng/AE2ConduitsModule.java @@ -56,7 +56,7 @@ public class AE2ConduitsModule implements ConduitModule { private static final Component LANG_DENSE_ME_CONDUIT = addTranslation("item", EnderIOBase.loc("conduit.dense_me"), "Dense ME Conduit"); private static MutableComponent addTranslation(String prefix, ResourceLocation id, String translation) { - return ModdedConduits.REGILITE.addTranslation(prefix, id, translation); + return ModdedConduits.REGILITE.lang().add(prefix, id, translation); } private static final TagKey COVERED_DENSE_CABLE = ItemTags.create(ResourceLocation.fromNamespaceAndPath("ae2", "covered_dense_cable")); diff --git a/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/MekanismModule.java b/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/MekanismModule.java index bc069c3f5..2beaaea8a 100644 --- a/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/MekanismModule.java +++ b/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/mekanism/MekanismModule.java @@ -12,10 +12,8 @@ import com.enderio.conduits.common.recipe.ConduitIngredient; import com.enderio.modconduits.ConduitModule; import com.enderio.modconduits.ModdedConduits; -import com.enderio.regilite.holder.RegiliteItem; -import com.enderio.regilite.holder.RegiliteMenu; -import com.enderio.regilite.registry.ItemRegistry; -import com.enderio.regilite.registry.MenuRegistry; +import com.enderio.regilite.items.RegiliteItems; +import com.enderio.regilite.menus.RegiliteMenuTypes; import mekanism.api.MekanismAPI; import mekanism.api.chemical.IChemicalHandler; import mekanism.api.heat.IHeatHandler; @@ -35,6 +33,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; +import net.minecraft.world.inventory.MenuType; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; @@ -43,6 +42,7 @@ import net.neoforged.neoforge.capabilities.ItemCapability; import net.neoforged.neoforge.common.conditions.ICondition; import net.neoforged.neoforge.common.conditions.ModLoadedCondition; +import net.neoforged.neoforge.registries.DeferredItem; import net.neoforged.neoforge.registries.DeferredRegister; import java.util.function.BiConsumer; @@ -62,17 +62,18 @@ public class MekanismModule implements ConduitModule { public static final Supplier> CHEMICAL_FILTER = DATA_COMPONENT_TYPES .registerComponentType("chemical_filter", builder -> builder.persistent(ChemicalFilterCapability.Component.CODEC).networkSynchronized(ChemicalFilterCapability.Component.STREAM_CODEC)); - private static final ItemRegistry ITEM_REGISTRY = ModdedConduits.REGILITE.itemRegistry(); + private static final RegiliteItems ITEMS = ModdedConduits.REGILITE.items(); - public static final RegiliteItem BASIC_CHEMICAL_FILTER = ITEM_REGISTRY - .registerItem("chemical_filter", properties -> new ChemicalFilterItem(properties.component(CHEMICAL_FILTER, new ChemicalFilterCapability.Component(5)))) - .withTab(EIOCreativeTabs.GEAR) - .withCapability(EIOCapabilities.Filter.ITEM, ChemicalFilterItem.FILTER_PROVIDER); + public static final DeferredItem BASIC_CHEMICAL_FILTER = ITEMS + .create("chemical_filter", properties -> new ChemicalFilterItem(properties.component(CHEMICAL_FILTER, new ChemicalFilterCapability.Component(5)))) + .tab(EIOCreativeTabs.GEAR) + .capability(EIOCapabilities.Filter.ITEM, ChemicalFilterItem.FILTER_PROVIDER) + .finish(); - private static final MenuRegistry MENU_REGISTRY = ModdedConduits.REGILITE.menuRegistry(); + private static final RegiliteMenuTypes MENU_TYPES = ModdedConduits.REGILITE.menuTypes(); - public static final RegiliteMenu CHEMICAL_FILTER_MENU = MENU_REGISTRY - .registerMenu("chemical_filter", ChemicalFilterMenu::factory, () -> ChemicalFilterScreen::new); + public static final Supplier> CHEMICAL_FILTER_MENU = MENU_TYPES + .createOnly("chemical_filter", ChemicalFilterMenu::factory, () -> ChemicalFilterScreen::new); public static class Types { @@ -117,7 +118,7 @@ public static class Item { private static final TagKey OSMIUM = ItemTags.create(ResourceLocation.fromNamespaceAndPath("c", "ingots/osmium")); private static MutableComponent addTranslation(String prefix, ResourceLocation id, String translation) { - return ModdedConduits.REGILITE.addTranslation(prefix, id, translation); + return ModdedConduits.REGILITE.lang().add(prefix, id, translation); } @Override @@ -125,8 +126,6 @@ public void register(IEventBus modEventBus) { Types.CONDUIT_TYPES.register(modEventBus); CONDUIT_DATA_TYPES.register(modEventBus); DATA_COMPONENT_TYPES.register(modEventBus); - ITEM_REGISTRY.register(modEventBus); - MENU_REGISTRY.register(modEventBus); } @Override diff --git a/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/refinedstorage/RefinedStorageModule.java b/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/refinedstorage/RefinedStorageModule.java index 9baff8724..c72d1fdf7 100644 --- a/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/refinedstorage/RefinedStorageModule.java +++ b/enderio-conduits-modded/src/main/java/com/enderio/modconduits/mods/refinedstorage/RefinedStorageModule.java @@ -51,7 +51,7 @@ public class RefinedStorageModule implements ConduitModule { private static final Component LANG_RS_CONDUIT = addTranslation("item", EnderIOBase.loc("rs"), "Refined Storage Conduit"); private static MutableComponent addTranslation(String prefix, ResourceLocation id, String translation) { - return ModdedConduits.REGILITE.addTranslation(prefix, id, translation); + return ModdedConduits.REGILITE.lang().add(prefix, id, translation); } @Override diff --git a/enderio-conduits/src/main/java/com/enderio/conduits/EnderIOConduits.java b/enderio-conduits/src/main/java/com/enderio/conduits/EnderIOConduits.java index 2c12d1c74..9bc549d1e 100644 --- a/enderio-conduits/src/main/java/com/enderio/conduits/EnderIOConduits.java +++ b/enderio-conduits/src/main/java/com/enderio/conduits/EnderIOConduits.java @@ -43,10 +43,10 @@ public class EnderIOConduits { public EnderIOConduits(IEventBus modEventBus, ModContainer modContainer) { Conduits.register(modEventBus); ConduitTypes.register(modEventBus); - ConduitBlockEntities.register(modEventBus); - ConduitMenus.register(modEventBus); - ConduitBlocks.register(modEventBus); - ConduitItems.register(modEventBus); + ConduitBlockEntities.register(); + ConduitMenus.register(); + ConduitBlocks.register(); + ConduitItems.register(); ConduitComponents.register(modEventBus); ConduitIngredientTypes.register(modEventBus); Integrations.register(); diff --git a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlockEntities.java b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlockEntities.java index 27e4a9a3b..a5b02bf5c 100644 --- a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlockEntities.java +++ b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlockEntities.java @@ -3,24 +3,19 @@ import com.enderio.conduits.api.EnderIOConduitsRegistries; import com.enderio.conduits.EnderIOConduits; import com.enderio.conduits.common.conduit.block.ConduitBundleBlockEntity; -import com.enderio.regilite.holder.RegiliteBlockEntity; -import com.enderio.regilite.registry.BlockEntityRegistry; -import net.minecraft.core.Direction; -import net.neoforged.bus.api.IEventBus; +import com.enderio.regilite.blockentities.DeferredBlockEntityType; +import com.enderio.regilite.blockentities.RegiliteBlockEntityTypes; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.capabilities.BlockCapability; import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; -import java.util.Set; -import java.util.stream.Collectors; - @EventBusSubscriber(modid = EnderIOConduits.MODULE_MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class ConduitBlockEntities { - private static final BlockEntityRegistry BLOCK_ENTITY_REGISTRY = EnderIOConduits.REGILITE.blockEntityRegistry(); + private static final RegiliteBlockEntityTypes BLOCK_ENTITY_TYPES = EnderIOConduits.REGILITE.blockEntityTypes(); - public static final RegiliteBlockEntity CONDUIT = BLOCK_ENTITY_REGISTRY - .registerBlockEntity("conduit", ConduitBundleBlockEntity::new, ConduitBlocks.CONDUIT); + public static final DeferredBlockEntityType CONDUIT = BLOCK_ENTITY_TYPES + .create("conduit", ConduitBundleBlockEntity::new, ConduitBlocks.CONDUIT).finish(); @SubscribeEvent public static void registerConduitCapabilities(RegisterCapabilitiesEvent event) { @@ -33,7 +28,6 @@ private static void registerConduitCapability(RegisterCapabilit event.registerBlockEntity(capability, CONDUIT.get(), ConduitBundleBlockEntity.createConduitCap(capability)); } - public static void register(IEventBus bus) { - BLOCK_ENTITY_REGISTRY.register(bus); + public static void register() { } } diff --git a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java index feb1a9718..910f16e35 100644 --- a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java +++ b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitBlocks.java @@ -4,37 +4,33 @@ import com.enderio.conduits.common.conduit.ConduitBlockItem; import com.enderio.conduits.common.conduit.block.ConduitBundleBlock; import com.enderio.conduits.data.model.ConduitBlockState; -import com.enderio.regilite.holder.RegiliteBlock; -import com.enderio.regilite.registry.BlockRegistry; -import com.enderio.regilite.registry.ItemRegistry; +import com.enderio.regilite.blocks.RegiliteBlocks; import net.minecraft.tags.BlockTags; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.material.MapColor; -import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredBlock; public class ConduitBlocks { - private static final ItemRegistry ITEM_REGISTRY = EnderIOConduits.REGILITE.itemRegistry(); - private static final BlockRegistry BLOCK_REGISTRY = EnderIOConduits.REGILITE.blockRegistry(); + private static final RegiliteBlocks BLOCKS = EnderIOConduits.REGILITE.blocks(); - public static final RegiliteBlock CONDUIT = BLOCK_REGISTRY - .registerBlock("conduit", ConduitBundleBlock::new, + public static final DeferredBlock CONDUIT = BLOCKS + .create("conduit", ConduitBundleBlock::new, BlockBehaviour.Properties.of() .strength(1.5f, 10) .noLootTable() .noOcclusion() .dynamicShape() .mapColor(MapColor.STONE)) - .withTranslation("Conduit Bundle") - .setBlockStateProvider(ConduitBlockState::conduit) - .withTags(BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockItem(ITEM_REGISTRY, b -> new ConduitBlockItem(b, new Item.Properties()), + .translation("Conduit Bundle") + .blockState(ConduitBlockState::conduit) + .tag(BlockTags.MINEABLE_WITH_PICKAXE) + .createBlockItem(b -> new ConduitBlockItem(b, new Item.Properties()), item -> item - .withTranslation(" Conduit") - .setModelProvider((prov, ctx) -> {})); + .translation(" Conduit") + .noModel()) + .finish(); - public static void register(IEventBus bus) { - BLOCK_REGISTRY.register(bus); - ITEM_REGISTRY.register(bus); + public static void register() { } } diff --git a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitItems.java b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitItems.java index aeed863f1..793daf217 100644 --- a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitItems.java +++ b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitItems.java @@ -10,8 +10,7 @@ import com.enderio.conduits.common.redstone.RedstoneFilterItem; import com.enderio.conduits.common.redstone.RedstoneTLatchFilter; import com.enderio.conduits.common.redstone.RedstoneTimerFilter; -import com.enderio.regilite.holder.RegiliteItem; -import com.enderio.regilite.registry.ItemRegistry; +import com.enderio.regilite.items.RegiliteItems; import net.minecraft.core.component.DataComponentType; import net.minecraft.util.Unit; import net.minecraft.world.inventory.MenuType; @@ -19,67 +18,72 @@ import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.capabilities.ICapabilityProvider; import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredItem; import java.util.function.Supplier; public class ConduitItems { - private static final ItemRegistry ITEM_REGISTRY = EnderIOConduits.REGILITE.itemRegistry(); + private static final RegiliteItems ITEMS = EnderIOConduits.REGILITE.items(); - public static final RegiliteItem EXTRACTION_SPEED_UPGRADE_1 = ITEM_REGISTRY.registerItem("extraction_speed_upgrade_1", properties -> + public static final DeferredItem EXTRACTION_SPEED_UPGRADE_1 = ITEMS.create("extraction_speed_upgrade_1", properties -> new SpeedUpgradeItem(properties.component(ConduitComponents.EXTRACTION_SPEED_UPGRADE_TIER, 1))) - .withTranslation("Tier 1 Extraction Speed Upgrade") - .withTab(EIOCreativeTabs.CONDUITS) - .withCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); + .translation("Tier 1 Extraction Speed Upgrade") + .tab(EIOCreativeTabs.CONDUITS) + .capability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER) + .finish(); - public static final RegiliteItem EXTRACTION_SPEED_UPGRADE_2 = ITEM_REGISTRY.registerItem("extraction_speed_upgrade_2", properties -> + public static final DeferredItem EXTRACTION_SPEED_UPGRADE_2 = ITEMS.create("extraction_speed_upgrade_2", properties -> new SpeedUpgradeItem(properties.component(ConduitComponents.EXTRACTION_SPEED_UPGRADE_TIER, 2))) - .withTranslation("Tier 2 Extraction Speed Upgrade") - .withTab(EIOCreativeTabs.CONDUITS) - .withCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); + .translation("Tier 2 Extraction Speed Upgrade") + .tab(EIOCreativeTabs.CONDUITS) + .capability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER) + .finish(); - public static final RegiliteItem EXTRACTION_SPEED_UPGRADE_3 = ITEM_REGISTRY.registerItem("extraction_speed_upgrade_3", properties -> + public static final DeferredItem EXTRACTION_SPEED_UPGRADE_3 = ITEMS.create("extraction_speed_upgrade_3", properties -> new SpeedUpgradeItem(properties.component(ConduitComponents.EXTRACTION_SPEED_UPGRADE_TIER, 3))) - .withTranslation("Tier 3 Extraction Speed Upgrade") - .withTab(EIOCreativeTabs.CONDUITS) - .withCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); + .translation("Tier 3 Extraction Speed Upgrade") + .tab(EIOCreativeTabs.CONDUITS) + .capability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER) + .finish(); - public static final RegiliteItem EXTRACTION_SPEED_UPGRADE_4 = ITEM_REGISTRY.registerItem("extraction_speed_upgrade_4", properties -> + public static final DeferredItem EXTRACTION_SPEED_UPGRADE_4 = ITEMS.create("extraction_speed_upgrade_4", properties -> new SpeedUpgradeItem(properties.component(ConduitComponents.EXTRACTION_SPEED_UPGRADE_TIER, 4))) - .withTranslation("Tier 4 Extraction Speed Upgrade") - .withTab(EIOCreativeTabs.CONDUITS) - .withCapability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER); + .translation("Tier 4 Extraction Speed Upgrade") + .tab(EIOCreativeTabs.CONDUITS) + .capability(ConduitCapabilities.ConduitUpgrade.ITEM, SpeedUpgradeItem.CAPABILITY_PROVIDER) + .finish(); - public static final RegiliteItem NOT_FILTER = createRedstoneFilter("redstone_not_filter", ConduitComponents.REDSTONE_NOT_FILTER, + public static final DeferredItem NOT_FILTER = createRedstoneFilter("redstone_not_filter", ConduitComponents.REDSTONE_NOT_FILTER, Unit.INSTANCE, RedstoneFilterItem.NOT_FILTER_PROVIDER, null); - public static final RegiliteItem OR_FILTER = createRedstoneFilter("redstone_or_filter", ConduitComponents.REDSTONE_OR_FILTER, + public static final DeferredItem OR_FILTER = createRedstoneFilter("redstone_or_filter", ConduitComponents.REDSTONE_OR_FILTER, DoubleRedstoneChannel.INSTANCE, RedstoneFilterItem.OR_FILTER_PROVIDER, ConduitMenus.REDSTONE_DOUBLE_CHANNEL_FILTER::get); - public static final RegiliteItem AND_FILTER = createRedstoneFilter("redstone_and_filter", ConduitComponents.REDSTONE_AND_FILTER, + public static final DeferredItem AND_FILTER = createRedstoneFilter("redstone_and_filter", ConduitComponents.REDSTONE_AND_FILTER, DoubleRedstoneChannel.INSTANCE, RedstoneFilterItem.AND_FILTER_PROVIDER, ConduitMenus.REDSTONE_DOUBLE_CHANNEL_FILTER::get); - public static final RegiliteItem NOR_FILTER = createRedstoneFilter("redstone_nor_filter", ConduitComponents.REDSTONE_NOR_FILTER, + public static final DeferredItem NOR_FILTER = createRedstoneFilter("redstone_nor_filter", ConduitComponents.REDSTONE_NOR_FILTER, DoubleRedstoneChannel.INSTANCE, RedstoneFilterItem.NOR_FILTER_PROVIDER, ConduitMenus.REDSTONE_DOUBLE_CHANNEL_FILTER::get); - public static final RegiliteItem NAND_FILTER = createRedstoneFilter("redstone_nand_filter", ConduitComponents.REDSTONE_NAND_FILTER, + public static final DeferredItem NAND_FILTER = createRedstoneFilter("redstone_nand_filter", ConduitComponents.REDSTONE_NAND_FILTER, DoubleRedstoneChannel.INSTANCE, RedstoneFilterItem.NAND_FILTER_PROVIDER, ConduitMenus.REDSTONE_DOUBLE_CHANNEL_FILTER::get); - public static final RegiliteItem XOR_FILTER = createRedstoneFilter("redstone_xor_filter", ConduitComponents.REDSTONE_XOR_FILTER, + public static final DeferredItem XOR_FILTER = createRedstoneFilter("redstone_xor_filter", ConduitComponents.REDSTONE_XOR_FILTER, DoubleRedstoneChannel.INSTANCE, RedstoneFilterItem.XOR_FILTER_PROVIDER, ConduitMenus.REDSTONE_DOUBLE_CHANNEL_FILTER::get); - public static final RegiliteItem XNOR_FILTER = createRedstoneFilter("redstone_xnor_filter", ConduitComponents.REDSTONE_XNOR_FILTER, + public static final DeferredItem XNOR_FILTER = createRedstoneFilter("redstone_xnor_filter", ConduitComponents.REDSTONE_XNOR_FILTER, DoubleRedstoneChannel.INSTANCE, RedstoneFilterItem.XNOR_FILTER_PROVIDER, ConduitMenus.REDSTONE_DOUBLE_CHANNEL_FILTER::get); - public static final RegiliteItem TLATCH_FILTER = createRedstoneFilter("redstone_toggle_filter", ConduitComponents.REDSTONE_TLATCH_FILTER, + public static final DeferredItem TLATCH_FILTER = createRedstoneFilter("redstone_toggle_filter", ConduitComponents.REDSTONE_TLATCH_FILTER, RedstoneTLatchFilter.INSTANCE, RedstoneFilterItem.TLATCH_FILTER_PROVIDER, null); - public static final RegiliteItem COUNT_FILTER = createRedstoneFilter("redstone_counting_filter", ConduitComponents.REDSTONE_COUNT_FILTER, + public static final DeferredItem COUNT_FILTER = createRedstoneFilter("redstone_counting_filter", ConduitComponents.REDSTONE_COUNT_FILTER, RedstoneCountFilter.INSTANCE, RedstoneFilterItem.COUNT_FILTER_PROVIDER, ConduitMenus.REDSTONE_COUNT_FILTER::get); - public static final RegiliteItem SENSOR_FILTER = createRedstoneFilter("redstone_sensor_filter", ConduitComponents.REDSTONE_SENSOR_FILTER, + public static final DeferredItem SENSOR_FILTER = createRedstoneFilter("redstone_sensor_filter", ConduitComponents.REDSTONE_SENSOR_FILTER, Unit.INSTANCE, RedstoneFilterItem.SENSOR_FILTER_PROVIDER, null); - public static final RegiliteItem TIMER_FILTER = createRedstoneFilter("redstone_timer_filter", ConduitComponents.REDSTONE_TIMER_FILTER, + public static final DeferredItem TIMER_FILTER = createRedstoneFilter("redstone_timer_filter", ConduitComponents.REDSTONE_TIMER_FILTER, RedstoneTimerFilter.INSTANCE, RedstoneFilterItem.TIMER_FILTER_PROVIDER, ConduitMenus.REDSTONE_TIMER_FILTER::get); - public static RegiliteItem createRedstoneFilter(String name, DeferredHolder, DataComponentType> type, T defaultValue, ICapabilityProvider provider, Supplier> menu) { - return ITEM_REGISTRY - .registerItem(name, properties -> new RedstoneFilterItem(properties.component(type, defaultValue), menu)) - .withTab(EIOCreativeTabs.CONDUITS) - .withCapability(EIOCapabilities.Filter.ITEM, provider); + public static DeferredItem createRedstoneFilter(String name, DeferredHolder, DataComponentType> type, T defaultValue, ICapabilityProvider provider, Supplier> menu) { + return ITEMS + .create(name, properties -> new RedstoneFilterItem(properties.component(type, defaultValue), menu)) + .tab(EIOCreativeTabs.CONDUITS) + .capability(EIOCapabilities.Filter.ITEM, provider) + .finish(); } - public static void register(IEventBus bus) { - ITEM_REGISTRY.register(bus); + public static void register() { } } diff --git a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitLang.java b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitLang.java index 49dfb1d6d..d1ebd49aa 100644 --- a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitLang.java +++ b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitLang.java @@ -30,11 +30,11 @@ public class ConduitLang { public static final Component CONDUIT_EXTRACT = addTranslation("gui", EnderIOBase.loc("conduit.extract"), "Extract"); private static MutableComponent addTranslation(String prefix, ResourceLocation id, String translation) { - return EnderIOConduits.REGILITE.addTranslation(prefix, id, translation); + return EnderIOConduits.REGILITE.lang().add(prefix, id, translation); } private static MutableComponent addTranslation(String prefix, ResourceLocation path, String name, String translation) { - return EnderIOConduits.REGILITE.addTranslation(prefix, ResourceLocation.fromNamespaceAndPath(path.getNamespace(), path.getPath() + "/" + name), translation); + return EnderIOConduits.REGILITE.lang().add(prefix, ResourceLocation.fromNamespaceAndPath(path.getNamespace(), path.getPath() + "/" + name), translation); } public static void register() { diff --git a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitMenus.java b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitMenus.java index 09904ef6a..20c2dbd60 100644 --- a/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitMenus.java +++ b/enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitMenus.java @@ -9,26 +9,26 @@ import com.enderio.conduits.common.menu.RedstoneCountFilterMenu; import com.enderio.conduits.common.menu.RedstoneDoubleChannelFilterMenu; import com.enderio.conduits.common.menu.RedstoneTimerFilterMenu; -import com.enderio.regilite.holder.RegiliteMenu; -import com.enderio.regilite.registry.MenuRegistry; -import net.neoforged.bus.api.IEventBus; +import com.enderio.regilite.menus.RegiliteMenuTypes; +import net.minecraft.world.inventory.MenuType; + +import java.util.function.Supplier; public class ConduitMenus { - private static final MenuRegistry MENU_REGISTRY = EnderIOConduits.REGILITE.menuRegistry(); + private static final RegiliteMenuTypes MENU_TYPES = EnderIOConduits.REGILITE.menuTypes(); - public static final RegiliteMenu CONDUIT_MENU = MENU_REGISTRY - .registerMenu("conduit", ConduitMenu::factory, () -> ConduitScreen::new); + public static final Supplier> CONDUIT_MENU = MENU_TYPES + .createOnly("conduit", ConduitMenu::factory, () -> ConduitScreen::new); - public static final RegiliteMenu REDSTONE_DOUBLE_CHANNEL_FILTER = MENU_REGISTRY - .registerMenu("redstone_and_filter", RedstoneDoubleChannelFilterMenu::factory, () -> RedstoneDoubleChannelFilterScreen::new); + public static final Supplier> REDSTONE_DOUBLE_CHANNEL_FILTER = MENU_TYPES + .createOnly("redstone_and_filter", RedstoneDoubleChannelFilterMenu::factory, () -> RedstoneDoubleChannelFilterScreen::new); - public static final RegiliteMenu REDSTONE_TIMER_FILTER = MENU_REGISTRY - .registerMenu("redstone_timer_filter", RedstoneTimerFilterMenu::factory, () -> RedstoneTimerFilterScreen::new); + public static final Supplier> REDSTONE_TIMER_FILTER = MENU_TYPES + .createOnly("redstone_timer_filter", RedstoneTimerFilterMenu::factory, () -> RedstoneTimerFilterScreen::new); - public static final RegiliteMenu REDSTONE_COUNT_FILTER = MENU_REGISTRY - .registerMenu("redstone_count_filter", RedstoneCountFilterMenu::factory, () -> RedstoneCountFilterScreen::new); + public static final Supplier> REDSTONE_COUNT_FILTER = MENU_TYPES + .createOnly("redstone_count_filter", RedstoneCountFilterMenu::factory, () -> RedstoneCountFilterScreen::new); - public static void register(IEventBus bus) { - MENU_REGISTRY.register(bus); + public static void register() { } } diff --git a/enderio-machines/src/main/java/com/enderio/machines/EnderIOMachines.java b/enderio-machines/src/main/java/com/enderio/machines/EnderIOMachines.java index b695ef2a7..89b99eede 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/EnderIOMachines.java +++ b/enderio-machines/src/main/java/com/enderio/machines/EnderIOMachines.java @@ -68,9 +68,9 @@ public EnderIOMachines(IEventBus modEventBus, ModContainer modContainer) { MachineDataComponents.register(modEventBus); MachineTravelTargets.register(modEventBus); - MachineBlocks.register(modEventBus); - MachineBlockEntities.register(modEventBus); - MachineMenus.register(modEventBus); + MachineBlocks.register(); + MachineBlockEntities.register(); + MachineMenus.register(); MachineRecipes.register(modEventBus); MachineAttachments.register(modEventBus); diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/block/CapacitorBankBlock.java b/enderio-machines/src/main/java/com/enderio/machines/common/block/CapacitorBankBlock.java index 988e02aa1..b8cd20640 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/block/CapacitorBankBlock.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/block/CapacitorBankBlock.java @@ -10,12 +10,11 @@ import com.enderio.machines.common.blockentity.capacitorbank.CapacitorBankBlockEntity; import com.enderio.machines.common.blockentity.capacitorbank.DisplayMode; import com.enderio.machines.common.blockentity.multienergy.CapacityTier; -import com.enderio.regilite.holder.RegiliteBlockEntity; +import com.enderio.regilite.blockentities.DeferredBlockEntityType; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -43,7 +42,7 @@ public CapacityTier getTier() { public static final ResourceLocation PLACE_ADVANCEMENT_ID = EnderIOBase.loc("place_capacitor_bank"); - public CapacitorBankBlock(Properties properties, RegiliteBlockEntity blockEntityType, CapacityTier tier) { + public CapacitorBankBlock(Properties properties, DeferredBlockEntityType blockEntityType, CapacityTier tier) { super(blockEntityType, properties); this.tier = tier; } diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/block/MachineBlock.java b/enderio-machines/src/main/java/com/enderio/machines/common/block/MachineBlock.java index aea00cf5d..58dd5eacf 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/block/MachineBlock.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/block/MachineBlock.java @@ -2,7 +2,7 @@ import com.enderio.base.common.tag.EIOTags; import com.enderio.machines.common.blockentity.base.MachineBlockEntity; -import com.enderio.regilite.holder.RegiliteBlockEntity; +import com.enderio.regilite.blockentities.DeferredBlockEntityType; import com.mojang.serialization.Codec; import com.mojang.serialization.DataResult; import com.mojang.serialization.MapCodec; @@ -58,7 +58,7 @@ private MachineBlock(Supplier> blo this.registerDefaultState(any.hasProperty(FACING) ? any.setValue(FACING, Direction.NORTH) : any); } - public MachineBlock(RegiliteBlockEntity blockEntityType, Properties properties) { + public MachineBlock(DeferredBlockEntityType blockEntityType, Properties properties) { super(properties); this.blockEntityType = blockEntityType::get; BlockState any = this.getStateDefinition().any(); diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/block/ProgressMachineBlock.java b/enderio-machines/src/main/java/com/enderio/machines/common/block/ProgressMachineBlock.java index 02a0cc19e..cc9826317 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/block/ProgressMachineBlock.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/block/ProgressMachineBlock.java @@ -1,7 +1,7 @@ package com.enderio.machines.common.block; import com.enderio.machines.common.blockentity.base.MachineBlockEntity; -import com.enderio.regilite.holder.RegiliteBlockEntity; +import com.enderio.regilite.blockentities.DeferredBlockEntityType; import net.minecraft.core.Direction; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; @@ -16,7 +16,7 @@ public class ProgressMachineBlock extends MachineBlock { public static final BooleanProperty POWERED = BlockStateProperties.POWERED; - public ProgressMachineBlock(RegiliteBlockEntity blockEntityType, Properties properties) { + public ProgressMachineBlock(DeferredBlockEntityType blockEntityType, Properties properties) { super(blockEntityType, properties); this.registerDefaultState(this.getStateDefinition().any().setValue(FACING, Direction.NORTH).setValue(POWERED, false)); } diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/block/SolarPanelBlock.java b/enderio-machines/src/main/java/com/enderio/machines/common/block/SolarPanelBlock.java index 6af98b050..592f1fd9a 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/block/SolarPanelBlock.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/block/SolarPanelBlock.java @@ -6,7 +6,7 @@ import com.enderio.machines.common.blockentity.base.MachineBlockEntity; import com.enderio.machines.common.blockentity.solar.ISolarPanelTier; import com.enderio.machines.common.lang.MachineLang; -import com.enderio.regilite.holder.RegiliteBlockEntity; +import com.enderio.regilite.blockentities.DeferredBlockEntityType; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.network.chat.Component; @@ -38,7 +38,7 @@ public class SolarPanelBlock extends MachineBlock implements AdvancedTooltipProv private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 3, 16); private final ISolarPanelTier tier; - public SolarPanelBlock(RegiliteBlockEntity blockEntityType, Properties properties, ISolarPanelTier tier) { + public SolarPanelBlock(DeferredBlockEntityType blockEntityType, Properties properties, ISolarPanelTier tier) { super(blockEntityType, properties); registerDefaultState(getStateDefinition().any().setValue(NORTH, true).setValue(NORTH_WEST, true).setValue(NORTH_EAST, true).setValue(WEST, true).setValue(EAST, true).setValue(SOUTH_WEST, true).setValue(SOUTH, true).setValue(SOUTH_EAST, true)); this.tier = tier; diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/block/TravelAnchorBlock.java b/enderio-machines/src/main/java/com/enderio/machines/common/block/TravelAnchorBlock.java index 15a2500b4..20abdcafd 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/block/TravelAnchorBlock.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/block/TravelAnchorBlock.java @@ -4,7 +4,7 @@ import com.enderio.machines.common.blockentity.TravelAnchorBlockEntity; import com.enderio.machines.common.blockentity.base.MachineBlockEntity; import com.enderio.machines.common.init.MachineBlockEntities; -import com.enderio.regilite.holder.RegiliteBlockEntity; +import com.enderio.regilite.blockentities.DeferredBlockEntityType; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; @@ -12,7 +12,7 @@ import org.jetbrains.annotations.Nullable; public class TravelAnchorBlock extends MachineBlock { - public TravelAnchorBlock(RegiliteBlockEntity blockEntityType, Properties props) { + public TravelAnchorBlock(DeferredBlockEntityType blockEntityType, Properties props) { super(blockEntityType, props); } diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/SoulBinderBlockEntity.java b/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/SoulBinderBlockEntity.java index f824b5566..d1fe96b68 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/SoulBinderBlockEntity.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/SoulBinderBlockEntity.java @@ -74,7 +74,7 @@ public SoulBinderBlockEntity(BlockPos worldPosition, BlockState blockState) { // Sync fluid amount to client. addDataSlot(NetworkDataSlot.INT.create( () -> TANK.getFluidAmount(this), - i -> TANK.setFluid(this, new FluidStack(EIOFluids.XP_JUICE.getSource(), i)))); + i -> TANK.setFluid(this, new FluidStack(EIOFluids.XP_JUICE.sourceFluid(), i)))); // Create the crafting task host craftingTaskHost = new CraftingMachineTaskHost<>(this, this::hasEnergy, MachineRecipes.SOUL_BINDING.type().get(), @@ -145,7 +145,7 @@ private SoulBindingRecipe.Input createFakeRecipeInput() { return new SoulBindingRecipe.Input( INPUT_SOUL.getItemStack(getInventoryNN()), INPUT_OTHER.getItemStack(getInventoryNN()), - new FluidStack(EIOFluids.XP_JUICE.getSource(), Integer.MAX_VALUE) + new FluidStack(EIOFluids.XP_JUICE.sourceFluid(), Integer.MAX_VALUE) ); } diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/XPObeliskBlockEntity.java b/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/XPObeliskBlockEntity.java index e3d218755..ac572346c 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/XPObeliskBlockEntity.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/XPObeliskBlockEntity.java @@ -38,7 +38,7 @@ public XPObeliskBlockEntity(BlockPos worldPosition, BlockState blockState) { fluidHandler = createFluidHandler(); this.xpTankDataSlot = NetworkDataSlot.INT.create(() -> TANK.getFluidAmount(this), - amount -> TANK.setFluid(this, new FluidStack(EIOFluids.XP_JUICE.getSource(), amount))); + amount -> TANK.setFluid(this, new FluidStack(EIOFluids.XP_JUICE.sourceFluid(), amount))); addDataSlot(xpTankDataSlot); } @@ -121,7 +121,7 @@ public void awardXP(long exp, Player player) { } else { int cappedVolume = (int) Math.min(Integer.MAX_VALUE, -volumeToRemove); // Invert - int filled = TANK.fill(this, new FluidStack(EIOFluids.XP_JUICE.getSource(), cappedVolume), IFluidHandler.FluidAction.EXECUTE); + int filled = TANK.fill(this, new FluidStack(EIOFluids.XP_JUICE.sourceFluid(), cappedVolume), IFluidHandler.FluidAction.EXECUTE); player.giveExperiencePoints(-1 * filled / ExperienceUtil.EXP_TO_FLUID); // Negative -> Take } } diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/XPVacuumBlockEntity.java b/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/XPVacuumBlockEntity.java index 3d3d131be..058e4e78a 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/XPVacuumBlockEntity.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/blockentity/XPVacuumBlockEntity.java @@ -38,7 +38,7 @@ public XPVacuumBlockEntity(BlockPos pWorldPosition, BlockState pBlockState) { // Sync fluid level. addDataSlot(NetworkDataSlot.INT.create( () -> TANK.getFluidAmount(this), - i -> TANK.setFluid(this, new FluidStack(EIOFluids.XP_JUICE.getSource(), i)))); + i -> TANK.setFluid(this, new FluidStack(EIOFluids.XP_JUICE.sourceFluid(), i)))); } @Override @@ -54,7 +54,7 @@ public AbstractContainerMenu createMenu(int containerId, Inventory inventory, Pl @Override public void handleEntity(ExperienceOrb xpe) { - int filled = TANK.fill(this, new FluidStack(EIOFluids.XP_JUICE.getSource(), xpe.getValue() * EXP_TO_FLUID), FluidAction.EXECUTE); + int filled = TANK.fill(this, new FluidStack(EIOFluids.XP_JUICE.sourceFluid(), xpe.getValue() * EXP_TO_FLUID), FluidAction.EXECUTE); if (filled == xpe.getValue() * EXP_TO_FLUID) { xpe.discard(); } else { diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/config/MachinesConfigLang.java b/enderio-machines/src/main/java/com/enderio/machines/common/config/MachinesConfigLang.java index 4d09c35c4..0bfbc4421 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/config/MachinesConfigLang.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/config/MachinesConfigLang.java @@ -78,7 +78,6 @@ public static void register() { } private static void addTranslation(String key, String translation) { - // TODO: More translation options in Regilite - EnderIOMachines.REGILITE.addTranslation(() -> EnderIOMachines.MODULE_MOD_ID + "." + "configuration" + "." + key, translation); + EnderIOMachines.REGILITE.lang().add(EnderIOMachines.MODULE_MOD_ID + "." + "configuration" + "." + key, translation); } } diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlockEntities.java b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlockEntities.java index 4a0f0b671..f5c139c43 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlockEntities.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlockEntities.java @@ -39,15 +39,15 @@ import com.enderio.machines.common.blockentity.capacitorbank.CapacitorTier; import com.enderio.machines.common.blockentity.solar.SolarPanelBlockEntity; import com.enderio.machines.common.blockentity.solar.SolarPanelTier; -import com.enderio.regilite.holder.RegiliteBlockEntity; -import com.enderio.regilite.registry.BlockEntityRegistry; +import com.enderio.regilite.blockentities.BlockEntityTypeBuilder; +import com.enderio.regilite.blockentities.DeferredBlockEntityType; +import com.enderio.regilite.blockentities.RegiliteBlockEntityTypes; import com.google.common.collect.ImmutableMap; import net.minecraft.Util; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; -import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.capabilities.Capabilities; import java.util.HashMap; @@ -56,109 +56,130 @@ import java.util.function.Supplier; public class MachineBlockEntities { - private static final BlockEntityRegistry BLOCK_ENTITY_REGISTRY = EnderIOMachines.REGILITE.blockEntityRegistry(); + private static final RegiliteBlockEntityTypes BLOCK_ENTITY_TYPES = EnderIOMachines.REGILITE.blockEntityTypes(); - public static final RegiliteBlockEntity FLUID_TANK = + public static final DeferredBlockEntityType FLUID_TANK = register("fluid_tank", FluidTankBlockEntity.Standard::new, MachineBlocks.FLUID_TANK) - .withRenderer(() -> FluidTankBER::new) + .renderer(() -> FluidTankBER::new) .with(MachineBlockEntities::machineBlockEntityCapabilities) - .with(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::fluidHandlerCapability) + .finish(); - public static final RegiliteBlockEntity PRESSURIZED_FLUID_TANK = + public static final DeferredBlockEntityType PRESSURIZED_FLUID_TANK = register("pressurized_fluid_tank", FluidTankBlockEntity.Enhanced::new, MachineBlocks.PRESSURIZED_FLUID_TANK) - .withRenderer(() -> FluidTankBER::new) + .renderer(() -> FluidTankBER::new) .with(MachineBlockEntities::machineBlockEntityCapabilities) - .with(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::fluidHandlerCapability) + .finish(); - public static final RegiliteBlockEntity ENCHANTER = - register("enchanter", EnchanterBlockEntity::new, MachineBlocks.ENCHANTER); + public static final DeferredBlockEntityType ENCHANTER = + register("enchanter", EnchanterBlockEntity::new, MachineBlocks.ENCHANTER) + .finish(); - public static final RegiliteBlockEntity PRIMITIVE_ALLOY_SMELTER = + public static final DeferredBlockEntityType PRIMITIVE_ALLOY_SMELTER = register("primitive_alloy_smelter", PrimitiveAlloySmelterBlockEntity::new, MachineBlocks.PRIMITIVE_ALLOY_SMELTER) - .with(MachineBlockEntities::machineBlockEntityCapabilities); + .with(MachineBlockEntities::machineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity ALLOY_SMELTER = + public static final DeferredBlockEntityType ALLOY_SMELTER = register("alloy_smelter", AlloySmelterBlockEntity::factory, MachineBlocks.ALLOY_SMELTER) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity CREATIVE_POWER = + public static final DeferredBlockEntityType CREATIVE_POWER = register("creative_power", CreativePowerBlockEntity::new, MachineBlocks.CREATIVE_POWER) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity STIRLING_GENERATOR = + public static final DeferredBlockEntityType STIRLING_GENERATOR = register("stirling_generator", StirlingGeneratorBlockEntity::new, MachineBlocks.STIRLING_GENERATOR) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity SAG_MILL = + public static final DeferredBlockEntityType SAG_MILL = register("sag_mill", SagMillBlockEntity::new, MachineBlocks.SAG_MILL) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity SLICE_AND_SPLICE = + public static final DeferredBlockEntityType SLICE_AND_SPLICE = register("slice_and_splice", SlicerBlockEntity::new, MachineBlocks.SLICE_AND_SPLICE) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity IMPULSE_HOPPER = + public static final DeferredBlockEntityType IMPULSE_HOPPER = register("impulse_hopper", ImpulseHopperBlockEntity::new, MachineBlocks.IMPULSE_HOPPER) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity VACUUM_CHEST = + public static final DeferredBlockEntityType VACUUM_CHEST = register("vacuum_chest", VacuumChestBlockEntity::new, MachineBlocks.VACUUM_CHEST) - .with(MachineBlockEntities::machineBlockEntityCapabilities); + .with(MachineBlockEntities::machineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity XP_VACUUM = + public static final DeferredBlockEntityType XP_VACUUM = register("xp_vacuum", XPVacuumBlockEntity::new, MachineBlocks.XP_VACUUM) .with(MachineBlockEntities::machineBlockEntityCapabilities) - .with(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::fluidHandlerCapability) + .finish(); - public static final RegiliteBlockEntity TRAVEL_ANCHOR = + public static final DeferredBlockEntityType TRAVEL_ANCHOR = register("travel_anchor", TravelAnchorBlockEntity::new, MachineBlocks.TRAVEL_ANCHOR) - .with(MachineBlockEntities::machineBlockEntityCapabilities); + .with(MachineBlockEntities::machineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity PAINTED_TRAVEL_ANCHOR = register("painted_travel_anchor", + public static final DeferredBlockEntityType PAINTED_TRAVEL_ANCHOR = register("painted_travel_anchor", PaintedTravelAnchorBlockEntity::new, MachineBlocks.PAINTED_TRAVEL_ANCHOR) - .with(MachineBlockEntities::machineBlockEntityCapabilities); + .with(MachineBlockEntities::machineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity CRAFTER = + public static final DeferredBlockEntityType CRAFTER = register("crafter", CrafterBlockEntity::new, MachineBlocks.CRAFTER) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity DRAIN = + public static final DeferredBlockEntityType DRAIN = register("drain", DrainBlockEntity::new, MachineBlocks.DRAIN) .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) - .with(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::fluidHandlerCapability) + .finish(); - public static final RegiliteBlockEntity SOUL_BINDER = + public static final DeferredBlockEntityType SOUL_BINDER = register("soul_binder", SoulBinderBlockEntity::new, MachineBlocks.SOUL_BINDER) .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) - .with(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::fluidHandlerCapability) + .finish(); - public static final RegiliteBlockEntity WIRED_CHARGER = + public static final DeferredBlockEntityType WIRED_CHARGER = register("wired_charger", WiredChargerBlockEntity::new, MachineBlocks.WIRED_CHARGER) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity PAINTING_MACHINE = + public static final DeferredBlockEntityType PAINTING_MACHINE = register("painting_machine", PaintingMachineBlockEntity::new, MachineBlocks.PAINTING_MACHINE) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity POWERED_SPAWNER = + public static final DeferredBlockEntityType POWERED_SPAWNER = register("powered_spawner", PoweredSpawnerBlockEntity::new, MachineBlocks.POWERED_SPAWNER) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final Map> SOLAR_PANELS = Util.make(() -> { - Map> map = new HashMap<>(); + public static final Map> SOLAR_PANELS = Util.make(() -> { + Map> map = new HashMap<>(); for (SolarPanelTier tier : SolarPanelTier.values()) { map.put( tier, register(tier.name().toLowerCase(Locale.ROOT) + "_photovoltaic_cell", (worldPosition, blockState) -> new SolarPanelBlockEntity(worldPosition, blockState, tier), () -> MachineBlocks.SOLAR_PANELS.get(tier).get()) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities)); + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish()); } return ImmutableMap.copyOf(map); }); - public static final Map> CAPACITOR_BANKS = Util.make(() -> { - Map> map = new HashMap<>(); + public static final Map> CAPACITOR_BANKS = Util.make(() -> { + Map> map = new HashMap<>(); for (CapacitorTier tier : CapacitorTier.values()) { map.put( tier, @@ -166,66 +187,74 @@ public class MachineBlockEntities { tier.name().toLowerCase(Locale.ROOT) + "_capacitor_bank", (worldPosition, blockState) -> new CapacitorBankBlockEntity(worldPosition, blockState, tier), () -> MachineBlocks.CAPACITOR_BANKS.get(tier).get()) - .withRenderer(() -> CapacitorBankBER::new) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities)); + .renderer(() -> CapacitorBankBER::new) + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish()); } return ImmutableMap.copyOf(map); }); - public static final RegiliteBlockEntity SOUL_ENGINE = + public static final DeferredBlockEntityType SOUL_ENGINE = register("soul_engine", SoulEngineBlockEntity::new, MachineBlocks.SOUL_ENGINE) .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) - .with(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::fluidHandlerCapability) + .finish(); - public static final RegiliteBlockEntity XP_OBELISK = + public static final DeferredBlockEntityType XP_OBELISK = register("xp_obelisk", XPObeliskBlockEntity::new, MachineBlocks.XP_OBELISK) - .withRenderer(() -> XPObeliskBER::new) + .renderer(() -> XPObeliskBER::new) // TODO: Make XP Obelisk use the common base class :) //.setRenderer(() -> ObeliskBER.factory(EIOItems.EXPERIENCE_ROD::get)) .with(MachineBlockEntities::machineBlockEntityCapabilities) - .with(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::fluidHandlerCapability) + .finish(); - public static final RegiliteBlockEntity VAT = register("vat", VatBlockEntity::new, MachineBlocks.VAT) + public static final DeferredBlockEntityType VAT = register("vat", VatBlockEntity::new, MachineBlocks.VAT) .with(MachineBlockEntities::machineBlockEntityCapabilities) - .with(MachineBlockEntities::fluidHandlerCapability); + .with(MachineBlockEntities::fluidHandlerCapability) + .finish(); - public static final RegiliteBlockEntity INHIBITOR_OBELISK = + public static final DeferredBlockEntityType INHIBITOR_OBELISK = register("inhibitor_obelisk", InhibitorObeliskBlockEntity::new, MachineBlocks.INHIBITOR_OBELISK) - .withRenderer(() -> ObeliskBER.factory(() -> Items.ENDER_PEARL)) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .renderer(() -> ObeliskBER.factory(() -> Items.ENDER_PEARL)) + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity AVERSION_OBELISK = + public static final DeferredBlockEntityType AVERSION_OBELISK = register("aversion_obelisk", AversionObeliskBlockEntity::new, MachineBlocks.AVERSION_OBELISK) - .withRenderer(() -> ObeliskBER.factory(EIOBlocks.ENDERMAN_HEAD::asItem)) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .renderer(() -> ObeliskBER.factory(EIOBlocks.ENDERMAN_HEAD::asItem)) + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); - public static final RegiliteBlockEntity RELOCATOR_OBELISK = + public static final DeferredBlockEntityType RELOCATOR_OBELISK = register("relocator_obelisk", RelocatorObeliskBlockEntity::new, MachineBlocks.RELOCATOR_OBELISK) - .withRenderer(() -> ObeliskBER.factory(() -> Items.PRISMARINE)) - .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities); + .renderer(() -> ObeliskBER.factory(() -> Items.PRISMARINE)) + .with(MachineBlockEntities::poweredMachineBlockEntityCapabilities) + .finish(); @SafeVarargs - private static RegiliteBlockEntity register(String name, BlockEntityType.BlockEntitySupplier beFactory, + private static BlockEntityTypeBuilder register(String name, BlockEntityType.BlockEntitySupplier beFactory, Supplier... blocks) { - return BLOCK_ENTITY_REGISTRY - .registerBlockEntity(name, beFactory, blocks); + return BLOCK_ENTITY_TYPES + .create(name, beFactory, blocks); } - private static void machineBlockEntityCapabilities(RegiliteBlockEntity blockEntity) { - blockEntity.withCapability(EIOCapabilities.SideConfig.BLOCK, MachineBlockEntity.SIDE_CONFIG_PROVIDER); - blockEntity.withCapability(Capabilities.ItemHandler.BLOCK, MachineBlockEntity.ITEM_HANDLER_PROVIDER); + private static BlockEntityTypeBuilder machineBlockEntityCapabilities(BlockEntityTypeBuilder blockEntity) { + return blockEntity + .capability(EIOCapabilities.SideConfig.BLOCK, MachineBlockEntity.SIDE_CONFIG_PROVIDER) + .capability(Capabilities.ItemHandler.BLOCK, MachineBlockEntity.ITEM_HANDLER_PROVIDER); } - private static void poweredMachineBlockEntityCapabilities(RegiliteBlockEntity blockEntity) { - machineBlockEntityCapabilities(blockEntity); - blockEntity.withCapability(Capabilities.EnergyStorage.BLOCK, PoweredMachineBlockEntity.ENERGY_STORAGE_PROVIDER); + private static BlockEntityTypeBuilder poweredMachineBlockEntityCapabilities(BlockEntityTypeBuilder blockEntity) { + return blockEntity + .with(MachineBlockEntities::machineBlockEntityCapabilities) + .capability(Capabilities.EnergyStorage.BLOCK, PoweredMachineBlockEntity.ENERGY_STORAGE_PROVIDER); } - private static void fluidHandlerCapability(RegiliteBlockEntity blockEntity) { - blockEntity.withCapability(Capabilities.FluidHandler.BLOCK, FluidTankUser.FLUID_HANDLER_PROVIDER); + private static BlockEntityTypeBuilder fluidHandlerCapability(BlockEntityTypeBuilder blockEntity) { + return blockEntity.capability(Capabilities.FluidHandler.BLOCK, FluidTankUser.FLUID_HANDLER_PROVIDER); } - public static void register(IEventBus bus) { - BLOCK_ENTITY_REGISTRY.register(bus); + public static void register() { } } diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java index 3bda98d0d..4f97db696 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java @@ -28,11 +28,10 @@ import com.enderio.machines.common.item.FluidTankItem; import com.enderio.machines.data.loot.MachinesLootTable; import com.enderio.machines.data.model.MachineModelUtil; +import com.enderio.regilite.blockentities.DeferredBlockEntityType; +import com.enderio.regilite.blocks.BlockBuilder; +import com.enderio.regilite.blocks.RegiliteBlocks; import com.enderio.regilite.data.DataGenContext; -import com.enderio.regilite.holder.RegiliteBlock; -import com.enderio.regilite.holder.RegiliteBlockEntity; -import com.enderio.regilite.registry.BlockRegistry; -import com.enderio.regilite.registry.ItemRegistry; import com.google.common.collect.ImmutableMap; import net.minecraft.Util; import net.minecraft.tags.BlockTags; @@ -41,10 +40,10 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockBehaviour; -import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.client.model.generators.BlockStateProvider; import net.neoforged.neoforge.client.model.generators.loaders.CompositeModelBuilder; +import net.neoforged.neoforge.registries.DeferredBlock; import java.util.HashMap; import java.util.Locale; @@ -53,15 +52,14 @@ import java.util.function.Supplier; public class MachineBlocks { - private static final BlockRegistry BLOCK_REGISTRY = EnderIOMachines.REGILITE.blockRegistry(); - private static final ItemRegistry ITEM_REGISTRY = EnderIOMachines.REGILITE.itemRegistry(); + private static final RegiliteBlocks BLOCK_REGISTRY = EnderIOMachines.REGILITE.blocks(); - public static final RegiliteBlock FLUID_TANK = BLOCK_REGISTRY - .registerBlock("fluid_tank", props -> new MachineBlock(MachineBlockEntities.FLUID_TANK, props), + public static final DeferredBlock FLUID_TANK = BLOCK_REGISTRY + .create("fluid_tank", props -> new MachineBlock(MachineBlockEntities.FLUID_TANK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .withLootTable(MachinesLootTable::copyComponents) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() + .lootTable(MachinesLootTable::copyComponents) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .blockState((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() .getBuilder(ctx.getName()) .customLoader(CompositeModelBuilder::begin) .child("tank", ModelHelper.getExistingAsBuilder(prov.models(), EnderIOBase.loc(String.format("block/%s_body", ctx.getName())))) @@ -69,20 +67,21 @@ public class MachineBlocks { .end() .texture("particle", EnderIOBase.loc("block/machine_side")) )) - .withBlockItem(ITEM_REGISTRY, + .createBlockItem( block -> new FluidTankItem(block, new Item.Properties(), 16000), item -> item - .setModelProvider((prov, ctx) -> {}) - .withTab(EIOCreativeTabs.MACHINES) - .withCapability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) - ); - - public static final RegiliteBlock PRESSURIZED_FLUID_TANK = BLOCK_REGISTRY - .registerBlock("pressurized_fluid_tank", props -> new MachineBlock(MachineBlockEntities.PRESSURIZED_FLUID_TANK, props), + .model((prov, ctx) -> {}) + .tab(EIOCreativeTabs.MACHINES) + .capability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) + ) + .finish(); + + public static final DeferredBlock PRESSURIZED_FLUID_TANK = BLOCK_REGISTRY + .create("pressurized_fluid_tank", props -> new MachineBlock(MachineBlockEntities.PRESSURIZED_FLUID_TANK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .withLootTable(MachinesLootTable::copyComponents) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() + .lootTable(MachinesLootTable::copyComponents) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .blockState((prov, ctx) -> prov.horizontalBlock(ctx.get(), prov.models() .withExistingParent(ctx.getName(), prov.mcLoc("block/block")) .customLoader(CompositeModelBuilder::begin) .child("tank", ModelHelper.getExistingAsBuilder(prov.models(), EnderIOBase.loc(String.format("block/%s_body", ctx.getName())))) @@ -90,237 +89,261 @@ public class MachineBlocks { .end() .texture("particle", EnderIOBase.loc("block/machine_side")) )) - .withBlockItem(ITEM_REGISTRY, (block) -> new FluidTankItem(block, new Item.Properties(), 32000), + .createBlockItem((block) -> new FluidTankItem(block, new Item.Properties(), 32000), item -> item - .setModelProvider((prov, ctx) -> {}) - .withTab(EIOCreativeTabs.MACHINES) - .withCapability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) - ); - - public static final RegiliteBlock ENCHANTER = BLOCK_REGISTRY - .registerBlock("enchanter", EnchanterBlock::new, + .model((prov, ctx) -> {}) + .tab(EIOCreativeTabs.MACHINES) + .capability(Capabilities.FluidHandler.ITEM, FluidTankItem.FLUID_HANDLER_PROVIDER) + ) + .finish(); + + public static final DeferredBlock ENCHANTER = BLOCK_REGISTRY + .create("enchanter", EnchanterBlock::new, BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion().isViewBlocking((pState, pLevel, pPos) -> false)) - .withLootTable(MachinesLootTable::copyComponents) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider(MachineModelUtil::machineBlock) - .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); - - public static final RegiliteBlock PRIMITIVE_ALLOY_SMELTER = - progressMachine("primitive_alloy_smelter", () -> MachineBlockEntities.PRIMITIVE_ALLOY_SMELTER); - - public static final RegiliteBlock ALLOY_SMELTER = - progressMachine("alloy_smelter", () -> MachineBlockEntities.ALLOY_SMELTER); - - public static final RegiliteBlock PAINTING_MACHINE = - progressMachine("painting_machine", () -> MachineBlockEntities.PAINTING_MACHINE); - - public static final RegiliteBlock WIRED_CHARGER = - machine("wired_charger", () -> MachineBlockEntities.WIRED_CHARGER); - - public static final RegiliteBlock CREATIVE_POWER = BLOCK_REGISTRY - .registerBlock("creative_power", props -> new MachineBlock(MachineBlockEntities.CREATIVE_POWER, props), BlockBehaviour.Properties.of()) - .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); - - public static final RegiliteBlock STIRLING_GENERATOR = - progressMachine("stirling_generator", () -> MachineBlockEntities.STIRLING_GENERATOR); - - public static final RegiliteBlock SAG_MILL = + .lootTable(MachinesLootTable::copyComponents) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .blockState(MachineModelUtil::machineBlock) + .createSimpleBlockItem(item -> item.tab(EIOCreativeTabs.MACHINES)) + .finish(); + + public static final DeferredBlock PRIMITIVE_ALLOY_SMELTER = + progressMachine("primitive_alloy_smelter", () -> MachineBlockEntities.PRIMITIVE_ALLOY_SMELTER) + .finish(); + + public static final DeferredBlock ALLOY_SMELTER = + progressMachine("alloy_smelter", () -> MachineBlockEntities.ALLOY_SMELTER) + .finish(); + + public static final DeferredBlock PAINTING_MACHINE = + progressMachine("painting_machine", () -> MachineBlockEntities.PAINTING_MACHINE) + .finish(); + + public static final DeferredBlock WIRED_CHARGER = + machine("wired_charger", () -> MachineBlockEntities.WIRED_CHARGER) + .finish(); + + public static final DeferredBlock CREATIVE_POWER = BLOCK_REGISTRY + .create("creative_power", props -> new MachineBlock(MachineBlockEntities.CREATIVE_POWER, props), BlockBehaviour.Properties.of()) + .createSimpleBlockItem(item -> item.tab(EIOCreativeTabs.MACHINES)) + .finish(); + + public static final DeferredBlock STIRLING_GENERATOR = + progressMachine("stirling_generator", () -> MachineBlockEntities.STIRLING_GENERATOR) + .finish(); + + public static final DeferredBlock SAG_MILL = progressMachine("sag_mill", () -> MachineBlockEntities.SAG_MILL) - .withTranslation("SAG Mill"); + .translation("SAG Mill") + .finish(); - public static final RegiliteBlock SLICE_AND_SPLICE = + public static final DeferredBlock SLICE_AND_SPLICE = progressMachine("slice_and_splice", () -> MachineBlockEntities.SLICE_AND_SPLICE) - .withTranslation("Slice'N'Splice"); + .translation("Slice'N'Splice") + .finish(); - public static final RegiliteBlock IMPULSE_HOPPER = + public static final DeferredBlock IMPULSE_HOPPER = progressMachine("impulse_hopper", () -> MachineBlockEntities.IMPULSE_HOPPER) - .withTranslation("Impulse Hopper"); + .translation("Impulse Hopper") + .finish(); - public static final RegiliteBlock SOUL_BINDER = + public static final DeferredBlock SOUL_BINDER = progressMachine("soul_binder", () -> MachineBlockEntities.SOUL_BINDER) - .withTranslation("Soul Binder"); + .translation("Soul Binder") + .finish(); - public static final RegiliteBlock POWERED_SPAWNER = BLOCK_REGISTRY - .registerBlock("powered_spawner", properties -> new ProgressMachineBlock(MachineBlockEntities.POWERED_SPAWNER, properties), + public static final DeferredBlock POWERED_SPAWNER = BLOCK_REGISTRY + .create("powered_spawner", properties -> new ProgressMachineBlock(MachineBlockEntities.POWERED_SPAWNER, properties), BlockBehaviour.Properties.of().strength(2.5f, 8)) - .withLootTable((l,t) -> MachinesLootTable.copyStandardComponentsWith(l, t, EIODataComponents.STORED_ENTITY.get())) - .setBlockStateProvider(MachineModelUtil::progressMachineBlock) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockItem(ITEM_REGISTRY, b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), + .lootTable((l,t) -> MachinesLootTable.copyStandardComponentsWith(l, t, EIODataComponents.STORED_ENTITY.get())) + .blockState(MachineModelUtil::progressMachineBlock) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .createBlockItem(b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), item -> item - .withTab(EIOCreativeTabs.MACHINES) - .withTags(EIOTags.Items.ENTITY_STORAGE) - ); + .tab(EIOCreativeTabs.MACHINES) + .tags(EIOTags.Items.ENTITY_STORAGE) + ) + .finish(); - public static final RegiliteBlock VACUUM_CHEST = BLOCK_REGISTRY - .registerBlock("vacuum_chest", p -> new MachineBlock(MachineBlockEntities.VACUUM_CHEST, p), + public static final DeferredBlock VACUUM_CHEST = BLOCK_REGISTRY + .create("vacuum_chest", p -> new MachineBlock(MachineBlockEntities.VACUUM_CHEST, p), BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withLootTable(MachinesLootTable::copyComponents) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); - - public static final RegiliteBlock XP_VACUUM = BLOCK_REGISTRY - .registerBlock("xp_vacuum", p -> new MachineBlock(MachineBlockEntities.XP_VACUUM, p), + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .lootTable(MachinesLootTable::copyComponents) + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .createSimpleBlockItem(item -> item.tab(EIOCreativeTabs.MACHINES)) + .finish(); + + public static final DeferredBlock XP_VACUUM = BLOCK_REGISTRY + .create("xp_vacuum", p -> new MachineBlock(MachineBlockEntities.XP_VACUUM, p), BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withLootTable(MachinesLootTable::copyComponents) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .withTranslation("XP Vacuum") - .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); - - public static final RegiliteBlock TRAVEL_ANCHOR = BLOCK_REGISTRY - .registerBlock("travel_anchor", TravelAnchorBlock::new, BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withLootTable(MachinesLootTable::copyComponents) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .withBlockItem(ITEM_REGISTRY, item -> item.withTab(EIOCreativeTabs.MACHINES)); - - public static final RegiliteBlock PAINTED_TRAVEL_ANCHOR = BLOCK_REGISTRY - .registerBlock("painted_travel_anchor", PaintedTravelAnchorBlock::new, BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockColor(() -> PaintedBlockColor::new) - .withLootTable(DecorLootTable::withPaint) - .setBlockStateProvider((prov, ctx) -> EIOBlockState.paintedBlock("painted_travel_anchor", prov, ctx.get(), Blocks.DIRT, null)) //Any cube will do - .withBlockItem( - ITEM_REGISTRY, + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .lootTable(MachinesLootTable::copyComponents) + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .translation("XP Vacuum") + .createSimpleBlockItem(item -> item.tab(EIOCreativeTabs.MACHINES)) + .finish(); + + public static final DeferredBlock TRAVEL_ANCHOR = BLOCK_REGISTRY + .create("travel_anchor", TravelAnchorBlock::new, BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .lootTable(MachinesLootTable::copyComponents) + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .createSimpleBlockItem(item -> item.tab(EIOCreativeTabs.MACHINES)) + .finish(); + + public static final DeferredBlock PAINTED_TRAVEL_ANCHOR = BLOCK_REGISTRY + .create("painted_travel_anchor", PaintedTravelAnchorBlock::new, BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .blockColor(() -> PaintedBlockColor::new) + .lootTable(DecorLootTable::withPaint) + .blockState((prov, ctx) -> EIOBlockState.paintedBlock("painted_travel_anchor", prov, ctx.get(), Blocks.DIRT, null)) //Any cube will do + .createBlockItem( b -> new PaintedBlockItem(b, new Item.Properties()), - item -> item.setColorSupplier(() -> PaintedBlockColor::new)); + item -> item.itemColor(() -> PaintedBlockColor::new)) + .finish(); - public static final Map> SOLAR_PANELS = Util.make(() -> { - Map> panels = new HashMap<>(); + public static final Map> SOLAR_PANELS = Util.make(() -> { + Map> panels = new HashMap<>(); for (SolarPanelTier tier: SolarPanelTier.values()) { panels.put(tier, solarPanel(tier.name().toLowerCase(Locale.ROOT) + "_photovoltaic_module", () -> MachineBlockEntities.SOLAR_PANELS.get(tier), tier)); } return ImmutableMap.copyOf(panels); }); - public static final Map> CAPACITOR_BANKS = Util.make(() -> { - Map> banks = new HashMap<>(); + public static final Map> CAPACITOR_BANKS = Util.make(() -> { + Map> banks = new HashMap<>(); for (CapacitorTier tier: CapacitorTier.values()) { banks.put(tier, capacitorBank(tier.name().toLowerCase(Locale.ROOT) + "_capacitor_bank", () -> MachineBlockEntities.CAPACITOR_BANKS.get(tier), tier)); } return ImmutableMap.copyOf(banks); }); - public static final RegiliteBlock CRAFTER = - progressMachine("crafter", () -> MachineBlockEntities.CRAFTER); + public static final DeferredBlock CRAFTER = + progressMachine("crafter", () -> MachineBlockEntities.CRAFTER) + .finish(); - public static final RegiliteBlock SOUL_ENGINE = BLOCK_REGISTRY - .registerBlock("soul_engine", p -> new ProgressMachineBlock(MachineBlockEntities.SOUL_ENGINE, p), + public static final DeferredBlock SOUL_ENGINE = BLOCK_REGISTRY + .create("soul_engine", p -> new ProgressMachineBlock(MachineBlockEntities.SOUL_ENGINE, p), BlockBehaviour.Properties.of().strength(2.5f, 8).noOcclusion()) - .withLootTable(MachinesLootTable::copyComponents) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider(MachineModelUtil::progressMachineBlock) - .withBlockItem(ITEM_REGISTRY, b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), + .lootTable(MachinesLootTable::copyComponents) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .blockState(MachineModelUtil::progressMachineBlock) + .createBlockItem(b -> new BlockItem(b, new Item.Properties().component(EIODataComponents.STORED_ENTITY, StoredEntityData.EMPTY)), item -> item - .withTab(EIOCreativeTabs.MACHINES) - .withTags(EIOTags.Items.ENTITY_STORAGE) - ); - - public static final RegiliteBlock DRAIN = - progressMachine("drain", () -> MachineBlockEntities.DRAIN); - - public static final RegiliteBlock VAT = machine("vat", () -> MachineBlockEntities.VAT).withTranslation("VAT"); - - public static final RegiliteBlock BLOCK_DETECTOR = BLOCK_REGISTRY - .registerBlock("block_detector", BlockDetectorBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.OBSERVER)) - .withTags(BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName()))) - .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); - - public static final RegiliteBlock XP_OBELISK = BLOCK_REGISTRY - .registerBlock("xp_obelisk", props -> new MachineBlock(MachineBlockEntities.XP_OBELISK, props), + .tab(EIOCreativeTabs.MACHINES) + .tags(EIOTags.Items.ENTITY_STORAGE) + ) + .finish(); + + public static final DeferredBlock DRAIN = + progressMachine("drain", () -> MachineBlockEntities.DRAIN) + .finish(); + + public static final DeferredBlock VAT = machine("vat", () -> MachineBlockEntities.VAT).translation("VAT").finish(); + + public static final DeferredBlock BLOCK_DETECTOR = BLOCK_REGISTRY + .create("block_detector", BlockDetectorBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.OBSERVER)) + .tags(BlockTags.MINEABLE_WITH_PICKAXE) + .blockState((prov, ctx) -> prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName()))) + .createSimpleBlockItem(item -> item.tab((EIOCreativeTabs.MACHINES))) + .finish(); + + public static final DeferredBlock XP_OBELISK = BLOCK_REGISTRY + .create("xp_obelisk", props -> new MachineBlock(MachineBlockEntities.XP_OBELISK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .withLootTable(MachinesLootTable::copyComponents) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .withTranslation("XP Obelisk") - .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); - - public static final RegiliteBlock INHIBITOR_OBELISK = BLOCK_REGISTRY - .registerBlock("inhibitor_obelisk", props -> new MachineBlock(MachineBlockEntities.INHIBITOR_OBELISK, props), + .lootTable(MachinesLootTable::copyComponents) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .translation("XP Obelisk") + .createSimpleBlockItem(item -> item.tab((EIOCreativeTabs.MACHINES))) + .finish(); + + public static final DeferredBlock INHIBITOR_OBELISK = BLOCK_REGISTRY + .create("inhibitor_obelisk", props -> new MachineBlock(MachineBlockEntities.INHIBITOR_OBELISK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .withLootTable(MachinesLootTable::copyComponents) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); - - public static final RegiliteBlock AVERSION_OBELISK = BLOCK_REGISTRY - .registerBlock("aversion_obelisk", props -> new MachineBlock(MachineBlockEntities.AVERSION_OBELISK, props), + .lootTable(MachinesLootTable::copyComponents) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .createSimpleBlockItem(item -> item.tab((EIOCreativeTabs.MACHINES))) + .finish(); + + public static final DeferredBlock AVERSION_OBELISK = BLOCK_REGISTRY + .create("aversion_obelisk", props -> new MachineBlock(MachineBlockEntities.AVERSION_OBELISK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .withLootTable(MachinesLootTable::copyComponents) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); - - public static final RegiliteBlock RELOCATOR_OBELISK = BLOCK_REGISTRY - .registerBlock("relocator_obelisk", props -> new MachineBlock(MachineBlockEntities.RELOCATOR_OBELISK, props), + .lootTable(MachinesLootTable::copyComponents) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .createSimpleBlockItem(item -> item.tab((EIOCreativeTabs.MACHINES))) + .finish(); + + public static final DeferredBlock RELOCATOR_OBELISK = BLOCK_REGISTRY + .create("relocator_obelisk", props -> new MachineBlock(MachineBlockEntities.RELOCATOR_OBELISK, props), BlockBehaviour.Properties.of().strength(2.5f, 8).isViewBlocking((pState, pLevel, pPos) -> false).noOcclusion()) - .withLootTable(MachinesLootTable::copyComponents) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) - .withBlockItem(ITEM_REGISTRY, item -> item.withTab((EIOCreativeTabs.MACHINES))); + .lootTable(MachinesLootTable::copyComponents) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc("block/" + ctx.getName())))) + .createSimpleBlockItem(item -> item.tab((EIOCreativeTabs.MACHINES))) + .finish(); //used when single methods needs to be overridden in the block class - private static RegiliteBlock baseMachine(RegiliteBlock machineBlock, + private static BlockBuilder baseMachine(BlockBuilder machineBlock, BiConsumer> blockStateProvider) { return machineBlock - .withLootTable(MachinesLootTable::copyComponents) - .withTags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) - .setBlockStateProvider(blockStateProvider) - .withBlockItem(ITEM_REGISTRY, item -> item - .withTab(EIOCreativeTabs.MACHINES) + .lootTable(MachinesLootTable::copyComponents) + .tags(BlockTags.NEEDS_IRON_TOOL, BlockTags.MINEABLE_WITH_PICKAXE) + .blockState(blockStateProvider) + .createSimpleBlockItem(item -> item + .tab(EIOCreativeTabs.MACHINES) ); } - private static RegiliteBlock machine(String name, - Supplier> RegiliteBlockEntity) { + private static BlockBuilder machine(String name, + Supplier> RegiliteBlockEntity) { return baseMachine( - BLOCK_REGISTRY.registerBlock(name, props -> new MachineBlock(RegiliteBlockEntity.get(), props), BlockBehaviour.Properties.of().strength(2.5f, 8)), + BLOCK_REGISTRY.create(name, props -> new MachineBlock(RegiliteBlockEntity.get(), props), BlockBehaviour.Properties.of().strength(2.5f, 8)), MachineModelUtil::machineBlock); } - private static RegiliteBlock progressMachine(String name, - Supplier> RegiliteBlockEntity) { + private static BlockBuilder progressMachine(String name, + Supplier> RegiliteBlockEntity) { return baseMachine( - BLOCK_REGISTRY.registerBlock(name, props -> new ProgressMachineBlock(RegiliteBlockEntity.get(), props), + BLOCK_REGISTRY.create(name, props -> new ProgressMachineBlock(RegiliteBlockEntity.get(), props), BlockBehaviour.Properties.of().strength(2.5f, 8)), MachineModelUtil::progressMachineBlock); } - private static RegiliteBlock solarPanel(String name, Supplier> RegiliteBlockEntity, SolarPanelTier tier) { + private static DeferredBlock solarPanel(String name, Supplier> RegiliteBlockEntity, SolarPanelTier tier) { return BLOCK_REGISTRY - .registerBlock(name, props -> new SolarPanelBlock(RegiliteBlockEntity.get(), props, tier), + .create(name, props -> new SolarPanelBlock(RegiliteBlockEntity.get(), props, tier), BlockBehaviour.Properties.of().strength(2.5f, 8)) - .setBlockStateProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) - .withTags(BlockTags.MINEABLE_WITH_PICKAXE) - .withLootTable(MachinesLootTable::copyComponents) - .withBlockItem(ITEM_REGISTRY, item -> item - .setModelProvider((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) - .withTab(EIOCreativeTabs.MACHINES) - .withTags(EIOTags.Items.ENTITY_STORAGE) - ); + .blockState((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) + .tags(BlockTags.MINEABLE_WITH_PICKAXE) + .lootTable(MachinesLootTable::copyComponents) + .createSimpleBlockItem(item -> item + .model((prov, ctx) -> MachineModelUtil.solarPanel(prov, ctx, tier)) + .tab(EIOCreativeTabs.MACHINES) + .tags(EIOTags.Items.ENTITY_STORAGE) + ) + .finish(); } - private static RegiliteBlock capacitorBank(String name, Supplier> RegiliteBlockEntity, CapacitorTier tier) { + private static DeferredBlock capacitorBank(String name, Supplier> RegiliteBlockEntity, CapacitorTier tier) { return BLOCK_REGISTRY - .registerBlock(name, props -> new CapacitorBankBlock(props, RegiliteBlockEntity.get(), tier), + .create(name, props -> new CapacitorBankBlock(props, RegiliteBlockEntity.get(), tier), BlockBehaviour.Properties.of().strength(2.5f, 8)) - .setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc(ctx.getName())))) - .withLootTable(MachinesLootTable::copyComponents) - .withTags(BlockTags.MINEABLE_WITH_PICKAXE) - .withBlockItem(ITEM_REGISTRY, + .blockState((prov, ctx) -> prov.simpleBlock(ctx.get(), prov.models().getExistingFile(EnderIOBase.loc(ctx.getName())))) + .lootTable(MachinesLootTable::copyComponents) + .tags(BlockTags.MINEABLE_WITH_PICKAXE) + .createBlockItem( block -> new CapacitorBankItem(block, new Item.Properties()), item -> item - .setModelProvider((prov, ctx) -> {}) - .withTab(EIOCreativeTabs.MACHINES) - .withCapability(Capabilities.EnergyStorage.ITEM, CapacitorBankItem.ENERGY_STORAGE_PROVIDER) - ); + .model((prov, ctx) -> {}) + .tab(EIOCreativeTabs.MACHINES) + .capability(Capabilities.EnergyStorage.ITEM, CapacitorBankItem.ENERGY_STORAGE_PROVIDER) + ) + .finish(); } - public static void register(IEventBus bus) { - BLOCK_REGISTRY.register(bus); - ITEM_REGISTRY.register(bus); + public static void register() { } } diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineMenus.java b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineMenus.java index 70d8123b2..cc2576fda 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineMenus.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/init/MachineMenus.java @@ -49,64 +49,87 @@ import com.enderio.machines.common.menu.WiredChargerMenu; import com.enderio.machines.common.menu.XPObeliskMenu; import com.enderio.machines.common.menu.XPVacuumMenu; -import com.enderio.regilite.holder.RegiliteMenu; -import com.enderio.regilite.registry.MenuRegistry; -import net.neoforged.bus.api.IEventBus; +import com.enderio.regilite.menus.RegiliteMenuTypes; +import net.minecraft.world.inventory.MenuType; + +import java.util.function.Supplier; public class MachineMenus { private MachineMenus() {} - private static final MenuRegistry MENU_REGISTRY = EnderIOMachines.REGILITE.menuRegistry(); + private static final RegiliteMenuTypes MENU_TYPES = EnderIOMachines.REGILITE.menuTypes(); - public static final RegiliteMenu FLUID_TANK = MENU_REGISTRY - .registerMenu("fluid_tank", FluidTankMenu::factory, () -> FluidTankScreen::new); - public static final RegiliteMenu ENCHANTER = MENU_REGISTRY - .registerMenu("enchanter", EnchanterMenu::factory, () -> EnchanterScreen::new); - public static final RegiliteMenu PRIMITIVE_ALLOY_SMELTER = MENU_REGISTRY - .registerMenu("primitive_alloy_smelter", PrimitiveAlloySmelterMenu::factory, () -> PrimitiveAlloySmelterScreen::new); - public static final RegiliteMenu ALLOY_SMELTER = MENU_REGISTRY - .registerMenu("alloy_smelter", AlloySmelterMenu::factory, () -> AlloySmelterScreen::new); - public static final RegiliteMenu SAG_MILL = MENU_REGISTRY - .registerMenu("sag_mill", SagMillMenu::factory, () -> SagMillScreen::new); - public static final RegiliteMenu STIRLING_GENERATOR = MENU_REGISTRY - .registerMenu("stirling_generator", StirlingGeneratorMenu::factory, () -> StirlingGeneratorScreen::new); - public static final RegiliteMenu SLICE_N_SPLICE = MENU_REGISTRY - .registerMenu("slice_n_splice", SlicerMenu::factory, () -> SlicerScreen::new); - public static final RegiliteMenu IMPULSE_HOPPER = MENU_REGISTRY - .registerMenu("impulse_hopper", ImpulseHopperMenu::factory, () -> ImpulseHopperScreen::new); - public static final RegiliteMenu SOUL_BINDER = MENU_REGISTRY - .registerMenu("soul_binder", SoulBinderMenu::factory, () -> SoulBinderScreen::new); - public static final RegiliteMenu POWERED_SPAWNER = MENU_REGISTRY - .registerMenu("powered_spawner", PoweredSpawnerMenu::factory, () -> PoweredSpawnerScreen::new); - public static final RegiliteMenu VACUUM_CHEST = MENU_REGISTRY - .registerMenu("vacuum_chest", VacuumChestMenu::factory, () -> VacuumChestScreen::new); - public static final RegiliteMenu XP_VACUUM = MENU_REGISTRY - .registerMenu("xp_vacuum", XPVacuumMenu::factory, () -> XPVacuumScreen::new); - public static final RegiliteMenu CRAFTER = MENU_REGISTRY - .registerMenu("crafter", CrafterMenu::factory, () -> CrafterScreen::new); - public static final RegiliteMenu DRAIN = MENU_REGISTRY - .registerMenu("drain", DrainMenu::factory, () -> DrainScreen::new); - public static final RegiliteMenu WIRED_CHARGER = MENU_REGISTRY - .registerMenu("wired_charger", WiredChargerMenu::factory, () -> WiredChargerScreen::new); - public static final RegiliteMenu PAINTING_MACHINE = MENU_REGISTRY - .registerMenu("painting_machine", PaintingMachineMenu::factory, () -> PaintingMachineScreen::new); - public static final RegiliteMenu CAPACITOR_BANK = MENU_REGISTRY - .registerMenu("capacitor_bank", CapacitorBankMenu::factory, () -> CapacitorBankScreen::new); - public static final RegiliteMenu SOUL_ENGINE = MENU_REGISTRY - .registerMenu("soul_engine", SoulEngineMenu::factory, () -> SoulEngineScreen::new); - public static final RegiliteMenu TRAVEL_ANCHOR = MENU_REGISTRY - .registerMenu("travel_anchor", TravelAnchorMenu::factory, () -> TravelAnchorScreen::new); - public static final RegiliteMenu XP_OBELISK = MENU_REGISTRY - .registerMenu("xp_obelisk", XPObeliskMenu::factory, () -> XPObeliskScreen::new); - public static final RegiliteMenu INHIBITOR_OBELISK = MENU_REGISTRY - .registerMenu("inhibitor_obelisk", InhibitorObeliskMenu::factory, () -> InhibitorObeliskScreen::new); - public static final RegiliteMenu AVERSION_OBELISK = MENU_REGISTRY - .registerMenu("aversion_obelisk", AversionObeliskMenu::factory, () -> AversionObeliskScreen::new); - public static final RegiliteMenu RELOCATOR_OBELISK = MENU_REGISTRY - .registerMenu("relocator_obelisk", RelocatorObeliskMenu::factory, () -> RelocatorObeliskScreen::new); - public static final RegiliteMenu VAT = MENU_REGISTRY.registerMenu("vat", VatMenu::factory, () -> VatScreen::new); + public static final java.util.function.Supplier> FLUID_TANK = MENU_TYPES + .createOnly("fluid_tank", FluidTankMenu::factory, () -> FluidTankScreen::new); + + public static final Supplier> ENCHANTER = MENU_TYPES + .createOnly("enchanter", EnchanterMenu::factory, () -> EnchanterScreen::new); + + public static final Supplier> PRIMITIVE_ALLOY_SMELTER = MENU_TYPES + .createOnly("primitive_alloy_smelter", PrimitiveAlloySmelterMenu::factory, () -> PrimitiveAlloySmelterScreen::new); + + public static final Supplier> ALLOY_SMELTER = MENU_TYPES + .createOnly("alloy_smelter", AlloySmelterMenu::factory, () -> AlloySmelterScreen::new); + + public static final Supplier> SAG_MILL = MENU_TYPES + .createOnly("sag_mill", SagMillMenu::factory, () -> SagMillScreen::new); + + public static final Supplier> STIRLING_GENERATOR = MENU_TYPES + .createOnly("stirling_generator", StirlingGeneratorMenu::factory, () -> StirlingGeneratorScreen::new); + + public static final Supplier> SLICE_N_SPLICE = MENU_TYPES + .createOnly("slice_n_splice", SlicerMenu::factory, () -> SlicerScreen::new); + + public static final Supplier> IMPULSE_HOPPER = MENU_TYPES + .createOnly("impulse_hopper", ImpulseHopperMenu::factory, () -> ImpulseHopperScreen::new); + + public static final Supplier> SOUL_BINDER = MENU_TYPES + .createOnly("soul_binder", SoulBinderMenu::factory, () -> SoulBinderScreen::new); + + public static final Supplier> POWERED_SPAWNER = MENU_TYPES + .createOnly("powered_spawner", PoweredSpawnerMenu::factory, () -> PoweredSpawnerScreen::new); + + public static final Supplier> VACUUM_CHEST = MENU_TYPES + .createOnly("vacuum_chest", VacuumChestMenu::factory, () -> VacuumChestScreen::new); + + public static final Supplier> XP_VACUUM = MENU_TYPES + .createOnly("xp_vacuum", XPVacuumMenu::factory, () -> XPVacuumScreen::new); + + public static final Supplier> CRAFTER = MENU_TYPES + .createOnly("crafter", CrafterMenu::factory, () -> CrafterScreen::new); + + public static final Supplier> DRAIN = MENU_TYPES + .createOnly("drain", DrainMenu::factory, () -> DrainScreen::new); + + public static final Supplier> WIRED_CHARGER = MENU_TYPES + .createOnly("wired_charger", WiredChargerMenu::factory, () -> WiredChargerScreen::new); + + public static final Supplier> PAINTING_MACHINE = MENU_TYPES + .createOnly("painting_machine", PaintingMachineMenu::factory, () -> PaintingMachineScreen::new); + + public static final Supplier> CAPACITOR_BANK = MENU_TYPES + .createOnly("capacitor_bank", CapacitorBankMenu::factory, () -> CapacitorBankScreen::new); + + public static final Supplier> SOUL_ENGINE = MENU_TYPES + .createOnly("soul_engine", SoulEngineMenu::factory, () -> SoulEngineScreen::new); + + public static final Supplier> TRAVEL_ANCHOR = MENU_TYPES + .createOnly("travel_anchor", TravelAnchorMenu::factory, () -> TravelAnchorScreen::new); + + public static final Supplier> XP_OBELISK = MENU_TYPES + .createOnly("xp_obelisk", XPObeliskMenu::factory, () -> XPObeliskScreen::new); + + public static final Supplier> INHIBITOR_OBELISK = MENU_TYPES + .createOnly("inhibitor_obelisk", InhibitorObeliskMenu::factory, () -> InhibitorObeliskScreen::new); + + public static final Supplier> AVERSION_OBELISK = MENU_TYPES + .createOnly("aversion_obelisk", AversionObeliskMenu::factory, () -> AversionObeliskScreen::new); + + public static final Supplier> RELOCATOR_OBELISK = MENU_TYPES + .createOnly("relocator_obelisk", RelocatorObeliskMenu::factory, () -> RelocatorObeliskScreen::new); + + public static final Supplier> VAT = MENU_TYPES.createOnly("vat", VatMenu::factory, () -> VatScreen::new); - public static void register(IEventBus bus) { - MENU_REGISTRY.register(bus); + public static void register() { } } diff --git a/enderio-machines/src/main/java/com/enderio/machines/common/lang/MachineEnumLang.java b/enderio-machines/src/main/java/com/enderio/machines/common/lang/MachineEnumLang.java index 66c80c859..b89ab39d0 100644 --- a/enderio-machines/src/main/java/com/enderio/machines/common/lang/MachineEnumLang.java +++ b/enderio-machines/src/main/java/com/enderio/machines/common/lang/MachineEnumLang.java @@ -19,8 +19,7 @@ private static > EnumTranslationMap.Builder builder(Class> finshedSoulDataConsumer) addSpawnerData(EntityType.ZOMBIFIED_PIGLIN, 32_000, SpawnerMachineTask.SpawnType.ENTITY_TYPE, finshedSoulDataConsumer); addEngineData(EntityType.BLAZE, FluidTags.LAVA, 300, 15, finshedSoulDataConsumer); - addEngineData(EntityType.ZOMBIE, EIOFluids.NUTRIENT_DISTILLATION.getSource(), 500, 15, finshedSoulDataConsumer); - addEngineData(EntityType.ZOMBIE_VILLAGER, EIOFluids.NUTRIENT_DISTILLATION.getSource(), 500, 15, finshedSoulDataConsumer); - addEngineData(EntityType.HUSK, EIOFluids.NUTRIENT_DISTILLATION.getSource(), 500, 15, finshedSoulDataConsumer); - addEngineData(EntityType.ENDERMAN, EIOFluids.DEW_OF_THE_VOID.getSource(), 900, 10, finshedSoulDataConsumer); + addEngineData(EntityType.ZOMBIE, EIOFluids.NUTRIENT_DISTILLATION.sourceFluid(), 500, 15, finshedSoulDataConsumer); + addEngineData(EntityType.ZOMBIE_VILLAGER, EIOFluids.NUTRIENT_DISTILLATION.sourceFluid(), 500, 15, finshedSoulDataConsumer); + addEngineData(EntityType.HUSK, EIOFluids.NUTRIENT_DISTILLATION.sourceFluid(), 500, 15, finshedSoulDataConsumer); + addEngineData(EntityType.ENDERMAN, EIOFluids.DEW_OF_THE_VOID.sourceFluid(), 900, 10, finshedSoulDataConsumer); addSolarData(EntityType.PHANTOM, false, true, null, finshedSoulDataConsumer); } diff --git a/gradle.properties b/gradle.properties index dd5518cdd..87c90b19a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,7 @@ neoForge.parchment.minecraftVersion=1.21 neoForge.parchment.mappingsVersion=2024.07.28 # Dependencies -regiliteVersion=0.1-dev+e18b37c +regiliteVersion=0.1-dev+79217f5 jeiMinecraftVersion=1.21.1 jeiVersion=19.18.10.218 From c2fa80b48bb9bc2fcaca9c9fb4dcb2e810f3ea5a Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:49:43 +0100 Subject: [PATCH 7/7] chore: Switch to 21.1.0.0-pre1 on maven --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 87c90b19a..b34e4eff0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,7 @@ neoForge.parchment.minecraftVersion=1.21 neoForge.parchment.mappingsVersion=2024.07.28 # Dependencies -regiliteVersion=0.1-dev+79217f5 +regiliteVersion=21.1.0.0-pre1 jeiMinecraftVersion=1.21.1 jeiVersion=19.18.10.218