From 969cd92b2e5324d5c2aee226bf02383fa588afbf Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 20 Nov 2024 20:50:37 +0100 Subject: Add pickaxe breaking tag --- .../data/minecraft/tags/block/mineable/pickaxe.json | 5 +++++ .../moe/nea/funnyteleporters/FunnyDataGenerator.java | 1 + .../moe/nea/funnyteleporters/FunnyTagGenerator.java | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 src/main/generated/data/minecraft/tags/block/mineable/pickaxe.json create mode 100644 src/main/java/moe/nea/funnyteleporters/FunnyTagGenerator.java diff --git a/src/main/generated/data/minecraft/tags/block/mineable/pickaxe.json b/src/main/generated/data/minecraft/tags/block/mineable/pickaxe.json new file mode 100644 index 0000000..f126a94 --- /dev/null +++ b/src/main/generated/data/minecraft/tags/block/mineable/pickaxe.json @@ -0,0 +1,5 @@ +{ + "values": [ + "funny-teleporters:coloured_chest" + ] +} \ No newline at end of file diff --git a/src/main/java/moe/nea/funnyteleporters/FunnyDataGenerator.java b/src/main/java/moe/nea/funnyteleporters/FunnyDataGenerator.java index f57cc28..b4c8b85 100644 --- a/src/main/java/moe/nea/funnyteleporters/FunnyDataGenerator.java +++ b/src/main/java/moe/nea/funnyteleporters/FunnyDataGenerator.java @@ -9,6 +9,7 @@ public class FunnyDataGenerator implements DataGeneratorEntrypoint { var pack = dataGenerator.createPack(); pack.addProvider(FunnyRecipeProvider::new); pack.addProvider(FunnyDropTableProvider::new); + pack.addProvider(FunnyTagGenerator::new); } } diff --git a/src/main/java/moe/nea/funnyteleporters/FunnyTagGenerator.java b/src/main/java/moe/nea/funnyteleporters/FunnyTagGenerator.java new file mode 100644 index 0000000..338b8d1 --- /dev/null +++ b/src/main/java/moe/nea/funnyteleporters/FunnyTagGenerator.java @@ -0,0 +1,20 @@ +package moe.nea.funnyteleporters; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.minecraft.registry.Registries; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.registry.tag.BlockTags; + +import java.util.concurrent.CompletableFuture; + +public class FunnyTagGenerator extends FabricTagProvider.BlockTagProvider { + public FunnyTagGenerator(FabricDataOutput output, CompletableFuture registriesFuture) { + super(output, registriesFuture); + } + + @Override + protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) { + getTagBuilder(BlockTags.PICKAXE_MINEABLE).add(Registries.BLOCK.getId(FunnyRegistry.COLOURED_CHEST)); + } +} -- cgit