diff --git a/src/main/java/org/betterx/bclib/api/v2/PostInitAPI.java b/src/main/java/org/betterx/bclib/api/v2/PostInitAPI.java index b1a9ff0c..cd8f32c3 100644 --- a/src/main/java/org/betterx/bclib/api/v2/PostInitAPI.java +++ b/src/main/java/org/betterx/bclib/api/v2/PostInitAPI.java @@ -188,10 +188,11 @@ public class PostInitAPI { TagManager.BLOCKS.add(block, CommonBlockTags.WATER_PLANT); } - if (block instanceof BehaviourPlant) { + if (block instanceof BehaviourPlant || block instanceof BehaviourShearablePlant) { TagManager.BLOCKS.add(block, CommonBlockTags.PLANT); } + if (block instanceof BehaviourSeed) { TagManager.BLOCKS.add(block, CommonBlockTags.SEEDS); if (item != null && item != Items.AIR) { diff --git a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourPlant.java b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourPlant.java index d8c71e8d..24e6084f 100644 --- a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourPlant.java +++ b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourPlant.java @@ -2,5 +2,5 @@ package org.betterx.bclib.behaviours.interfaces; import org.betterx.bclib.interfaces.tools.AddMineableHoe; -public interface BehaviourPlant extends AddMineableHoe, BehaviourCompostable { +public interface BehaviourPlant extends AddMineableHoe, BehaviourCompostable, BehaviourPlantLike { } diff --git a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourPlantLike.java b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourPlantLike.java new file mode 100644 index 00000000..e5648391 --- /dev/null +++ b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourPlantLike.java @@ -0,0 +1,4 @@ +package org.betterx.bclib.behaviours.interfaces; + +public interface BehaviourPlantLike { +} diff --git a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourSapling.java b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourSapling.java index 1b4b7ea9..55a6bc72 100644 --- a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourSapling.java +++ b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourSapling.java @@ -2,5 +2,5 @@ package org.betterx.bclib.behaviours.interfaces; import org.betterx.bclib.interfaces.tools.AddMineableHoe; -public interface BehaviourSapling extends AddMineableHoe, BehaviourCompostable { +public interface BehaviourSapling extends AddMineableHoe, BehaviourCompostable, BehaviourPlantLike { } diff --git a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourSeed.java b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourSeed.java index b038566a..43e005d8 100644 --- a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourSeed.java +++ b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourSeed.java @@ -2,5 +2,5 @@ package org.betterx.bclib.behaviours.interfaces; import org.betterx.bclib.interfaces.tools.AddMineableHoe; -public interface BehaviourSeed extends AddMineableHoe, BehaviourCompostable { +public interface BehaviourSeed extends AddMineableHoe, BehaviourCompostable, BehaviourPlantLike { } diff --git a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourShearablePlant.java b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourShearablePlant.java new file mode 100644 index 00000000..74fcae79 --- /dev/null +++ b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourShearablePlant.java @@ -0,0 +1,6 @@ +package org.betterx.bclib.behaviours.interfaces; + +import org.betterx.bclib.interfaces.tools.AddMineableShears; + +public interface BehaviourShearablePlant extends AddMineableShears, BehaviourPlantLike, BehaviourCompostable { +} diff --git a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourVine.java b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourVine.java index 46c33d2b..35f336f5 100644 --- a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourVine.java +++ b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourVine.java @@ -8,5 +8,5 @@ import org.betterx.bclib.interfaces.tools.AddMineableShears; *

* This will add the {@link AddMineableShears}, {@link AddMineableHoe} and {@link BehaviourCompostable} behaviours. */ -public interface BehaviourVine extends AddMineableShears, AddMineableHoe, BehaviourCompostable, BehaviourClimable { +public interface BehaviourVine extends AddMineableShears, AddMineableHoe, BehaviourPlantLike, BehaviourCompostable, BehaviourClimable { } diff --git a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourWaterPlant.java b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourWaterPlant.java index c815b07b..8a2f8a22 100644 --- a/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourWaterPlant.java +++ b/src/main/java/org/betterx/bclib/behaviours/interfaces/BehaviourWaterPlant.java @@ -2,5 +2,5 @@ package org.betterx.bclib.behaviours.interfaces; import org.betterx.bclib.interfaces.tools.AddMineableHoe; -public interface BehaviourWaterPlant extends AddMineableHoe, BehaviourCompostable { +public interface BehaviourWaterPlant extends AddMineableHoe, BehaviourPlantLike, BehaviourCompostable { } diff --git a/src/main/java/org/betterx/bclib/creativetab/BCLCreativeTab.java b/src/main/java/org/betterx/bclib/creativetab/BCLCreativeTab.java index 84ff72c9..a85db19c 100644 --- a/src/main/java/org/betterx/bclib/creativetab/BCLCreativeTab.java +++ b/src/main/java/org/betterx/bclib/creativetab/BCLCreativeTab.java @@ -1,6 +1,7 @@ package org.betterx.bclib.creativetab; -import org.betterx.bclib.behaviours.interfaces.*; +import org.betterx.bclib.behaviours.interfaces.BehaviourLeaves; +import org.betterx.bclib.behaviours.interfaces.BehaviourPlantLike; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; @@ -17,12 +18,8 @@ import org.jetbrains.annotations.NotNull; public class BCLCreativeTab { public static CreativeTabPredicate NATURE = item -> item instanceof BlockItem bi - && (bi.getBlock() instanceof BehaviourSapling - || bi.getBlock() instanceof BehaviourSeed - || bi.getBlock() instanceof BehaviourLeaves - || bi.getBlock() instanceof BehaviourPlant - || bi.getBlock() instanceof BehaviourWaterPlant - || bi.getBlock() instanceof BehaviourVine); + && (bi.getBlock() instanceof BehaviourPlantLike + || bi.getBlock() instanceof BehaviourLeaves); public static CreativeTabPredicate BLOCKS = item -> item instanceof BlockItem; diff --git a/src/main/java/org/betterx/bclib/util/BlocksHelper.java b/src/main/java/org/betterx/bclib/util/BlocksHelper.java index 86abbf86..ef827b11 100644 --- a/src/main/java/org/betterx/bclib/util/BlocksHelper.java +++ b/src/main/java/org/betterx/bclib/util/BlocksHelper.java @@ -1,7 +1,6 @@ package org.betterx.bclib.util; -import org.betterx.bclib.behaviours.interfaces.BehaviourPlant; -import org.betterx.bclib.behaviours.interfaces.BehaviourSeed; +import org.betterx.bclib.behaviours.interfaces.BehaviourPlantLike; import org.betterx.worlds.together.tag.v3.CommonBlockTags; import net.minecraft.core.BlockPos; @@ -353,7 +352,7 @@ public class BlocksHelper { public static Boolean replaceableOrPlant(BlockState state) { final Block block = state.getBlock(); - if (state.is(CommonBlockTags.PLANT) || state.is(CommonBlockTags.WATER_PLANT) || block instanceof BehaviourPlant || block instanceof BehaviourSeed) { + if (state.is(CommonBlockTags.PLANT) || state.is(CommonBlockTags.WATER_PLANT) || block instanceof BehaviourPlantLike) { return true; } if (state.getPistonPushReaction() == PushReaction.DESTROY && block.defaultDestroyTime() == 0) return true;