From 7bad93044d2c859789d0904b54d8e5eca6886c92 Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 19 Mar 2024 13:57:56 +0000 Subject: [PATCH] Move remaining block tags to datagen --- .../datagen/providers/UBlockTagProvider.java | 47 ++++++++++++++++--- .../tags/blocks/crystal_heart_base.json | 18 ------- .../tags/blocks/crystal_heart_ornament.json | 6 --- .../data/unicopia/tags/blocks/fragile.json | 9 ---- .../unicopia/tags/blocks/glass_blocks.json | 6 --- .../unicopia/tags/blocks/glass_panes.json | 6 --- .../unicopia/tags/blocks/interesting.json | 11 ----- .../unicopia/tags/blocks/kicks_up_dust.json | 9 ---- .../data/unicopia/tags/blocks/palm_logs.json | 9 ---- .../blocks/unaffected_by_grow_ability.json | 6 --- 10 files changed, 41 insertions(+), 86 deletions(-) delete mode 100644 src/main/resources/data/unicopia/tags/blocks/crystal_heart_base.json delete mode 100644 src/main/resources/data/unicopia/tags/blocks/crystal_heart_ornament.json delete mode 100644 src/main/resources/data/unicopia/tags/blocks/fragile.json delete mode 100644 src/main/resources/data/unicopia/tags/blocks/glass_blocks.json delete mode 100644 src/main/resources/data/unicopia/tags/blocks/glass_panes.json delete mode 100644 src/main/resources/data/unicopia/tags/blocks/interesting.json delete mode 100644 src/main/resources/data/unicopia/tags/blocks/kicks_up_dust.json delete mode 100644 src/main/resources/data/unicopia/tags/blocks/palm_logs.json delete mode 100644 src/main/resources/data/unicopia/tags/blocks/unaffected_by_grow_ability.json diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UBlockTagProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UBlockTagProvider.java index 64fa1437..5995a6d8 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UBlockTagProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UBlockTagProvider.java @@ -9,11 +9,15 @@ import com.minelittlepony.unicopia.server.world.Tree; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.fabricmc.fabric.api.tag.convention.v1.ConventionalBlockTags; import net.minecraft.block.Block; import net.minecraft.block.Blocks; +import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.RegistryWrapper; import net.minecraft.registry.RegistryWrapper.WrapperLookup; import net.minecraft.registry.tag.BlockTags; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { public UBlockTagProvider(FabricDataOutput output, CompletableFuture registriesFuture) { @@ -45,6 +49,31 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { addChitinBlocksets(); addHayBlocks(); addFruitTrees(); + + getOrCreateTagBuilder(UTags.CRYSTAL_HEART_BASE).add( + Blocks.DIAMOND_BLOCK, + Blocks.QUARTZ_BLOCK, Blocks.QUARTZ_BRICKS, Blocks.QUARTZ_SLAB, Blocks.QUARTZ_STAIRS, Blocks.QUARTZ_PILLAR, + Blocks.SMOOTH_QUARTZ, Blocks.SMOOTH_QUARTZ_SLAB, Blocks.SMOOTH_QUARTZ_STAIRS, Blocks.CHISELED_QUARTZ_BLOCK, + Blocks.AMETHYST_BLOCK, Blocks.NETHERITE_BLOCK, Blocks.EMERALD_BLOCK + ); + getOrCreateTagBuilder(UTags.CRYSTAL_HEART_ORNAMENT).add(Blocks.END_ROD); + + getOrCreateTagBuilder(UTags.FRAGILE) + .forceAddTag(ConventionalBlockTags.GLASS_BLOCKS) + .forceAddTag(ConventionalBlockTags.GLASS_PANES) + .add(Blocks.VINE, Blocks.LILY_PAD); + + getOrCreateTagBuilder(UTags.INTERESTING).add( + Blocks.SEA_LANTERN, Blocks.ENDER_CHEST, Blocks.END_PORTAL_FRAME, + Blocks.JUKEBOX, Blocks.SPAWNER + ).forceAddTag(ConventionalBlockTags.ORES); + + getOrCreateTagBuilder(UTags.KICKS_UP_DUST).forceAddTag(BlockTags.SAND).add( + Blocks.SUSPICIOUS_SAND, + Blocks.GRAVEL, Blocks.SUSPICIOUS_GRAVEL + ).forceAddTag(TagKey.of(RegistryKeys.BLOCK, new Identifier("c", "concrete_powders"))); + + getOrCreateTagBuilder(UTags.UNAFFECTED_BY_GROW_ABILITY).add(Blocks.GRASS_BLOCK); } private void addFruitTrees() { @@ -78,9 +107,13 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { UBlocks.ZAP_STAIRS ); - Block[] burnableLogs = { UBlocks.WAXED_ZAP_LOG, UBlocks.WAXED_ZAP_WOOD, UBlocks.WAXED_STRIPPED_ZAP_LOG, UBlocks.WAXED_STRIPPED_ZAP_WOOD }; - getOrCreateTagBuilder(BlockTags.LOGS).add(burnableLogs).add(UBlocks.ZAP_LOG, UBlocks.ZAP_WOOD, UBlocks.STRIPPED_ZAP_LOG, UBlocks.STRIPPED_ZAP_WOOD); - getOrCreateTagBuilder(BlockTags.LOGS_THAT_BURN).add(burnableLogs); + TagKey logsTag = UTags.block("zap_logs"); + TagKey waxedLogsTag = UTags.block("waxed_zap_logs"); + + getOrCreateTagBuilder(logsTag).add(UBlocks.ZAP_LOG, UBlocks.ZAP_WOOD, UBlocks.STRIPPED_ZAP_LOG, UBlocks.STRIPPED_ZAP_WOOD); + getOrCreateTagBuilder(waxedLogsTag).add(UBlocks.WAXED_ZAP_LOG, UBlocks.WAXED_ZAP_WOOD, UBlocks.WAXED_STRIPPED_ZAP_LOG, UBlocks.WAXED_STRIPPED_ZAP_WOOD); + getOrCreateTagBuilder(BlockTags.LOGS).forceAddTag(logsTag).forceAddTag(waxedLogsTag); + getOrCreateTagBuilder(BlockTags.LOGS_THAT_BURN).forceAddTag(logsTag); getOrCreateTagBuilder(BlockTags.PLANKS).add(UBlocks.ZAP_PLANKS, UBlocks.WAXED_ZAP_PLANKS); //getOrCreateTagBuilder(BlockTags.WOODEN_BUTTONS).add(UBlocks.ZAP_BUTTON); @@ -101,9 +134,11 @@ public class UBlockTagProvider extends FabricTagProvider.BlockTagProvider { getOrCreateTagBuilder(BlockTags.LEAVES).add(UBlocks.PALM_LEAVES); getOrCreateTagBuilder(BlockTags.HOE_MINEABLE).add(UBlocks.PALM_LEAVES); - Block[] logs = { UBlocks.PALM_LOG, UBlocks.PALM_WOOD, UBlocks.STRIPPED_PALM_LOG, UBlocks.STRIPPED_PALM_WOOD }; - getOrCreateTagBuilder(BlockTags.LOGS).add(logs); - getOrCreateTagBuilder(BlockTags.LOGS_THAT_BURN).add(logs); + TagKey logsTag = UTags.block("palm_logs"); + + getOrCreateTagBuilder(logsTag).add(UBlocks.PALM_LOG, UBlocks.PALM_WOOD, UBlocks.STRIPPED_PALM_LOG, UBlocks.STRIPPED_PALM_WOOD); + getOrCreateTagBuilder(BlockTags.LOGS).forceAddTag(logsTag); + getOrCreateTagBuilder(BlockTags.LOGS_THAT_BURN).forceAddTag(logsTag); getOrCreateTagBuilder(BlockTags.PLANKS).add(UBlocks.PALM_PLANKS); addSign(UBlocks.PALM_SIGN, UBlocks.PALM_WALL_SIGN, UBlocks.PALM_HANGING_SIGN, UBlocks.PALM_WALL_HANGING_SIGN); getOrCreateTagBuilder(BlockTags.WOODEN_BUTTONS).add(UBlocks.PALM_BUTTON); diff --git a/src/main/resources/data/unicopia/tags/blocks/crystal_heart_base.json b/src/main/resources/data/unicopia/tags/blocks/crystal_heart_base.json deleted file mode 100644 index 47de02d4..00000000 --- a/src/main/resources/data/unicopia/tags/blocks/crystal_heart_base.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:diamond_block", - "minecraft:quartz_block", - "minecraft:quartz_bricks", - "minecraft:quartz_slab", - "minecraft:quartz_stairs", - "minecraft:quartz_pillar", - "minecraft:smooth_quartz", - "minecraft:smooth_quartz_slab", - "minecraft:smooth_quartz_stairs", - "minecraft:chiseled_quartz_block", - "minecraft:amethyst_block", - "minecraft:netherite_block", - "minecraft:emerald_block" - ] -} diff --git a/src/main/resources/data/unicopia/tags/blocks/crystal_heart_ornament.json b/src/main/resources/data/unicopia/tags/blocks/crystal_heart_ornament.json deleted file mode 100644 index 770f0fe5..00000000 --- a/src/main/resources/data/unicopia/tags/blocks/crystal_heart_ornament.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:end_rod" - ] -} diff --git a/src/main/resources/data/unicopia/tags/blocks/fragile.json b/src/main/resources/data/unicopia/tags/blocks/fragile.json deleted file mode 100644 index 73e3b5f7..00000000 --- a/src/main/resources/data/unicopia/tags/blocks/fragile.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "replace": false, - "values": [ - "#unicopia:glass_blocks", - "#unicopia:glass_panes", - "minecraft:vine", - "minecraft:lily_pad" - ] -} diff --git a/src/main/resources/data/unicopia/tags/blocks/glass_blocks.json b/src/main/resources/data/unicopia/tags/blocks/glass_blocks.json deleted file mode 100644 index 0c79fc76..00000000 --- a/src/main/resources/data/unicopia/tags/blocks/glass_blocks.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:glass_blocks" - ] -} diff --git a/src/main/resources/data/unicopia/tags/blocks/glass_panes.json b/src/main/resources/data/unicopia/tags/blocks/glass_panes.json deleted file mode 100644 index 7c6b6dd9..00000000 --- a/src/main/resources/data/unicopia/tags/blocks/glass_panes.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:glass_panes" - ] -} diff --git a/src/main/resources/data/unicopia/tags/blocks/interesting.json b/src/main/resources/data/unicopia/tags/blocks/interesting.json deleted file mode 100644 index 4662a940..00000000 --- a/src/main/resources/data/unicopia/tags/blocks/interesting.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:sea_lantern", - "minecraft:ender_chest", - "minecraft:end_portal_frame", - "minecraft:jukebox", - "minecraft:spawner", - "#c:ores" - ] -} diff --git a/src/main/resources/data/unicopia/tags/blocks/kicks_up_dust.json b/src/main/resources/data/unicopia/tags/blocks/kicks_up_dust.json deleted file mode 100644 index 5a3a6783..00000000 --- a/src/main/resources/data/unicopia/tags/blocks/kicks_up_dust.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "replace": false, - "values": [ - "#minecraft:sand", - "minecraft:gravel", - "minecraft:suspicious_gravel", - "#c:concrete_powders" - ] -} diff --git a/src/main/resources/data/unicopia/tags/blocks/palm_logs.json b/src/main/resources/data/unicopia/tags/blocks/palm_logs.json deleted file mode 100644 index 38397972..00000000 --- a/src/main/resources/data/unicopia/tags/blocks/palm_logs.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "replace": false, - "values": [ - "unicopia:palm_log", - "unicopia:palm_wood", - "unicopia:stripped_palm_log", - "unicopia:stripped_palm_wood" - ] -} diff --git a/src/main/resources/data/unicopia/tags/blocks/unaffected_by_grow_ability.json b/src/main/resources/data/unicopia/tags/blocks/unaffected_by_grow_ability.json deleted file mode 100644 index 06c918c6..00000000 --- a/src/main/resources/data/unicopia/tags/blocks/unaffected_by_grow_ability.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:grass_block" - ] -}