diff options
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/level/block/BambooSaplingBlock.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower/net/minecraft/world/level/block/BambooSaplingBlock.java.patch | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/level/block/BambooSaplingBlock.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/level/block/BambooSaplingBlock.java.patch new file mode 100644 index 0000000000..6998c5134c --- /dev/null +++ b/patch-remap/mache-vineflower/net/minecraft/world/level/block/BambooSaplingBlock.java.patch @@ -0,0 +1,100 @@ +--- a/net/minecraft/world/level/block/BambooSaplingBlock.java ++++ b/net/minecraft/world/level/block/BambooSaplingBlock.java +@@ -15,20 +15,21 @@ + import net.minecraft.world.level.LevelAccessor; + import net.minecraft.world.level.LevelReader; + import net.minecraft.world.level.block.state.BlockBehaviour; +-import net.minecraft.world.level.block.state.BlockState; ++import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.level.block.state.properties.BambooLeaves; + import net.minecraft.world.phys.Vec3; + import net.minecraft.world.phys.shapes.CollisionContext; + import net.minecraft.world.phys.shapes.VoxelShape; + + public class BambooSaplingBlock extends Block implements BonemealableBlock { ++ + public static final MapCodec<BambooSaplingBlock> CODEC = simpleCodec(BambooSaplingBlock::new); + protected static final float SAPLING_AABB_OFFSET = 4.0F; +- protected static final VoxelShape SAPLING_SHAPE = Block.box(4.0, 0.0, 4.0, 12.0, 12.0, 12.0); ++ protected static final VoxelShape SAPLING_SHAPE = Block.box(4.0D, 0.0D, 4.0D, 12.0D, 12.0D, 12.0D); + + @Override + public MapCodec<BambooSaplingBlock> codec() { +- return CODEC; ++ return BambooSaplingBlock.CODEC; + } + + public BambooSaplingBlock(BlockBehaviour.Properties properties) { +@@ -36,25 +37,27 @@ + } + + @Override +- public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) { +- Vec3 offset = state.getOffset(level, pos); +- return SAPLING_SHAPE.move(offset.x, offset.y, offset.z); ++ public VoxelShape getShape(IBlockData state, BlockGetter level, BlockPos pos, CollisionContext context) { ++ Vec3 vec3d = state.getOffset(level, pos); ++ ++ return BambooSaplingBlock.SAPLING_SHAPE.move(vec3d.x, vec3d.y, vec3d.z); + } + + @Override +- public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { ++ public void randomTick(IBlockData state, ServerLevel level, BlockPos pos, RandomSource random) { + if (random.nextInt(3) == 0 && level.isEmptyBlock(pos.above()) && level.getRawBrightness(pos.above(), 0) >= 9) { + this.growBamboo(level, pos); + } ++ + } + + @Override +- public boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) { ++ public boolean canSurvive(IBlockData state, LevelReader level, BlockPos pos) { + return level.getBlockState(pos.below()).is(BlockTags.BAMBOO_PLANTABLE_ON); + } + + @Override +- public BlockState updateShape(BlockState state, Direction facing, BlockState facingState, LevelAccessor level, BlockPos currentPos, BlockPos facingPos) { ++ public IBlockData updateShape(IBlockData state, Direction facing, IBlockData facingState, LevelAccessor level, BlockPos currentPos, BlockPos facingPos) { + if (!state.canSurvive(level, currentPos)) { + return Blocks.AIR.defaultBlockState(); + } else { +@@ -67,31 +70,31 @@ + } + + @Override +- public ItemStack getCloneItemStack(LevelReader levelReader, BlockPos blockPos, BlockState blockState) { ++ public ItemStack getCloneItemStack(LevelReader iworldreader, BlockPos blockposition, IBlockData iblockdata) { + return new ItemStack(Items.BAMBOO); + } + + @Override +- public boolean isValidBonemealTarget(LevelReader levelReader, BlockPos blockPos, BlockState blockState) { +- return levelReader.getBlockState(blockPos.above()).isAir(); ++ public boolean isValidBonemealTarget(LevelReader iworldreader, BlockPos blockposition, IBlockData iblockdata) { ++ return iworldreader.getBlockState(blockposition.above()).isAir(); + } + + @Override +- public boolean isBonemealSuccess(Level level, RandomSource random, BlockPos pos, BlockState state) { ++ public boolean isBonemealSuccess(Level level, RandomSource random, BlockPos pos, IBlockData state) { + return true; + } + + @Override +- public void performBonemeal(ServerLevel level, RandomSource random, BlockPos pos, BlockState state) { ++ public void performBonemeal(ServerLevel level, RandomSource random, BlockPos pos, IBlockData state) { + this.growBamboo(level, pos); + } + + @Override +- public float getDestroyProgress(BlockState state, Player player, BlockGetter level, BlockPos pos) { ++ public float getDestroyProgress(IBlockData state, Player player, BlockGetter level, BlockPos pos) { + return player.getMainHandItem().getItem() instanceof SwordItem ? 1.0F : super.getDestroyProgress(state, player, level, pos); + } + + protected void growBamboo(Level level, BlockPos state) { +- level.setBlock(state.above(), Blocks.BAMBOO.defaultBlockState().setValue(BambooStalkBlock.LEAVES, BambooLeaves.SMALL), 3); ++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(level, state, state.above(), (IBlockData) Blocks.BAMBOO.defaultBlockState().setValue(BambooStalkBlock.LEAVES, BambooLeaves.SMALL), 3); // CraftBukkit - BlockSpreadEvent + } + } |