More Behaviour changes

This commit is contained in:
Frank 2023-05-30 19:02:27 +02:00
parent 5390921e55
commit 1bc1487dfe
4 changed files with 4 additions and 31 deletions

View file

@ -200,9 +200,9 @@ public class PostInitAPI {
}
if (block instanceof BehaviourSapling) {
TagManager.BLOCKS.add(block, CommonBlockTags.SAPLINGS);
TagManager.BLOCKS.add(block, CommonBlockTags.SAPLINGS, BlockTags.SAPLINGS);
if (item != null && item != Items.AIR) {
TagManager.ITEMS.add(block, CommonItemTags.SAPLINGS);
TagManager.ITEMS.add(block, CommonItemTags.SAPLINGS, ItemTags.SAPLINGS);
}
}

View file

@ -1,10 +1,9 @@
package org.betterx.bclib.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourCompostable;
import org.betterx.bclib.behaviours.interfaces.BehaviourPlant;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableHoe;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.bclib.items.tool.BaseShearsItem;
@ -32,7 +31,7 @@ import com.google.common.collect.Lists;
import java.util.List;
public abstract class UpDownPlantBlock extends BaseBlockNotFull implements RenderLayerProvider, AddMineableShears, AddMineableHoe, BehaviourCompostable {
public abstract class UpDownPlantBlock extends BaseBlockNotFull implements RenderLayerProvider, AddMineableShears, BehaviourPlant {
private static final VoxelShape SHAPE = box(4, 0, 4, 12, 16, 12);
public UpDownPlantBlock() {

View file

@ -2,12 +2,9 @@ package org.betterx.bclib.complexmaterials.set.wood;
import org.betterx.bclib.complexmaterials.ComplexMaterial;
import org.betterx.bclib.complexmaterials.WoodenComplexMaterial;
import org.betterx.bclib.complexmaterials.entry.BlockEntry;
import org.betterx.bclib.complexmaterials.entry.SimpleMaterialSlot;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
@ -23,12 +20,6 @@ public abstract class AbstractSaplingSlot extends SimpleMaterialSlot<WoodenCompl
super(SAPLING_SUFFIX);
}
@Override
protected void modifyBlockEntry(WoodenComplexMaterial parentMaterial, @NotNull BlockEntry entry) {
entry
.setBlockTags(BlockTags.SAPLINGS)
.setItemTags(ItemTags.SAPLINGS);
}
@Override
protected @Nullable void makeRecipe(ComplexMaterial parentMaterial, ResourceLocation id) {

View file

@ -1,20 +1,12 @@
package org.betterx.bclib.registry;
import org.betterx.bclib.BCLib;
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.v3.CommonBlockTags;
import org.betterx.worlds.together.tag.v3.CommonItemTags;
import org.betterx.worlds.together.tag.v3.MineableTags;
import org.betterx.worlds.together.tag.v3.TagManager;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
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.Item;
import net.minecraft.world.item.Items;
@ -51,15 +43,6 @@ public class BlockRegistry extends BaseRegistry<Block> {
block = Registry.register(BuiltInRegistries.BLOCK, id, block);
getModBlocks(id.getNamespace()).add(block);
if (block instanceof BaseOreBlock) {
TagManager.BLOCKS.add(block, MineableTags.PICKAXE);
} else if (block instanceof FeatureSaplingBlock) {
TagManager.BLOCKS.add(block, CommonBlockTags.SAPLINGS, BlockTags.SAPLINGS);
if (item != null) {
TagManager.ITEMS.add(item, CommonItemTags.SAPLINGS, ItemTags.SAPLINGS);
}
}
return block;
}