Added branches for dead trees
This commit is contained in:
parent
6f0d4fd3da
commit
a18aeee5c7
15 changed files with 222 additions and 124 deletions
|
@ -252,6 +252,7 @@ public class BOPBlocks
|
||||||
public static Block reed;
|
public static Block reed;
|
||||||
public static Block watergrass;
|
public static Block watergrass;
|
||||||
public static Block mangrove_root;
|
public static Block mangrove_root;
|
||||||
|
public static Block dead_branch;
|
||||||
public static Block bramble;
|
public static Block bramble;
|
||||||
public static Block toadstool;
|
public static Block toadstool;
|
||||||
public static Block glowshroom;
|
public static Block glowshroom;
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright 2014-2019, the Biomes O' Plenty Team
|
||||||
|
*
|
||||||
|
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
|
||||||
|
*
|
||||||
|
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
|
||||||
|
******************************************************************************/
|
||||||
|
package biomesoplenty.common.block;
|
||||||
|
|
||||||
|
import biomesoplenty.api.block.BOPBlocks;
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.block.Blocks;
|
||||||
|
import net.minecraft.block.HorizontalBlock;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.fluid.Fluids;
|
||||||
|
import net.minecraft.item.BlockItemUseContext;
|
||||||
|
import net.minecraft.state.DirectionProperty;
|
||||||
|
import net.minecraft.state.StateContainer;
|
||||||
|
import net.minecraft.util.Direction;
|
||||||
|
import net.minecraft.util.Mirror;
|
||||||
|
import net.minecraft.util.Rotation;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||||
|
import net.minecraft.util.math.shapes.VoxelShape;
|
||||||
|
import net.minecraft.world.IBlockReader;
|
||||||
|
import net.minecraft.world.IWorld;
|
||||||
|
import net.minecraft.world.IWorldReader;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class DeadBranchBlock extends Block
|
||||||
|
{
|
||||||
|
public static final DirectionProperty FACING = HorizontalBlock.FACING;
|
||||||
|
private static final Map<Direction, VoxelShape> SHAPES = Maps.newEnumMap(ImmutableMap.of(Direction.NORTH, Block.box(4.0D, 0.0D, 4.0D, 12.0D, 16.0D, 16.0D), Direction.SOUTH, Block.box(4.0D, 0.0D, 0.0D, 12.0D, 16.0D, 12.0D), Direction.WEST, Block.box(4.0D, 0.0D, 4.0D, 16.0D, 16.0D, 12.0D), Direction.EAST, Block.box(0.0D, 0.0D, 4.0D, 12.0D, 16.0D, 12.0D)));
|
||||||
|
|
||||||
|
public DeadBranchBlock(Properties properties)
|
||||||
|
{
|
||||||
|
super(properties);
|
||||||
|
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH));
|
||||||
|
}
|
||||||
|
|
||||||
|
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||||
|
return SHAPES.get(state.getValue(FACING));
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockState rotate(BlockState state, Rotation rot) {
|
||||||
|
return state.setValue(FACING, rot.rotate(state.getValue(FACING)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockState mirror(BlockState state, Mirror mirrorIn) {
|
||||||
|
return state.rotate(mirrorIn.getRotation(state.getValue(FACING)));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
|
||||||
|
builder.add(FACING);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the provided state given the provided neighbor facing and neighbor state, returning a new state.
|
||||||
|
* For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately
|
||||||
|
* returns its solidified counterpart.
|
||||||
|
* Note that this method should ideally consider only the specific face passed in.
|
||||||
|
*/
|
||||||
|
public BlockState updateShape(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos)
|
||||||
|
{
|
||||||
|
return facing.getOpposite() == stateIn.getValue(FACING) && !stateIn.canSurvive(worldIn, currentPos) ? Blocks.AIR.defaultBlockState() : stateIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canSurvive(BlockState state, IWorldReader worldIn, BlockPos pos) {
|
||||||
|
Direction direction = state.getValue(FACING);
|
||||||
|
BlockPos blockpos = pos.relative(direction.getOpposite());
|
||||||
|
BlockState blockstate = worldIn.getBlockState(blockpos);
|
||||||
|
return blockstate.getBlock() == BOPBlocks.dead_log || blockstate.getBlock() == BOPBlocks.dead_wood;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||||
|
BlockState blockstate = super.getStateForPlacement(context);
|
||||||
|
IWorldReader iworldreader = context.getLevel();
|
||||||
|
BlockPos blockpos = context.getClickedPos();
|
||||||
|
Direction[] adirection = context.getNearestLookingDirections();
|
||||||
|
|
||||||
|
for(Direction direction : adirection) {
|
||||||
|
if (direction.getAxis().isHorizontal()) {
|
||||||
|
blockstate = blockstate.setValue(FACING, direction.getOpposite());
|
||||||
|
if (blockstate.canSurvive(iworldreader, blockpos)) {
|
||||||
|
return blockstate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -99,8 +99,8 @@ public class BOPBiomeFeatures
|
||||||
public static final Feature<BaseTreeFeatureConfig> ACACIA_TWIGLET = new TwigletTreeFeature.Builder().log(Blocks.ACACIA_LOG.defaultBlockState()).leaves(Blocks.ACACIA_LEAVES.defaultBlockState()).minHeight(1).maxHeight(2).create();
|
public static final Feature<BaseTreeFeatureConfig> ACACIA_TWIGLET = new TwigletTreeFeature.Builder().log(Blocks.ACACIA_LOG.defaultBlockState()).leaves(Blocks.ACACIA_LEAVES.defaultBlockState()).minHeight(1).maxHeight(2).create();
|
||||||
public static final Feature<BaseTreeFeatureConfig> MAPLE_TWIGLET_TREE = new TwigletTreeFeature.Builder().minHeight(1).maxHeight(2).leaves(BOPBlocks.maple_leaves.defaultBlockState()).create();
|
public static final Feature<BaseTreeFeatureConfig> MAPLE_TWIGLET_TREE = new TwigletTreeFeature.Builder().minHeight(1).maxHeight(2).leaves(BOPBlocks.maple_leaves.defaultBlockState()).create();
|
||||||
public static final Feature<BaseTreeFeatureConfig> DEAD_TWIGLET_TREE_SMALL = new TwigletTreeFeature.Builder().minHeight(1).maxHeight(1).leaves(BOPBlocks.dead_leaves.defaultBlockState()).log(BOPBlocks.dead_log.defaultBlockState()).create();
|
public static final Feature<BaseTreeFeatureConfig> DEAD_TWIGLET_TREE_SMALL = new TwigletTreeFeature.Builder().minHeight(1).maxHeight(1).leaves(BOPBlocks.dead_leaves.defaultBlockState()).log(BOPBlocks.dead_log.defaultBlockState()).create();
|
||||||
public static final Feature<BaseTreeFeatureConfig> DEAD_TWIGLET_TREE = new TwigletTreeFeature.Builder().leafChance(0.05F, 0.25F).leaves(BOPBlocks.dead_leaves.defaultBlockState()).log(BOPBlocks.dead_log.defaultBlockState()).minHeight(4).maxHeight(7).create();
|
public static final Feature<BaseTreeFeatureConfig> DEAD_TWIGLET_TREE = new TwigletTreeFeature.Builder().trunkFruit(BOPBlocks.dead_branch.defaultBlockState()).leafChance(0.05F, 0.25F).leaves(BOPBlocks.dead_leaves.defaultBlockState()).log(BOPBlocks.dead_log.defaultBlockState()).minHeight(4).maxHeight(7).create();
|
||||||
public static final Feature<BaseTreeFeatureConfig> DEAD_TWIGLET_TREE_TALL = new TwigletTreeFeature.Builder().leafChance(0.15F, 0.6F).leaves(BOPBlocks.dead_leaves.defaultBlockState()).log(BOPBlocks.dead_log.defaultBlockState()).minHeight(8).maxHeight(11).create();
|
public static final Feature<BaseTreeFeatureConfig> DEAD_TWIGLET_TREE_TALL = new TwigletTreeFeature.Builder().trunkFruit(BOPBlocks.dead_branch.defaultBlockState()).leafChance(0.15F, 0.6F).leaves(BOPBlocks.dead_leaves.defaultBlockState()).log(BOPBlocks.dead_log.defaultBlockState()).minHeight(8).maxHeight(12).create();
|
||||||
|
|
||||||
//Special Trees
|
//Special Trees
|
||||||
public static final Feature<BaseTreeFeatureConfig> REDWOOD_TREE = new RedwoodTreeFeature.Builder().create();
|
public static final Feature<BaseTreeFeatureConfig> REDWOOD_TREE = new RedwoodTreeFeature.Builder().create();
|
||||||
|
@ -108,9 +108,11 @@ public class BOPBiomeFeatures
|
||||||
public static final Feature<BaseTreeFeatureConfig> REDWOOD_TREE_LARGE = new RedwoodTreeFeature.Builder().minHeight(45).maxHeight(60).trunkWidth(3).create();
|
public static final Feature<BaseTreeFeatureConfig> REDWOOD_TREE_LARGE = new RedwoodTreeFeature.Builder().minHeight(45).maxHeight(60).trunkWidth(3).create();
|
||||||
public static final Feature<BaseTreeFeatureConfig> MAHOGANY_TREE = new MahoganyTreeFeature.Builder().create();
|
public static final Feature<BaseTreeFeatureConfig> MAHOGANY_TREE = new MahoganyTreeFeature.Builder().create();
|
||||||
public static final Feature<BaseTreeFeatureConfig> PALM_TREE = new PalmTreeFeature.Builder().create();
|
public static final Feature<BaseTreeFeatureConfig> PALM_TREE = new PalmTreeFeature.Builder().create();
|
||||||
public static final Feature<BaseTreeFeatureConfig> DEAD_TREE = new TrunkTreeFeature.Builder().log(BOPBlocks.dead_log.defaultBlockState()).leaves(Blocks.AIR.defaultBlockState()).create();
|
public static final Feature<BaseTreeFeatureConfig> DEAD_TREE = new TwigletTreeFeature.Builder().trunkFruit(BOPBlocks.dead_branch.defaultBlockState()).leafChance(0.0F, 0.0F).leaves(Blocks.AIR.defaultBlockState()).log(BOPBlocks.dead_log.defaultBlockState()).minHeight(6).maxHeight(10).create();
|
||||||
public static final Feature<BaseTreeFeatureConfig> DEAD_TREE_WASTELAND = new TrunkTreeFeature.Builder().placeOn((world, pos) -> world.getBlockState(pos).getBlock() == BOPBlocks.dried_salt).log(BOPBlocks.dead_log.defaultBlockState()).leaves(Blocks.AIR.defaultBlockState()).create();
|
public static final Feature<BaseTreeFeatureConfig> DEAD_TREE_WASTELAND = new TwigletTreeFeature.Builder().placeOn((world, pos) -> world.getBlockState(pos).getBlock() == BOPBlocks.dried_salt).trunkFruit(BOPBlocks.dead_branch.defaultBlockState()).leafChance(0.0F, 0.0F).leaves(Blocks.AIR.defaultBlockState()).log(BOPBlocks.dead_log.defaultBlockState()).minHeight(6).maxHeight(10).create();
|
||||||
public static final Feature<BaseTreeFeatureConfig> DEAD_TREE_VOLCANO = new TrunkTreeFeature.Builder().placeOn((world, pos) -> world.getBlockState(pos).getBlock() == Blocks.GRAVEL).log(BOPBlocks.dead_log.defaultBlockState()).leaves(Blocks.AIR.defaultBlockState()).create();
|
public static final Feature<BaseTreeFeatureConfig> DEAD_TREE_VOLCANO = new TwigletTreeFeature.Builder().placeOn((world, pos) -> world.getBlockState(pos).getBlock() == Blocks.GRAVEL).trunkFruit(BOPBlocks.dead_branch.defaultBlockState()).leafChance(0.0F, 0.0F).leaves(Blocks.AIR.defaultBlockState()).log(BOPBlocks.dead_log.defaultBlockState()).minHeight(6).maxHeight(10).create();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ public abstract class TreeFeatureBase extends AbstractTreeFeature<BaseTreeFeatur
|
||||||
public BuilderBase()
|
public BuilderBase()
|
||||||
{
|
{
|
||||||
this.placeOn = (world, pos) -> world.getBlockState(pos).canSustainPlant(world, pos, Direction.UP, (SaplingBlock)Blocks.OAK_SAPLING);
|
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).getBlock().is(BlockTags.SAPLINGS) || world.getBlockState(pos).getBlock() == Blocks.VINE || world.getBlockState(pos).getBlock() == BOPBlocks.willow_vine || world.getBlockState(pos).getBlock() instanceof BushBlock;
|
this.replace = (world, pos) -> world.getBlockState(pos).canBeReplacedByLeaves(world, pos) || world.getBlockState(pos).getBlock().is(BlockTags.SAPLINGS) || world.getBlockState(pos).getBlock() == Blocks.VINE || world.getBlockState(pos).getBlock() == BOPBlocks.willow_vine || world.getBlockState(pos).getBlock() == BOPBlocks.dead_branch || world.getBlockState(pos).getBlock() instanceof BushBlock;
|
||||||
this.log = Blocks.OAK_LOG.defaultBlockState();
|
this.log = Blocks.OAK_LOG.defaultBlockState();
|
||||||
this.leaves = Blocks.OAK_LEAVES.defaultBlockState();
|
this.leaves = Blocks.OAK_LEAVES.defaultBlockState();
|
||||||
this.vine = Blocks.AIR.defaultBlockState();
|
this.vine = Blocks.AIR.defaultBlockState();
|
||||||
|
|
|
@ -1,107 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2019, the Biomes O' Plenty Team
|
|
||||||
*
|
|
||||||
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
|
|
||||||
*
|
|
||||||
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
|
|
||||||
******************************************************************************/
|
|
||||||
package biomesoplenty.common.world.gen.feature.tree;
|
|
||||||
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtil;
|
|
||||||
import biomesoplenty.common.util.block.IBlockPosQuery;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.MutableBoundingBox;
|
|
||||||
import net.minecraft.world.IWorld;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public class TrunkTreeFeature extends TreeFeatureBase
|
|
||||||
{
|
|
||||||
public static class Builder extends BuilderBase<TrunkTreeFeature.Builder, TrunkTreeFeature>
|
|
||||||
{
|
|
||||||
public Builder()
|
|
||||||
{
|
|
||||||
this.minHeight = 7;
|
|
||||||
this.maxHeight = 11;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TrunkTreeFeature create()
|
|
||||||
{
|
|
||||||
return new TrunkTreeFeature(this.placeOn, this.replace, this.log, this.leaves, this.altLeaves, this.vine, this.hanging, this.trunkFruit, this.minHeight, this.maxHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected TrunkTreeFeature(IBlockPosQuery placeOn, IBlockPosQuery replace, BlockState log, BlockState leaves, BlockState altLeaves, BlockState vine, BlockState hanging, BlockState trunkFruit, int minHeight, int maxHeight)
|
|
||||||
{
|
|
||||||
super(placeOn, replace, log, leaves, altLeaves, vine, hanging, trunkFruit, minHeight, maxHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean place(Set<BlockPos> changedLogs, Set<BlockPos> changedLeaves, IWorld world, Random random, BlockPos startPos, MutableBoundingBox boundingBox)
|
|
||||||
{
|
|
||||||
// Move down until we reach the ground
|
|
||||||
while (startPos.getY() > 1 && world.isEmptyBlock(startPos) || world.getBlockState(startPos).getMaterial() == Material.LEAVES) {startPos = startPos.below();}
|
|
||||||
|
|
||||||
if (!this.placeOn.matches(world, startPos))
|
|
||||||
{
|
|
||||||
// Abandon if we can't place the tree on this block
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generation settings
|
|
||||||
int height = GeneratorUtil.nextIntBetween(random, this.minHeight, this.maxHeight);
|
|
||||||
int leavesRadius = 2;
|
|
||||||
int heightMinusTop = height - leavesRadius - 1;
|
|
||||||
|
|
||||||
// Move up to space above ground
|
|
||||||
BlockPos pos = startPos.above();
|
|
||||||
|
|
||||||
if (!this.checkSpace(world, pos, height, 1))
|
|
||||||
{
|
|
||||||
// Abandon if there isn't enough room
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate trunk of tree (trunk only)
|
|
||||||
for(int step = 0; step <= heightMinusTop; step++)
|
|
||||||
{
|
|
||||||
BlockPos offsetPos = pos.above(step);
|
|
||||||
|
|
||||||
if (step == heightMinusTop)
|
|
||||||
{
|
|
||||||
// Generate top of tree
|
|
||||||
this.placeLog(world, offsetPos, changedLogs, boundingBox);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.placeLog(world, offsetPos, changedLogs, boundingBox);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean checkSpace(IWorld world, BlockPos pos, int height, int radius)
|
|
||||||
{
|
|
||||||
for (int y = 0; y <= height; y++)
|
|
||||||
{
|
|
||||||
for (int x = -radius; x <= radius; x++)
|
|
||||||
{
|
|
||||||
for (int z = -radius; z <= radius; z++)
|
|
||||||
{
|
|
||||||
BlockPos pos1 = pos.offset(x, y, z);
|
|
||||||
// note, there may be a sapling on the first layer - make sure this.replace matches it!
|
|
||||||
if (pos1.getY() >= 255 || !this.replace.matches(world, pos1))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -10,6 +10,7 @@ package biomesoplenty.common.world.gen.feature.tree;
|
||||||
import biomesoplenty.common.util.block.IBlockPosQuery;
|
import biomesoplenty.common.util.block.IBlockPosQuery;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
|
import net.minecraft.block.BushBlock;
|
||||||
import net.minecraft.block.CocoaBlock;
|
import net.minecraft.block.CocoaBlock;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
|
@ -121,17 +122,17 @@ public class TwigletTreeFeature extends TreeFeatureBase
|
||||||
|
|
||||||
if (this.trunkFruit != Blocks.AIR.defaultBlockState())
|
if (this.trunkFruit != Blocks.AIR.defaultBlockState())
|
||||||
{
|
{
|
||||||
if (random.nextInt(3) == 0)
|
for (Direction Direction : Direction.Plane.HORIZONTAL)
|
||||||
{
|
{
|
||||||
for (int l3 = 0; l3 < 2; ++l3)
|
if (random.nextInt(4) == 0)
|
||||||
{
|
{
|
||||||
for (Direction Direction : Direction.Plane.HORIZONTAL)
|
if (this.trunkFruit.getBlock() == Blocks.COCOA)
|
||||||
{
|
{
|
||||||
if (random.nextInt(4 - l3) == 0)
|
this.generateTrunkFruit(world, random.nextInt(3), pos.offset(Direction.getOpposite().getStepX(), 0, Direction.getOpposite().getStepZ()), Direction);
|
||||||
{
|
}
|
||||||
Direction Direction1 = Direction.getOpposite();
|
else
|
||||||
this.generateTrunkFruit(world, random.nextInt(3), pos.offset(Direction1.getStepX(), 0, Direction1.getStepZ()), Direction);
|
{
|
||||||
}
|
this.generateTrunkFruit(world, random.nextInt(3), pos.offset(Direction.getStepX(), y, Direction.getStepZ()), Direction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,11 +148,17 @@ public class TwigletTreeFeature extends TreeFeatureBase
|
||||||
{
|
{
|
||||||
if (this.trunkFruit == Blocks.COCOA.defaultBlockState())
|
if (this.trunkFruit == Blocks.COCOA.defaultBlockState())
|
||||||
{
|
{
|
||||||
this.setBlock(world, pos, this.trunkFruit.setValue(CocoaBlock.AGE, Integer.valueOf(age)).setValue(CocoaBlock.FACING, direction));
|
if (world.getBlockState(pos).getBlock() == Blocks.AIR || world.getBlockState(pos).getBlock() instanceof BushBlock)
|
||||||
|
{
|
||||||
|
this.setBlock(world, pos, this.trunkFruit.setValue(CocoaBlock.AGE, Integer.valueOf(age)).setValue(CocoaBlock.FACING, direction));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.setBlock(world, pos, this.trunkFruit.setValue(CocoaBlock.FACING, direction));
|
if (world.getBlockState(pos).getBlock() == Blocks.AIR || world.getBlockState(pos).getBlock() instanceof BushBlock)
|
||||||
|
{
|
||||||
|
this.setBlock(world, pos, this.trunkFruit.setValue(CocoaBlock.FACING, direction));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,6 +284,7 @@ public class ModBlocks
|
||||||
watergrass = registerBlock(new DoubleWaterPlantBlock(Block.Properties.of(Material.PLANT).noCollission().instabreak().sound(SoundType.GRASS)), "watergrass");
|
watergrass = registerBlock(new DoubleWaterPlantBlock(Block.Properties.of(Material.PLANT).noCollission().instabreak().sound(SoundType.GRASS)), "watergrass");
|
||||||
mangrove_root = registerBlock(new DoubleWaterPlantBlock(Block.Properties.of(Material.PLANT, MaterialColor.TERRACOTTA_WHITE).noCollission().strength(1.0F, 1.5F).sound(SoundType.WOOD)), "mangrove_root");
|
mangrove_root = registerBlock(new DoubleWaterPlantBlock(Block.Properties.of(Material.PLANT, MaterialColor.TERRACOTTA_WHITE).noCollission().strength(1.0F, 1.5F).sound(SoundType.WOOD)), "mangrove_root");
|
||||||
|
|
||||||
|
dead_branch = registerBlock(new DeadBranchBlock(Block.Properties.of(Material.WOOD, MaterialColor.COLOR_GRAY).noCollission().instabreak().sound(SoundType.WOOD)), "dead_branch");
|
||||||
bramble = registerBlock(new BrambleBlock(Block.Properties.of(Material.PLANT, MaterialColor.NETHER).strength(0.4F).harvestLevel(0).harvestTool(ToolType.AXE).sound(SoundType.WOOD)), "bramble");
|
bramble = registerBlock(new BrambleBlock(Block.Properties.of(Material.PLANT, MaterialColor.NETHER).strength(0.4F).harvestLevel(0).harvestTool(ToolType.AXE).sound(SoundType.WOOD)), "bramble");
|
||||||
toadstool = registerBlock(new MushroomBlockBOP(Block.Properties.of(Material.PLANT, MaterialColor.COLOR_ORANGE).noCollission().instabreak().sound(SoundType.GRASS)), "toadstool");
|
toadstool = registerBlock(new MushroomBlockBOP(Block.Properties.of(Material.PLANT, MaterialColor.COLOR_ORANGE).noCollission().instabreak().sound(SoundType.GRASS)), "toadstool");
|
||||||
glowshroom = registerBlock(new MushroomBlockBOP(Block.Properties.of(Material.PLANT, MaterialColor.DIAMOND).noCollission().instabreak().sound(SoundType.GRASS).lightLevel(6)), "glowshroom");
|
glowshroom = registerBlock(new MushroomBlockBOP(Block.Properties.of(Material.PLANT, MaterialColor.DIAMOND).noCollission().instabreak().sound(SoundType.GRASS).lightLevel(6)), "glowshroom");
|
||||||
|
@ -388,6 +389,7 @@ public class ModBlocks
|
||||||
RenderTypeLookup.setRenderLayer(reed, cutoutRenderType);
|
RenderTypeLookup.setRenderLayer(reed, cutoutRenderType);
|
||||||
RenderTypeLookup.setRenderLayer(watergrass, cutoutRenderType);
|
RenderTypeLookup.setRenderLayer(watergrass, cutoutRenderType);
|
||||||
RenderTypeLookup.setRenderLayer(mangrove_root, cutoutRenderType);
|
RenderTypeLookup.setRenderLayer(mangrove_root, cutoutRenderType);
|
||||||
|
RenderTypeLookup.setRenderLayer(dead_branch, cutoutRenderType);
|
||||||
RenderTypeLookup.setRenderLayer(bramble, cutoutRenderType);
|
RenderTypeLookup.setRenderLayer(bramble, cutoutRenderType);
|
||||||
RenderTypeLookup.setRenderLayer(toadstool, cutoutRenderType);
|
RenderTypeLookup.setRenderLayer(toadstool, cutoutRenderType);
|
||||||
RenderTypeLookup.setRenderLayer(glowshroom, cutoutRenderType);
|
RenderTypeLookup.setRenderLayer(glowshroom, cutoutRenderType);
|
||||||
|
|
|
@ -209,6 +209,7 @@ public class ModVanillaCompat
|
||||||
registerFlammable(BOPBlocks.dune_grass, 60, 100);
|
registerFlammable(BOPBlocks.dune_grass, 60, 100);
|
||||||
registerFlammable(BOPBlocks.desert_grass, 60, 100);
|
registerFlammable(BOPBlocks.desert_grass, 60, 100);
|
||||||
registerFlammable(BOPBlocks.dead_grass, 60, 100);
|
registerFlammable(BOPBlocks.dead_grass, 60, 100);
|
||||||
|
registerFlammable(BOPBlocks.dead_branch, 60, 100);
|
||||||
|
|
||||||
//Log Stripping
|
//Log Stripping
|
||||||
registerStrippable(BOPBlocks.fir_log, BOPBlocks.stripped_fir_log);
|
registerStrippable(BOPBlocks.fir_log, BOPBlocks.stripped_fir_log);
|
||||||
|
@ -300,7 +301,8 @@ public class ModVanillaCompat
|
||||||
registerCompostable(0.5F, BOPBlocks.watergrass);
|
registerCompostable(0.5F, BOPBlocks.watergrass);
|
||||||
registerCompostable(0.5F, BOPBlocks.mangrove_root);
|
registerCompostable(0.5F, BOPBlocks.mangrove_root);
|
||||||
|
|
||||||
registerCompostable(0.5F, BOPBlocks.bramble);
|
registerCompostable(0.3F, BOPBlocks.dead_branch);
|
||||||
|
registerCompostable(0.3F, BOPBlocks.bramble);
|
||||||
|
|
||||||
registerCompostable(0.65F, BOPBlocks.toadstool);
|
registerCompostable(0.65F, BOPBlocks.toadstool);
|
||||||
registerCompostable(0.65F, BOPBlocks.glowshroom);
|
registerCompostable(0.65F, BOPBlocks.glowshroom);
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"facing=east": { "model": "biomesoplenty:block/dead_branch", "y": 90 },
|
||||||
|
"facing=south": { "model": "biomesoplenty:block/dead_branch", "y": 180 },
|
||||||
|
"facing=west": { "model": "biomesoplenty:block/dead_branch", "y": 270 },
|
||||||
|
"facing=north": { "model": "biomesoplenty:block/dead_branch", "y": 0 }
|
||||||
|
}
|
||||||
|
}
|
|
@ -118,6 +118,7 @@
|
||||||
"block.biomesoplenty.chiseled_white_sandstone": "Chiseled White Sandstone",
|
"block.biomesoplenty.chiseled_white_sandstone": "Chiseled White Sandstone",
|
||||||
"block.biomesoplenty.cut_white_sandstone": "Cut White Sandstone",
|
"block.biomesoplenty.cut_white_sandstone": "Cut White Sandstone",
|
||||||
"block.biomesoplenty.cut_white_sandstone_slab": "Cut White Sandstone Slab",
|
"block.biomesoplenty.cut_white_sandstone_slab": "Cut White Sandstone Slab",
|
||||||
|
"block.biomesoplenty.dead_branch": "Dead Branch",
|
||||||
"block.biomesoplenty.dead_button": "Dead Button",
|
"block.biomesoplenty.dead_button": "Dead Button",
|
||||||
"block.biomesoplenty.dead_door": "Dead Door",
|
"block.biomesoplenty.dead_door": "Dead Door",
|
||||||
"block.biomesoplenty.dead_fence": "Dead Fence",
|
"block.biomesoplenty.dead_fence": "Dead Fence",
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"ambientocclusion": false,
|
||||||
|
"textures": {
|
||||||
|
"branch": "biomesoplenty:block/dead_branch",
|
||||||
|
"particle": "#branch"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [ 8, 0, 0 ],
|
||||||
|
"to": [ 8, 16, 16 ],
|
||||||
|
"rotation": { "origin": [ 8, 8, 14 ], "axis": "y", "angle": 22.5 },
|
||||||
|
"faces": {
|
||||||
|
"east": { "texture": "#branch", "uv": [ 0, 0, 16, 16 ] },
|
||||||
|
"west": { "texture": "#branch", "uv": [ 16, 0, 0, 16 ] }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [ 8, 0, 0 ],
|
||||||
|
"to": [ 8, 16, 16 ],
|
||||||
|
"rotation": { "origin": [ 8, 8, 14 ], "axis": "y", "angle": -22.5 },
|
||||||
|
"faces": {
|
||||||
|
"east": { "texture": "#branch", "uv": [ 0, 0, 16, 16 ] },
|
||||||
|
"west": { "texture": "#branch", "uv": [ 16, 0, 0, 16 ] }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "biomesoplenty:item/dead_branch"
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 306 B |
Binary file not shown.
After Width: | Height: | Size: 372 B |
|
@ -0,0 +1,50 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:block",
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"rolls": 1,
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:alternatives",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"condition": "minecraft:match_tool",
|
||||||
|
"predicate": {
|
||||||
|
"item": "minecraft:shears"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "biomesoplenty:dead_branch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"condition": "minecraft:random_chance",
|
||||||
|
"chance": 0.125
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"function": "minecraft:apply_bonus",
|
||||||
|
"enchantment": "minecraft:fortune",
|
||||||
|
"formula": "minecraft:uniform_bonus_count",
|
||||||
|
"parameters": {
|
||||||
|
"bonusMultiplier": 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"function": "minecraft:explosion_decay"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "minecraft:stick"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in a new issue