Skip to content

Commit

Permalink
Move bar / chain tag gen to MetalMaterial and generate item tags
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenBagTwo committed Aug 28, 2024
1 parent 9b05379 commit aa54d6d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 17 deletions.
6 changes: 6 additions & 0 deletions src/main/generated/data/c/tags/item/bars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"betterend:terminite_bars",
"betterend:thallasium_bars"
]
}
6 changes: 6 additions & 0 deletions src/main/generated/data/c/tags/item/chains.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"betterend:terminite_chain",
"betterend:thallasium_chain"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"betterend:terminite_bars",
"betterend:thallasium_bars"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"betterend:terminite_chain",
"betterend:thallasium_chain"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ public class MetalMaterial implements MaterialManager.Material {
public final int anvilLevel;
public final TagKey<Item> anvilTools;

private static final TagKey<Block> BARS_BLOCK_TAG = TagManager.BLOCKS.makeCommonTag("bars");
private static final TagKey<Item> BARS_ITEM_TAG = TagManager.ITEMS.makeCommonTag("bars");
private static final TagKey<Block> CHAIN_BLOCK_TAG = TagManager.BLOCKS.makeCommonTag("chains");
private static final TagKey<Item> CHAINS_ITEM_TAG = TagManager.ITEMS.makeCommonTag("chains");

public static MetalMaterial makeNormal(
String name,
MapColor color,
Expand Down Expand Up @@ -473,12 +478,16 @@ public void registerRecipes(RecipeOutput context) {
@Override
public void registerBlockTags(TagBootstrapContext<Block> context) {
context.add(BlockTags.ANVIL, anvilBlock);
context.add(BARS_BLOCK_TAG, bars);
context.add(CHAIN_BLOCK_TAG, chain);
context.add(BlockTags.BEACON_BASE_BLOCKS, block);
context.add(BlockTags.DRAGON_IMMUNE, ore, bars);
}

@Override
public void registerItemTags(ItemTagBootstrapContext context) {
context.add(BARS_ITEM_TAG, bars.asItem());
context.add(CHAINS_ITEM_TAG, chain.asItem());
context.add(ItemTags.BEACON_PAYMENT_ITEMS, ingot);
if (alloyingOre != null) {
context.add(alloyingOre, ore.asItem(), rawOre);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package org.betterx.datagen.betterend.tags;

import net.minecraft.tags.TagKey;
import org.betterx.bclib.blocks.BaseBarsBlock;
import org.betterx.bclib.blocks.BaseChainBlock;
import org.betterx.betterend.complexmaterials.MaterialManager;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndTags;
import org.betterx.betterend.world.biome.EndBiome;
import org.betterx.datagen.betterend.worldgen.EndBiomesProvider;
import org.betterx.wover.core.api.ModCore;
import org.betterx.wover.datagen.api.WoverTagProvider;
import org.betterx.wover.tag.api.TagManager;
import org.betterx.wover.tag.api.event.context.TagBootstrapContext;
import org.betterx.wover.tag.api.predefined.CommonBlockTags;

Expand All @@ -24,9 +20,6 @@ public BlockTagProvider(ModCore modCore) {
super(modCore, Set.of(EndTags.INCORRECT_FOR_AETERNIUM_TOOL));
}

private static final TagKey<Block> BARS_TAG = TagManager.BLOCKS.makeCommonTag("bars");
private static final TagKey<Block> CHAIN_TAG = TagManager.BLOCKS.makeCommonTag("chains");

private static void addEndGround(TagBootstrapContext<Block> context, Block bl) {
context.add(CommonBlockTags.END_STONES, bl);
}
Expand Down Expand Up @@ -80,15 +73,5 @@ public void prepareTags(TagBootstrapContext<Block> context) {
for (Block charnia : charnias) {
context.add(EndTags.BONEMEAL_SOURCE_WATER_GRASS, charnia);
}

EndBlocks.getModBlocks().forEach(block -> {
if (block instanceof BaseBarsBlock) {
context.add(BARS_TAG, block);
}
if (block instanceof BaseChainBlock) {
context.add(CHAIN_TAG, block);
}
});

}
}

0 comments on commit aa54d6d

Please sign in to comment.