More Behaviour changes
This commit is contained in:
parent
5390921e55
commit
1bc1487dfe
4 changed files with 4 additions and 31 deletions
|
@ -200,9 +200,9 @@ public class PostInitAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block instanceof BehaviourSapling) {
|
if (block instanceof BehaviourSapling) {
|
||||||
TagManager.BLOCKS.add(block, CommonBlockTags.SAPLINGS);
|
TagManager.BLOCKS.add(block, CommonBlockTags.SAPLINGS, BlockTags.SAPLINGS);
|
||||||
if (item != null && item != Items.AIR) {
|
if (item != null && item != Items.AIR) {
|
||||||
TagManager.ITEMS.add(block, CommonItemTags.SAPLINGS);
|
TagManager.ITEMS.add(block, CommonItemTags.SAPLINGS, ItemTags.SAPLINGS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
package org.betterx.bclib.blocks;
|
package org.betterx.bclib.blocks;
|
||||||
|
|
||||||
import org.betterx.bclib.behaviours.BehaviourBuilders;
|
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.client.render.BCLRenderLayer;
|
||||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||||
import org.betterx.bclib.interfaces.tools.AddMineableHoe;
|
|
||||||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||||
import org.betterx.bclib.items.tool.BaseShearsItem;
|
import org.betterx.bclib.items.tool.BaseShearsItem;
|
||||||
|
|
||||||
|
@ -32,7 +31,7 @@ import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import java.util.List;
|
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);
|
private static final VoxelShape SHAPE = box(4, 0, 4, 12, 16, 12);
|
||||||
|
|
||||||
public UpDownPlantBlock() {
|
public UpDownPlantBlock() {
|
||||||
|
|
|
@ -2,12 +2,9 @@ package org.betterx.bclib.complexmaterials.set.wood;
|
||||||
|
|
||||||
import org.betterx.bclib.complexmaterials.ComplexMaterial;
|
import org.betterx.bclib.complexmaterials.ComplexMaterial;
|
||||||
import org.betterx.bclib.complexmaterials.WoodenComplexMaterial;
|
import org.betterx.bclib.complexmaterials.WoodenComplexMaterial;
|
||||||
import org.betterx.bclib.complexmaterials.entry.BlockEntry;
|
|
||||||
import org.betterx.bclib.complexmaterials.entry.SimpleMaterialSlot;
|
import org.betterx.bclib.complexmaterials.entry.SimpleMaterialSlot;
|
||||||
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
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.Block;
|
||||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||||
|
|
||||||
|
@ -23,12 +20,6 @@ public abstract class AbstractSaplingSlot extends SimpleMaterialSlot<WoodenCompl
|
||||||
super(SAPLING_SUFFIX);
|
super(SAPLING_SUFFIX);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void modifyBlockEntry(WoodenComplexMaterial parentMaterial, @NotNull BlockEntry entry) {
|
|
||||||
entry
|
|
||||||
.setBlockTags(BlockTags.SAPLINGS)
|
|
||||||
.setItemTags(ItemTags.SAPLINGS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected @Nullable void makeRecipe(ComplexMaterial parentMaterial, ResourceLocation id) {
|
protected @Nullable void makeRecipe(ComplexMaterial parentMaterial, ResourceLocation id) {
|
||||||
|
|
|
@ -1,20 +1,12 @@
|
||||||
package org.betterx.bclib.registry;
|
package org.betterx.bclib.registry;
|
||||||
|
|
||||||
import org.betterx.bclib.BCLib;
|
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.config.PathConfig;
|
||||||
import org.betterx.bclib.interfaces.CustomItemProvider;
|
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.Registry;
|
||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
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.BlockItem;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
|
@ -51,15 +43,6 @@ public class BlockRegistry extends BaseRegistry<Block> {
|
||||||
block = Registry.register(BuiltInRegistries.BLOCK, id, block);
|
block = Registry.register(BuiltInRegistries.BLOCK, id, block);
|
||||||
getModBlocks(id.getNamespace()).add(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;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue