From 36b5114da382c64b4d5c0b2101ae64eda26ac12e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 15 Feb 2023 22:59:14 +0100 Subject: [PATCH] still allow using the nether altar layout --- .../minecraft/tags/blocks/mineable/axe.json | 18 ++--- .../tags/blocks/mineable/pickaxe.json | 70 +++++++++---------- .../tags/blocks/altar_fancy_brick.json | 6 ++ .../tags/blocks/altar_gold_brick.json | 6 ++ .../naturesaura/tags/blocks/altar_stone.json | 3 +- .../naturesaura/tags/blocks/altar_wood.json | 4 +- .../tags/blocks/nether_altar_stone.json | 5 -- .../tags/blocks/nether_altar_wood.json | 6 -- .../naturesaura/api/multiblock/Matcher.java | 2 +- .../naturesaura/blocks/multi/Multiblocks.java | 29 ++++---- .../naturesaura/data/BlockTagProvider.java | 12 ++-- 11 files changed, 82 insertions(+), 79 deletions(-) create mode 100644 src/generated/resources/data/naturesaura/tags/blocks/altar_fancy_brick.json create mode 100644 src/generated/resources/data/naturesaura/tags/blocks/altar_gold_brick.json delete mode 100644 src/generated/resources/data/naturesaura/tags/blocks/nether_altar_stone.json delete mode 100644 src/generated/resources/data/naturesaura/tags/blocks/nether_altar_wood.json diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json index 20b33cdb..7768f8ff 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -1,15 +1,15 @@ { "values": [ - "naturesaura:ancient_planks", - "naturesaura:auto_crafter", - "naturesaura:ancient_bark", - "naturesaura:ancient_log", - "naturesaura:oak_generator", "naturesaura:flower_generator", - "naturesaura:ancient_stairs", - "naturesaura:wood_stand", - "naturesaura:ancient_slab", + "naturesaura:ancient_log", "naturesaura:offering_table", - "naturesaura:nether_wart_mushroom" + "naturesaura:ancient_planks", + "naturesaura:ancient_stairs", + "naturesaura:oak_generator", + "naturesaura:wood_stand", + "naturesaura:ancient_bark", + "naturesaura:ancient_slab", + "naturesaura:nether_wart_mushroom", + "naturesaura:auto_crafter" ] } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index b802a11e..3d984636 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -1,46 +1,46 @@ { "values": [ - "naturesaura:item_distributor", - "naturesaura:powder_placer", - "naturesaura:animal_generator", - "naturesaura:nature_altar", - "naturesaura:infused_slab", "naturesaura:spring", - "naturesaura:chorus_generator", - "naturesaura:snow_creator", - "naturesaura:hopper_upgrade", - "naturesaura:animal_spawner", - "naturesaura:infused_stone", - "naturesaura:projectile_generator", - "naturesaura:grated_chute", - "naturesaura:animal_container", - "naturesaura:placer", - "naturesaura:infused_brick", - "naturesaura:blast_furnace_booster", - "naturesaura:rf_converter", - "naturesaura:firework_generator", + "naturesaura:aura_detector", + "naturesaura:infused_slab", "naturesaura:tainted_gold_block", - "naturesaura:moss_generator", - "naturesaura:gold_brick", + "naturesaura:grated_chute", + "naturesaura:snow_creator", + "naturesaura:infused_brick", "naturesaura:weather_changer", "naturesaura:infused_brick_slab", - "naturesaura:pickup_stopper", - "naturesaura:spawn_lamp", - "naturesaura:aura_detector", "naturesaura:field_creator", - "naturesaura:conversion_catalyst", - "naturesaura:chunk_loader", - "naturesaura:aura_timer", - "naturesaura:potion_generator", + "naturesaura:infused_stone", "naturesaura:time_changer", - "naturesaura:infused_iron_block", - "naturesaura:gold_nether_brick", - "naturesaura:ender_crate", - "naturesaura:infused_brick_stairs", - "naturesaura:crushing_catalyst", - "naturesaura:nether_grass", - "naturesaura:generator_limit_remover", + "naturesaura:nature_altar", + "naturesaura:placer", + "naturesaura:firework_generator", "naturesaura:infused_stairs", - "naturesaura:furnace_heater" + "naturesaura:projectile_generator", + "naturesaura:item_distributor", + "naturesaura:chunk_loader", + "naturesaura:rf_converter", + "naturesaura:spawn_lamp", + "naturesaura:blast_furnace_booster", + "naturesaura:nether_grass", + "naturesaura:animal_container", + "naturesaura:moss_generator", + "naturesaura:generator_limit_remover", + "naturesaura:pickup_stopper", + "naturesaura:aura_timer", + "naturesaura:animal_spawner", + "naturesaura:ender_crate", + "naturesaura:animal_generator", + "naturesaura:chorus_generator", + "naturesaura:hopper_upgrade", + "naturesaura:furnace_heater", + "naturesaura:potion_generator", + "naturesaura:infused_brick_stairs", + "naturesaura:infused_iron_block", + "naturesaura:powder_placer", + "naturesaura:crushing_catalyst", + "naturesaura:conversion_catalyst", + "naturesaura:gold_nether_brick", + "naturesaura:gold_brick" ] } \ No newline at end of file diff --git a/src/generated/resources/data/naturesaura/tags/blocks/altar_fancy_brick.json b/src/generated/resources/data/naturesaura/tags/blocks/altar_fancy_brick.json new file mode 100644 index 00000000..680ad730 --- /dev/null +++ b/src/generated/resources/data/naturesaura/tags/blocks/altar_fancy_brick.json @@ -0,0 +1,6 @@ +{ + "values": [ + "minecraft:red_nether_bricks", + "minecraft:chiseled_stone_bricks" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/naturesaura/tags/blocks/altar_gold_brick.json b/src/generated/resources/data/naturesaura/tags/blocks/altar_gold_brick.json new file mode 100644 index 00000000..f0d33b7d --- /dev/null +++ b/src/generated/resources/data/naturesaura/tags/blocks/altar_gold_brick.json @@ -0,0 +1,6 @@ +{ + "values": [ + "naturesaura:gold_brick", + "naturesaura:gold_nether_brick" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/naturesaura/tags/blocks/altar_stone.json b/src/generated/resources/data/naturesaura/tags/blocks/altar_stone.json index 4e8242d1..f0824f50 100644 --- a/src/generated/resources/data/naturesaura/tags/blocks/altar_stone.json +++ b/src/generated/resources/data/naturesaura/tags/blocks/altar_stone.json @@ -1,5 +1,6 @@ { "values": [ - "#minecraft:stone_bricks" + "#minecraft:stone_bricks", + "minecraft:nether_bricks" ] } \ No newline at end of file diff --git a/src/generated/resources/data/naturesaura/tags/blocks/altar_wood.json b/src/generated/resources/data/naturesaura/tags/blocks/altar_wood.json index 97fee2c0..2ea584fd 100644 --- a/src/generated/resources/data/naturesaura/tags/blocks/altar_wood.json +++ b/src/generated/resources/data/naturesaura/tags/blocks/altar_wood.json @@ -1,5 +1,7 @@ { "values": [ - "#minecraft:planks" + "#minecraft:planks", + "minecraft:crimson_planks", + "minecraft:warped_planks" ] } \ No newline at end of file diff --git a/src/generated/resources/data/naturesaura/tags/blocks/nether_altar_stone.json b/src/generated/resources/data/naturesaura/tags/blocks/nether_altar_stone.json deleted file mode 100644 index 1349e155..00000000 --- a/src/generated/resources/data/naturesaura/tags/blocks/nether_altar_stone.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "minecraft:nether_bricks" - ] -} \ No newline at end of file diff --git a/src/generated/resources/data/naturesaura/tags/blocks/nether_altar_wood.json b/src/generated/resources/data/naturesaura/tags/blocks/nether_altar_wood.json deleted file mode 100644 index a7bc8138..00000000 --- a/src/generated/resources/data/naturesaura/tags/blocks/nether_altar_wood.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "values": [ - "minecraft:crimson_planks", - "minecraft:warped_planks" - ] -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/naturesaura/api/multiblock/Matcher.java b/src/main/java/de/ellpeck/naturesaura/api/multiblock/Matcher.java index b7391d21..75899ae9 100644 --- a/src/main/java/de/ellpeck/naturesaura/api/multiblock/Matcher.java +++ b/src/main/java/de/ellpeck/naturesaura/api/multiblock/Matcher.java @@ -9,7 +9,7 @@ import net.minecraft.world.level.block.state.BlockState; public record Matcher(BlockState defaultState, ICheck check) { - public static Matcher wildcard() { + public static Matcher any() { return new Matcher(Blocks.AIR.defaultBlockState(), null); } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java b/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java index a207864c..71a6d89e 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java @@ -15,20 +15,19 @@ import net.minecraft.world.level.material.Material; public final class Multiblocks { - private static final String[][] ALTAR_PATTERN = new String[][]{ - {" M ", " ", " ", " ", "M M", " ", " ", " ", " M "}, - {" B ", " ", " ", " ", "B B", " ", " ", " ", " B "}, - {" B ", " ", " M M ", " ", "B 0 B", " ", " M M ", " ", " B "}, - {" ", " WBW ", " WBW ", " WWCWCWW ", " BBW WBB ", " WWCWCWW ", " WBW ", " WBW ", " "}}; public static final IMultiblock ALTAR = NaturesAuraAPI.instance().createMultiblock( new ResourceLocation(NaturesAura.MOD_ID, "altar"), - Multiblocks.ALTAR_PATTERN, - 'C', Blocks.CHISELED_STONE_BRICKS, + new String[][]{ + {" M ", " ", " ", " ", "M M", " ", " ", " ", " M "}, + {" B ", " ", " ", " ", "B B", " ", " ", " ", " B "}, + {" B ", " ", " M M ", " ", "B 0 B", " ", " M M ", " ", " B "}, + {" ", " WBW ", " WBW ", " WWCWCWW ", " BBW WBB ", " WWCWCWW ", " WBW ", " WBW ", " "}}, + 'C', Matcher.tag(Blocks.CHISELED_STONE_BRICKS, BlockTagProvider.ALTAR_FANCY_BRICK), 'B', Matcher.tag(Blocks.STONE_BRICKS, BlockTagProvider.ALTAR_STONE), 'W', Matcher.tag(Blocks.OAK_PLANKS, BlockTagProvider.ALTAR_WOOD), - 'M', ModBlocks.GOLD_BRICK, + 'M', Matcher.tag(ModBlocks.GOLD_BRICK, BlockTagProvider.ALTAR_GOLD_BRICK), '0', ModBlocks.NATURE_ALTAR, - ' ', Matcher.wildcard()); + ' ', Matcher.any()); public static final IMultiblock TREE_RITUAL = NaturesAuraAPI.instance().createMultiblock( new ResourceLocation(NaturesAura.MOD_ID, "tree_ritual"), new String[][]{ @@ -49,7 +48,7 @@ public final class Multiblocks { } } ), - ' ', Matcher.wildcard()); + ' ', Matcher.any()); public static final IMultiblock POTION_GENERATOR = NaturesAuraAPI.instance().createMultiblock( new ResourceLocation(NaturesAura.MOD_ID, "potion_generator"), new String[][]{ @@ -60,7 +59,7 @@ public final class Multiblocks { 'N', Blocks.NETHER_BRICKS, 'R', Blocks.RED_NETHER_BRICKS, '0', ModBlocks.POTION_GENERATOR, - ' ', Matcher.wildcard()); + ' ', Matcher.any()); public static final IMultiblock OFFERING_TABLE = NaturesAuraAPI.instance().createMultiblock( new ResourceLocation(NaturesAura.MOD_ID, "offering_table"), new String[][]{ @@ -68,7 +67,7 @@ public final class Multiblocks { 'R', new Matcher(Blocks.POPPY.defaultBlockState(), (level, start, offset, pos, state, c) -> state.is(BlockTags.SMALL_FLOWERS)), '0', ModBlocks.OFFERING_TABLE, - ' ', Matcher.wildcard()); + ' ', Matcher.any()); public static final IMultiblock ANIMAL_SPAWNER = NaturesAuraAPI.instance().createMultiblock( new ResourceLocation(NaturesAura.MOD_ID, "animal_spawner"), new String[][]{ @@ -78,7 +77,7 @@ public final class Multiblocks { 'R', ModBlocks.INFUSED_BRICK, 'W', ModBlocks.ANCIENT_PLANKS, '0', ModBlocks.ANIMAL_SPAWNER, - ' ', Matcher.wildcard()); + ' ', Matcher.any()); public static final IMultiblock AUTO_CRAFTER = NaturesAuraAPI.instance().createMultiblock( new ResourceLocation(NaturesAura.MOD_ID, "auto_crafter"), new String[][]{ @@ -86,7 +85,7 @@ public final class Multiblocks { 'P', ModBlocks.ANCIENT_PLANKS, 'L', ModBlocks.ANCIENT_LOG, '0', ModBlocks.AUTO_CRAFTER, - ' ', Matcher.wildcard()); + ' ', Matcher.any()); public static final IMultiblock RF_CONVERTER = NaturesAuraAPI.instance().createMultiblock( new ResourceLocation(NaturesAura.MOD_ID, "rf_converter"), new String[][]{ @@ -99,5 +98,5 @@ public final class Multiblocks { {" ", " ", " ", " R ", " ", " ", " "}}, 'R', Blocks.REDSTONE_BLOCK, '0', ModBlocks.RF_CONVERTER, - ' ', Matcher.wildcard()); + ' ', Matcher.any()); } diff --git a/src/main/java/de/ellpeck/naturesaura/data/BlockTagProvider.java b/src/main/java/de/ellpeck/naturesaura/data/BlockTagProvider.java index 791f0d10..e943a1a5 100644 --- a/src/main/java/de/ellpeck/naturesaura/data/BlockTagProvider.java +++ b/src/main/java/de/ellpeck/naturesaura/data/BlockTagProvider.java @@ -18,8 +18,8 @@ public class BlockTagProvider extends BlockTagsProvider { public static final TagKey ALTAR_WOOD = BlockTags.create(new ResourceLocation(NaturesAura.MOD_ID, "altar_wood")); public static final TagKey ALTAR_STONE = BlockTags.create(new ResourceLocation(NaturesAura.MOD_ID, "altar_stone")); - public static final TagKey NETHER_ALTAR_WOOD = BlockTags.create(new ResourceLocation(NaturesAura.MOD_ID, "nether_altar_wood")); - public static final TagKey NETHER_ALTAR_STONE = BlockTags.create(new ResourceLocation(NaturesAura.MOD_ID, "nether_altar_stone")); + public static final TagKey ALTAR_GOLD_BRICK = BlockTags.create(new ResourceLocation(NaturesAura.MOD_ID, "altar_gold_brick")); + public static final TagKey ALTAR_FANCY_BRICK = BlockTags.create(new ResourceLocation(NaturesAura.MOD_ID, "altar_fancy_brick")); public BlockTagProvider(DataGenerator gen, @Nullable ExistingFileHelper existingFileHelper) { super(gen, NaturesAura.MOD_ID, existingFileHelper); @@ -35,10 +35,10 @@ public class BlockTagProvider extends BlockTagsProvider { this.tag(BlockTags.SLABS).add(ModBlocks.ANCIENT_SLAB, ModBlocks.INFUSED_SLAB, ModBlocks.INFUSED_BRICK_SLAB); this.tag(BlockTags.DIRT).add(ModBlocks.NETHER_GRASS); this.tag(BlockTags.SMALL_FLOWERS).add(ModBlocks.END_FLOWER, ModBlocks.AURA_BLOOM); - this.tag(BlockTagProvider.ALTAR_WOOD).addTag(BlockTags.PLANKS); - this.tag(BlockTagProvider.ALTAR_STONE).addTag(BlockTags.STONE_BRICKS); - this.tag(BlockTagProvider.NETHER_ALTAR_WOOD).add(Blocks.CRIMSON_PLANKS, Blocks.WARPED_PLANKS); - this.tag(BlockTagProvider.NETHER_ALTAR_STONE).add(Blocks.NETHER_BRICKS); + this.tag(BlockTagProvider.ALTAR_WOOD).addTag(BlockTags.PLANKS).add(Blocks.CRIMSON_PLANKS, Blocks.WARPED_PLANKS); + this.tag(BlockTagProvider.ALTAR_STONE).addTag(BlockTags.STONE_BRICKS).add(Blocks.NETHER_BRICKS); + this.tag(BlockTagProvider.ALTAR_GOLD_BRICK).add(ModBlocks.GOLD_BRICK, ModBlocks.GOLD_NETHER_BRICK); + this.tag(BlockTagProvider.ALTAR_FANCY_BRICK).add(Blocks.RED_NETHER_BRICKS, Blocks.CHISELED_STONE_BRICKS); for (var item : ModRegistry.ALL_ITEMS) { if (!(item instanceof Block b))