diff --git a/gradle.properties b/gradle.properties index c44ce364..34e75d23 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ loader_version= 0.11.6 fabric_version = 0.39.1+1.17 # Mod Properties -mod_version = 0.4.1 +mod_version = 0.4.2 maven_group = ru.bclib archives_base_name = bclib diff --git a/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java b/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java index 4c6861bf..3ac139bf 100644 --- a/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java @@ -1,6 +1,11 @@ package ru.bclib.blocks; +import java.util.Collections; +import java.util.List; +import java.util.function.Consumer; + import com.google.common.collect.Lists; + import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; import net.minecraft.client.renderer.block.model.BlockModel; @@ -15,17 +20,14 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; +import ru.bclib.api.TagAPI; import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.interfaces.BlockModelProvider; import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.MHelper; -import java.util.Collections; -import java.util.List; -import java.util.function.Consumer; - public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider, RenderLayerProvider { - private final Block sapling; + protected final Block sapling; private static FabricBlockSettings makeLeaves(MaterialColor color) { return FabricBlockSettings.copyOf(Blocks.OAK_LEAVES) @@ -37,25 +39,33 @@ public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider, .suffocates((state, world, pos) -> false) .blockVision((state, world, pos) -> false); } + + private void init(Block sapling) { + TagAPI.addTags(this, TagAPI.BLOCK_LEAVES); + } public BaseLeavesBlock(Block sapling, MaterialColor color, Consumer customizeProperties) { super(BaseBlock.acceptAndReturn(customizeProperties, makeLeaves(color))); this.sapling = sapling; + init(sapling); } - + public BaseLeavesBlock(Block sapling, MaterialColor color, int light, Consumer customizeProperties) { super(BaseBlock.acceptAndReturn(customizeProperties, makeLeaves(color).luminance(light))); this.sapling = sapling; + init(sapling); } public BaseLeavesBlock(Block sapling, MaterialColor color) { super(makeLeaves(color)); this.sapling = sapling; + init(sapling); } public BaseLeavesBlock(Block sapling, MaterialColor color, int light) { super(makeLeaves(color).lightLevel(light)); this.sapling = sapling; + init(sapling); } @Override diff --git a/src/main/java/ru/bclib/blocks/SimpleLeavesBlock.java b/src/main/java/ru/bclib/blocks/SimpleLeavesBlock.java index 47195b4f..4f4d1128 100644 --- a/src/main/java/ru/bclib/blocks/SimpleLeavesBlock.java +++ b/src/main/java/ru/bclib/blocks/SimpleLeavesBlock.java @@ -4,6 +4,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.MaterialColor; +import ru.bclib.api.TagAPI; import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.interfaces.RenderLayerProvider; @@ -17,6 +18,8 @@ public class SimpleLeavesBlock extends BaseBlockNotFull implements RenderLayerPr .isValidSpawn((state, world, pos, type) -> false) .isSuffocating((state, world, pos) -> false) .isViewBlocking((state, world, pos) -> false)); + + TagAPI.addTags(this, TagAPI.BLOCK_LEAVES); } public SimpleLeavesBlock(MaterialColor color, int light) { @@ -29,6 +32,8 @@ public class SimpleLeavesBlock extends BaseBlockNotFull implements RenderLayerPr .isValidSpawn((state, world, pos, type) -> false) .isSuffocating((state, world, pos) -> false) .isViewBlocking((state, world, pos) -> false)); + + TagAPI.addTags(this, TagAPI.BLOCK_LEAVES); } @Override