From ce9aa00a0b699c3bec7f5b31e563b2fa9505577a Mon Sep 17 00:00:00 2001 From: LambdAurora Date: Wed, 9 Aug 2023 00:31:36 +0200 Subject: [PATCH] Fix missing copper sulfate wall lantern and possibly more. --- CHANGELOG.md | 4 +++ gradle.properties | 2 +- .../lambdaurora/aurorasdeco/AurorasDeco.java | 14 +++++---- .../registry/AurorasDecoRegistry.java | 29 +++++++++++-------- .../data/aurorasdeco/tags/blocks/benches.json | 16 ++++++++++ .../data/aurorasdeco/tags/blocks/shelves.json | 16 ++++++++++ .../tags/blocks/small_log_piles.json | 16 ++++++++++ .../data/aurorasdeco/tags/blocks/stumps.json | 15 ++++++++++ .../tags/blocks/wall_lanterns.json | 10 +++++++ 9 files changed, 104 insertions(+), 18 deletions(-) create mode 100644 src/main/resources/data/aurorasdeco/tags/blocks/benches.json create mode 100644 src/main/resources/data/aurorasdeco/tags/blocks/shelves.json create mode 100644 src/main/resources/data/aurorasdeco/tags/blocks/small_log_piles.json create mode 100644 src/main/resources/data/aurorasdeco/tags/blocks/stumps.json create mode 100644 src/main/resources/data/aurorasdeco/tags/blocks/wall_lanterns.json diff --git a/CHANGELOG.md b/CHANGELOG.md index d26db46d..141ba0db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,4 +79,8 @@ - Fixed some issues with the detection of wood types. - Fixed compatibility issues with other mods by requiring a fixed version of QSL. +### 1.0.0-beta.15 + +- Fixed missing copper sulfate wall lantern and possibly more. + [EMI]: https://modrinth.com/mod/emi "EMI Modrinth page" diff --git a/gradle.properties b/gradle.properties index c1fdb2f9..38b3fe68 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx1G # Mod properties -mod_version=1.0.0-beta.14 +mod_version=1.0.0-beta.15 maven_group=dev.lambdaurora archives_base_name=aurorasdecorations modrinth_id=GOqAnOfW diff --git a/src/main/java/dev/lambdaurora/aurorasdeco/AurorasDeco.java b/src/main/java/dev/lambdaurora/aurorasdeco/AurorasDeco.java index b04cdd9d..89e2b7da 100644 --- a/src/main/java/dev/lambdaurora/aurorasdeco/AurorasDeco.java +++ b/src/main/java/dev/lambdaurora/aurorasdeco/AurorasDeco.java @@ -28,6 +28,7 @@ import dev.lambdaurora.aurorasdeco.util.AuroraUtil; import dev.lambdaurora.aurorasdeco.world.gen.DynamicWorldGen; import net.minecraft.block.Blocks; +import net.minecraft.item.Item; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.resource.ResourceType; @@ -61,17 +62,20 @@ public void onInitialize(ModContainer mod) { AurorasDecoRegistry.init(); RegistryMonitor.create(Registries.ITEM).forAll(context -> { - if (AuroraUtil.idEqual(context.id(), "pockettools", "pocket_cactus")) { + Identifier id = context.id(); + Item item = context.value(); + + if (AuroraUtil.idEqual(id, "pockettools", "pocket_cactus")) { Registry.register(Registries.BLOCK, id("big_flower_pot/pocket_cactus"), - PottedPlantType.register("pocket_cactus", Blocks.POTTED_CACTUS, context.value(), + PottedPlantType.register("pocket_cactus", Blocks.POTTED_CACTUS, item, type -> new BigPottedCactusBlock(type, BigPottedCactusBlock.POCKET_CACTUS_SHAPE))); - } else if (PottedPlantType.isValidPlant(context.value())) { - var potBlock = PottedPlantType.registerFromItem(context.value()); + } else if (PottedPlantType.isValidPlant(item)) { + var potBlock = PottedPlantType.registerFromItem(item); if (potBlock != null) Registry.register(Registries.BLOCK, id("big_flower_pot/" + potBlock.getPlantType().getId()), potBlock); } - BlackboardColor.tryRegisterColorFromItem(context.id(), context.value()); + BlackboardColor.tryRegisterColorFromItem(id, item); }); ItemTree.init(); diff --git a/src/main/java/dev/lambdaurora/aurorasdeco/registry/AurorasDecoRegistry.java b/src/main/java/dev/lambdaurora/aurorasdeco/registry/AurorasDecoRegistry.java index 7b6da78a..b9408b2c 100644 --- a/src/main/java/dev/lambdaurora/aurorasdeco/registry/AurorasDecoRegistry.java +++ b/src/main/java/dev/lambdaurora/aurorasdeco/registry/AurorasDecoRegistry.java @@ -368,6 +368,7 @@ private AurorasDecoRegistry() { .build() ); public static final WallLanternBlock AMETHYST_WALL_LANTERN_BLOCK = LanternRegistry.registerWallLantern(AMETHYST_LANTERN_BLOCK); + public static final WallLanternBlock COPPER_SULFATE_WALL_LANTERN_BLOCK = LanternRegistry.registerWallLantern(COPPER_SULFATE_LANTERN_BLOCK); //endregion public static final WindChimeBlock WIND_CHIME_BLOCK = registerWithItem("wind_chime", @@ -603,32 +604,36 @@ public static void init() { if ((id.getNamespace().equals("betternether") || id.getNamespace().equals("betterend")) && (id.getPath().contains("stripped") || (id.getPath().contains("mushroom") && !id.getPath().contains("mushroom_fir")) || id.getPath().contains("amaranita"))) return false; - return !id.getNamespace().equals("aurorasdeco") && !id.getPath().contains("sign_post"); + return !(id.getNamespace().equals("aurorasdeco") && id.getPath().contains("sign_post")); }) .forAll(context -> { - if (context.value() instanceof FlowerPotBlock flowerPotBlock) { + Identifier id = context.id(); + Block block = context.value(); + + if (block instanceof FlowerPotBlock flowerPotBlock) { if (flowerPotBlock == Blocks.FLOWER_POT) return; context.register( - AurorasDeco.id(AuroraUtil.getIdPath("hanging_flower_pot", context.id(), "^potted[_/]")), + AurorasDeco.id(AuroraUtil.getIdPath("hanging_flower_pot", id, "^potted[_/]")), new HangingFlowerPotBlock(flowerPotBlock) ); } else { - WoodType.onBlockRegister(context.id(), context.value()); - if (context.value() instanceof FenceBlock fenceBlock) { + WoodType.onBlockRegister(id, block); + if (block instanceof FenceBlock fenceBlock) { var signPostBlock = Registry.register( context.registry(), - AurorasDeco.id(AuroraUtil.getIdPath("sign_post", context.id(), "_fence$")), + AurorasDeco.id(AuroraUtil.getIdPath("sign_post", id, "_fence$")), new SignPostBlock(fenceBlock) ); SIGN_POST_BLOCK_ENTITY_TYPE.addSupportedBlock(signPostBlock); - } else LanternRegistry.tryRegisterWallLantern(context.registry(), context.value(), context.id()); + } else LanternRegistry.tryRegisterWallLantern(context.registry(), block, id); } }); RegistryMonitor.create(Registries.ITEM).filter(context -> context.value() instanceof BlockItem item) .forAll(context -> { + Identifier id = context.id(); var accessor = (BlockItemAccessor) context.value(); var item = (BlockItem) context.value(); @@ -637,20 +642,20 @@ public static void init() { if (lanternBlock != null) accessor.aurorasdeco$setWallBlock(lanternBlock); Item.BLOCK_ITEMS.put(lanternBlock, item); - } else if (item.getBlock() instanceof CandleBlock candleBlock && context.id().getNamespace().equals("minecraft")) { + } else if (item.getBlock() instanceof CandleBlock candleBlock && id.getNamespace().equals("minecraft")) { var wall = registerBlock( - "wall_" + context.id().getPath(), + "wall_" + id.getPath(), new WallCandleBlock(candleBlock) ); var chandelier = registerBlock( - "chandelier/" + context.id().getPath().replace("_candle", ""), + "chandelier/" + id.getPath().replace("_candle", ""), new ChandelierBlock(candleBlock) ); accessor.aurorasdeco$setWallBlock(wall); accessor.aurorasdeco$setCeilingBlock(chandelier); - Item.BLOCK_ITEMS.put(wall, context.value()); - Item.BLOCK_ITEMS.put(chandelier, context.value()); + Item.BLOCK_ITEMS.put(wall, item); + Item.BLOCK_ITEMS.put(chandelier, item); } }); diff --git a/src/main/resources/data/aurorasdeco/tags/blocks/benches.json b/src/main/resources/data/aurorasdeco/tags/blocks/benches.json new file mode 100644 index 00000000..2afa757c --- /dev/null +++ b/src/main/resources/data/aurorasdeco/tags/blocks/benches.json @@ -0,0 +1,16 @@ +{ + "replace": false, + "values": [ + "aurorasdeco:bench/oak", + "aurorasdeco:bench/spruce", + "aurorasdeco:bench/birch", + "aurorasdeco:bench/jungle", + "aurorasdeco:bench/acacia", + "aurorasdeco:bench/dark_oak", + "aurorasdeco:bench/mangrove", + "aurorasdeco:bench/cherry", + "aurorasdeco:bench/bamboo", + "aurorasdeco:bench/crimson", + "aurorasdeco:bench/warped" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/aurorasdeco/tags/blocks/shelves.json b/src/main/resources/data/aurorasdeco/tags/blocks/shelves.json new file mode 100644 index 00000000..0a26720a --- /dev/null +++ b/src/main/resources/data/aurorasdeco/tags/blocks/shelves.json @@ -0,0 +1,16 @@ +{ + "replace": false, + "values": [ + "aurorasdeco:shelf/oak", + "aurorasdeco:shelf/spruce", + "aurorasdeco:shelf/birch", + "aurorasdeco:shelf/jungle", + "aurorasdeco:shelf/acacia", + "aurorasdeco:shelf/dark_oak", + "aurorasdeco:shelf/mangrove", + "aurorasdeco:shelf/cherry", + "aurorasdeco:shelf/bamboo", + "aurorasdeco:shelf/crimson", + "aurorasdeco:shelf/warped" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/aurorasdeco/tags/blocks/small_log_piles.json b/src/main/resources/data/aurorasdeco/tags/blocks/small_log_piles.json new file mode 100644 index 00000000..db29f30b --- /dev/null +++ b/src/main/resources/data/aurorasdeco/tags/blocks/small_log_piles.json @@ -0,0 +1,16 @@ +{ + "replace": false, + "values": [ + "aurorasdeco:small_log_pile/oak", + "aurorasdeco:small_log_pile/spruce", + "aurorasdeco:small_log_pile/birch", + "aurorasdeco:small_log_pile/jungle", + "aurorasdeco:small_log_pile/acacia", + "aurorasdeco:small_log_pile/dark_oak", + "aurorasdeco:small_log_pile/mangrove", + "aurorasdeco:small_log_pile/cherry", + "aurorasdeco:small_log_pile/bamboo", + "aurorasdeco:small_log_pile/crimson", + "aurorasdeco:small_log_pile/warped" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/aurorasdeco/tags/blocks/stumps.json b/src/main/resources/data/aurorasdeco/tags/blocks/stumps.json new file mode 100644 index 00000000..967a8f91 --- /dev/null +++ b/src/main/resources/data/aurorasdeco/tags/blocks/stumps.json @@ -0,0 +1,15 @@ +{ + "replace": false, + "values": [ + "aurorasdeco:stump/oak", + "aurorasdeco:stump/spruce", + "aurorasdeco:stump/birch", + "aurorasdeco:stump/jungle", + "aurorasdeco:stump/acacia", + "aurorasdeco:stump/dark_oak", + "aurorasdeco:stump/mangrove", + "aurorasdeco:stump/cherry", + "aurorasdeco:stump/crimson", + "aurorasdeco:stump/warped" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/aurorasdeco/tags/blocks/wall_lanterns.json b/src/main/resources/data/aurorasdeco/tags/blocks/wall_lanterns.json new file mode 100644 index 00000000..c8ca706f --- /dev/null +++ b/src/main/resources/data/aurorasdeco/tags/blocks/wall_lanterns.json @@ -0,0 +1,10 @@ +{ + "replace": false, + "values": [ + "aurorasdeco:wall_lantern/amethyst", + "aurorasdeco:wall_lantern/soul", + "aurorasdeco:wall_lantern/copper_sulfate", + "aurorasdeco:wall_lantern/redstone", + "aurorasdeco:wall_lantern" + ] +} \ No newline at end of file