[Change] Moved and refactored Tag-API

This commit is contained in:
Frank 2022-06-21 18:19:10 +02:00
parent 25fa53541f
commit 184f3a6448
56 changed files with 1220 additions and 358 deletions

View file

@ -1,14 +1,19 @@
package org.betterx.bclib.registry;
import org.betterx.bclib.api.v2.tag.*;
import org.betterx.bclib.blocks.BaseLeavesBlock;
import org.betterx.bclib.blocks.BaseOreBlock;
import org.betterx.bclib.blocks.FeatureSaplingBlock;
import org.betterx.bclib.config.PathConfig;
import org.betterx.bclib.interfaces.CustomItemProvider;
import org.betterx.worlds.together.tag.CommonBlockTags;
import org.betterx.worlds.together.tag.CommonItemTags;
import org.betterx.worlds.together.tag.MineableTags;
import org.betterx.worlds.together.tag.TagManager;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
@ -45,22 +50,22 @@ public class BlockRegistry extends BaseRegistry<Block> {
getModBlocks(id.getNamespace()).add(block);
if (block instanceof BaseLeavesBlock) {
TagAPI.addBlockTags(
TagManager.BLOCKS.add(
block,
NamedBlockTags.LEAVES,
BlockTags.LEAVES,
CommonBlockTags.LEAVES,
NamedMineableTags.HOE,
NamedMineableTags.SHEARS
MineableTags.HOE,
MineableTags.SHEARS
);
if (item != null) {
TagAPI.addItemTags(item, CommonItemTags.LEAVES, NamedItemTags.LEAVES);
TagManager.ITEMS.add(item, CommonItemTags.LEAVES, ItemTags.LEAVES);
}
} else if (block instanceof BaseOreBlock) {
TagAPI.addBlockTags(block, NamedMineableTags.PICKAXE);
TagManager.BLOCKS.add(block, MineableTags.PICKAXE);
} else if (block instanceof FeatureSaplingBlock) {
TagAPI.addBlockTags(block, CommonBlockTags.SAPLINGS, NamedBlockTags.SAPLINGS);
TagManager.BLOCKS.add(block, CommonBlockTags.SAPLINGS, BlockTags.SAPLINGS);
if (item != null) {
TagAPI.addItemTags(item, CommonItemTags.SAPLINGS, NamedItemTags.SAPLINGS);
TagManager.ITEMS.add(item, CommonItemTags.SAPLINGS, ItemTags.SAPLINGS);
}
}