diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/tree/CypressTreeFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/tree/CypressTreeFeature.java index e80575f20..53aafb3ec 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/tree/CypressTreeFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/tree/CypressTreeFeature.java @@ -10,11 +10,9 @@ package biomesoplenty.common.world.gen.feature.tree; import biomesoplenty.api.block.BOPBlocks; import biomesoplenty.common.util.biome.GeneratorUtil; import biomesoplenty.common.util.block.IBlockPosQuery; -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.block.SaplingBlock; -import net.minecraft.block.SeaGrassBlock; +import net.minecraft.block.*; import net.minecraft.block.material.Material; +import net.minecraft.tags.BlockTags; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; @@ -37,7 +35,7 @@ public class CypressTreeFeature extends TreeFeatureBase this.minHeight = 6; this.maxHeight = 15; this.placeOn = (world, pos) -> world.getBlockState(pos).canSustainPlant(world, pos, Direction.UP, (SaplingBlock)Blocks.OAK_SAPLING); - this.replace = (world, pos) -> world.getBlockState(pos).canBeReplacedByLeaves(world, pos) || world.getBlockState(pos).getMaterial() == Material.WATER; + this.replace = (world, pos) -> world.getBlockState(pos).canBeReplacedByLeaves(world, pos) || world.getBlockState(pos).getMaterial() == Material.WATER || world.getBlockState(pos).getBlock().isIn(BlockTags.SAPLINGS) || world.getBlockState(pos).getBlock() == Blocks.VINE || world.getBlockState(pos).getBlock() == BOPBlocks.willow_vine || world.getBlockState(pos).getBlock() instanceof BushBlock; this.log = BOPBlocks.willow_log.getDefaultState(); this.leaves = BOPBlocks.willow_leaves.getDefaultState(); this.vine = BOPBlocks.willow_vine.getDefaultState(); diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/tree/TreeFeatureBase.java b/src/main/java/biomesoplenty/common/world/gen/feature/tree/TreeFeatureBase.java index 96cc92d4f..93cdd1ff3 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/tree/TreeFeatureBase.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/tree/TreeFeatureBase.java @@ -7,13 +7,12 @@ ******************************************************************************/ package biomesoplenty.common.world.gen.feature.tree; +import biomesoplenty.api.block.BOPBlocks; import biomesoplenty.common.util.block.BlockUtil; import biomesoplenty.common.util.block.IBlockPosQuery; -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.block.SaplingBlock; -import net.minecraft.block.VineBlock; +import net.minecraft.block.*; import net.minecraft.state.IProperty; +import net.minecraft.tags.BlockTags; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MutableBoundingBox; @@ -44,7 +43,7 @@ public abstract class TreeFeatureBase extends AbstractTreeFeature world.getBlockState(pos).canSustainPlant(world, pos, Direction.UP, (SaplingBlock)Blocks.OAK_SAPLING); - this.replace = (world, pos) -> world.getBlockState(pos).canBeReplacedByLeaves(world, pos); + this.replace = (world, pos) -> world.getBlockState(pos).canBeReplacedByLeaves(world, pos) || world.getBlockState(pos).getBlock().isIn(BlockTags.SAPLINGS) || world.getBlockState(pos).getBlock() == Blocks.VINE || world.getBlockState(pos).getBlock() == BOPBlocks.willow_vine || world.getBlockState(pos).getBlock() instanceof BushBlock; this.log = Blocks.OAK_LOG.getDefaultState(); this.leaves = Blocks.OAK_LEAVES.getDefaultState(); this.vine = Blocks.AIR.getDefaultState(); diff --git a/src/main/resources/data/biomesoplenty/advancements/recipes/building_blocks/mossy_cobblestone_from_willow_vine.json b/src/main/resources/data/biomesoplenty/advancements/recipes/building_blocks/mossy_cobblestone_from_willow_vine.json new file mode 100644 index 000000000..70e9f6b02 --- /dev/null +++ b/src/main/resources/data/biomesoplenty/advancements/recipes/building_blocks/mossy_cobblestone_from_willow_vine.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "minecraft:mossy_cobblestone" + ] + }, + "criteria": { + "has_vine": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "biomesoplenty:willow_vine" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "minecraft:mossy_cobblestone" + } + } + }, + "requirements": [ + [ + "has_vine", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/biomesoplenty/recipes/mossy_cobblestone_from_willow_vine.json b/src/main/resources/data/biomesoplenty/recipes/mossy_cobblestone_from_willow_vine.json new file mode 100644 index 000000000..4c0b1aa2f --- /dev/null +++ b/src/main/resources/data/biomesoplenty/recipes/mossy_cobblestone_from_willow_vine.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "minecraft:cobblestone" + }, + { + "item": "biomesoplenty:willow_vine" + } + ], + "result": { + "item": "minecraft:mossy_cobblestone" + } +} \ No newline at end of file diff --git a/src/main/resources/data/biomesoplenty/recipes/mossy_stone_bricks_from_willow_vine.json b/src/main/resources/data/biomesoplenty/recipes/mossy_stone_bricks_from_willow_vine.json new file mode 100644 index 000000000..f7d30f069 --- /dev/null +++ b/src/main/resources/data/biomesoplenty/recipes/mossy_stone_bricks_from_willow_vine.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "minecraft:stone_bricks" + }, + { + "item": "biomesoplenty:willow_vine" + } + ], + "result": { + "item": "minecraft:mossy_stone_bricks" + } +} \ No newline at end of file