From 4955515fc0cf8077e5d7aa3ab87caf514b2b33cc Mon Sep 17 00:00:00 2001 From: BlayTheNinth <1933180+BlayTheNinth@users.noreply.github.com> Date: Tue, 31 Dec 2024 18:59:36 +0100 Subject: [PATCH] feat: Add portstones item tag #945 --- .../data/waystones/tags/item/portstones.json | 20 +++++++++++++++++++ .../mods/waystones/tag/ModItemTags.java | 1 + .../waystones/datagen/ModItemTagProvider.java | 14 +++++++++++-- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 common/src/generated/resources/data/waystones/tags/item/portstones.json diff --git a/common/src/generated/resources/data/waystones/tags/item/portstones.json b/common/src/generated/resources/data/waystones/tags/item/portstones.json new file mode 100644 index 00000000..9deac093 --- /dev/null +++ b/common/src/generated/resources/data/waystones/tags/item/portstones.json @@ -0,0 +1,20 @@ +{ + "values": [ + "waystones:white_portstone", + "waystones:orange_portstone", + "waystones:magenta_portstone", + "waystones:light_blue_portstone", + "waystones:yellow_portstone", + "waystones:lime_portstone", + "waystones:pink_portstone", + "waystones:gray_portstone", + "waystones:light_gray_portstone", + "waystones:cyan_portstone", + "waystones:purple_portstone", + "waystones:blue_portstone", + "waystones:brown_portstone", + "waystones:green_portstone", + "waystones:red_portstone", + "waystones:black_portstone" + ] +} \ No newline at end of file diff --git a/common/src/main/java/net/blay09/mods/waystones/tag/ModItemTags.java b/common/src/main/java/net/blay09/mods/waystones/tag/ModItemTags.java index a8e1f2e3..53582586 100644 --- a/common/src/main/java/net/blay09/mods/waystones/tag/ModItemTags.java +++ b/common/src/main/java/net/blay09/mods/waystones/tag/ModItemTags.java @@ -16,4 +16,5 @@ public class ModItemTags { public static final TagKey SINGLE_USE_WARP_SHARDS = TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(Waystones.MOD_ID, "single_use_warp_shards")); public static final TagKey WAYSTONES = TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(Waystones.MOD_ID, "waystones")); public static final TagKey SHARESTONES = TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(Waystones.MOD_ID, "sharestones")); + public static final TagKey PORTSTONES = TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(Waystones.MOD_ID, "portstones")); } diff --git a/fabric/src/main/java/net/blay09/mods/waystones/datagen/ModItemTagProvider.java b/fabric/src/main/java/net/blay09/mods/waystones/datagen/ModItemTagProvider.java index fe797e40..d702cd3b 100644 --- a/fabric/src/main/java/net/blay09/mods/waystones/datagen/ModItemTagProvider.java +++ b/fabric/src/main/java/net/blay09/mods/waystones/datagen/ModItemTagProvider.java @@ -2,6 +2,7 @@ import net.blay09.mods.waystones.block.ModBlocks; import net.blay09.mods.waystones.item.ModItems; +import net.blay09.mods.waystones.tag.ModBlockTags; import net.blay09.mods.waystones.tag.ModItemTags; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; @@ -27,7 +28,10 @@ protected void addTags(HolderLookup.Provider lookup) { getOrCreateTagBuilder(ModItemTags.RETURN_SCROLLS).add(ModItems.returnScroll); getOrCreateTagBuilder(ModItemTags.BOUND_SCROLLS).add(ModItems.boundScroll); getOrCreateTagBuilder(ModItemTags.WARP_STONES).add(ModItems.warpStone); - getOrCreateTagBuilder(ModItemTags.WARP_SHARDS).add(ModItems.attunedShard, ModItems.crumblingAttunedShard, ModItems.dormantShard, ModItems.deepslateShard); + getOrCreateTagBuilder(ModItemTags.WARP_SHARDS).add(ModItems.attunedShard, + ModItems.crumblingAttunedShard, + ModItems.dormantShard, + ModItems.deepslateShard); getOrCreateTagBuilder(ModItemTags.SINGLE_USE_WARP_SHARDS).add(ModItems.crumblingAttunedShard); getOrCreateTagBuilder(ModItemTags.WAYSTONES).add(ModBlocks.waystone.asItem(), ModBlocks.mossyWaystone.asItem(), @@ -35,9 +39,15 @@ protected void addTags(HolderLookup.Provider lookup) { ModBlocks.deepslateWaystone.asItem(), ModBlocks.blackstoneWaystone.asItem(), ModBlocks.endStoneWaystone.asItem()); - FabricTagProvider.FabricTagBuilder sharestonesTag = getOrCreateTagBuilder(ModItemTags.SHARESTONES); + + final var sharestonesTag = getOrCreateTagBuilder(ModItemTags.SHARESTONES); for (Block sharestone : ModBlocks.sharestones) { sharestonesTag.add(sharestone.asItem()); } + + final var portstonesBuilder = getOrCreateTagBuilder(ModItemTags.PORTSTONES); + for (final var portstone : ModBlocks.portstones) { + portstonesBuilder.add(portstone.asItem()); + } } }