Skip to content

Commit

Permalink
feat: Add portstones item tag #945
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Dec 31, 2024
1 parent 4130d65 commit 4955515
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ public class ModItemTags {
public static final TagKey<Item> SINGLE_USE_WARP_SHARDS = TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(Waystones.MOD_ID, "single_use_warp_shards"));
public static final TagKey<Item> WAYSTONES = TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(Waystones.MOD_ID, "waystones"));
public static final TagKey<Item> SHARESTONES = TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(Waystones.MOD_ID, "sharestones"));
public static final TagKey<Item> PORTSTONES = TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(Waystones.MOD_ID, "portstones"));
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -27,17 +28,26 @@ 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(),
ModBlocks.sandyWaystone.asItem(),
ModBlocks.deepslateWaystone.asItem(),
ModBlocks.blackstoneWaystone.asItem(),
ModBlocks.endStoneWaystone.asItem());
FabricTagProvider<Item>.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());
}
}
}

0 comments on commit 4955515

Please sign in to comment.