aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/world/level/block/BushBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/level/block/BushBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower/net/minecraft/world/level/block/BushBlock.java.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/level/block/BushBlock.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/level/block/BushBlock.java.patch
new file mode 100644
index 0000000000..940c4aed25
--- /dev/null
+++ b/patch-remap/mache-vineflower/net/minecraft/world/level/block/BushBlock.java.patch
@@ -0,0 +1,64 @@
+--- a/net/minecraft/world/level/block/BushBlock.java
++++ b/net/minecraft/world/level/block/BushBlock.java
+@@ -8,10 +8,11 @@
+ 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.pathfinder.PathComputationType;
++import net.minecraft.world.level.block.state.IBlockData;
++import net.minecraft.world.level.pathfinder.PathMode;
+
+ public abstract class BushBlock extends Block {
++
+ protected BushBlock(BlockBehaviour.Properties properties) {
+ super(properties);
+ }
+@@ -19,30 +20,36 @@
+ @Override
+ protected abstract MapCodec<? extends BushBlock> codec();
+
+- protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) {
++ protected boolean mayPlaceOn(IBlockData state, BlockGetter level, BlockPos pos) {
+ return state.is(BlockTags.DIRT) || state.is(Blocks.FARMLAND);
+ }
+
+ @Override
+- public BlockState updateShape(BlockState state, Direction facing, BlockState facingState, LevelAccessor level, BlockPos currentPos, BlockPos facingPos) {
+- return !state.canSurvive(level, currentPos)
+- ? Blocks.AIR.defaultBlockState()
+- : super.updateShape(state, facing, facingState, level, currentPos, facingPos);
++ public IBlockData updateShape(IBlockData state, Direction facing, IBlockData facingState, LevelAccessor level, BlockPos currentPos, BlockPos facingPos) {
++ // CraftBukkit start
++ if (!state.canSurvive(level, currentPos)) {
++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(level, currentPos).isCancelled()) {
++ return Blocks.AIR.defaultBlockState();
++ }
++ }
++ return super.updateShape(state, facing, facingState, level, currentPos, facingPos);
++ // CraftBukkit end
+ }
+
+ @Override
+- public boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) {
+- BlockPos blockPos = pos.below();
+- return this.mayPlaceOn(level.getBlockState(blockPos), level, blockPos);
++ public boolean canSurvive(IBlockData state, LevelReader level, BlockPos pos) {
++ BlockPos blockposition1 = pos.below();
++
++ return this.mayPlaceOn(level.getBlockState(blockposition1), level, blockposition1);
+ }
+
+ @Override
+- public boolean propagatesSkylightDown(BlockState state, BlockGetter reader, BlockPos pos) {
++ public boolean propagatesSkylightDown(IBlockData state, BlockGetter reader, BlockPos pos) {
+ return state.getFluidState().isEmpty();
+ }
+
+ @Override
+- public boolean isPathfindable(BlockState state, BlockGetter level, BlockPos pos, PathComputationType type) {
+- return type == PathComputationType.AIR && !this.hasCollision || super.isPathfindable(state, level, pos, type);
++ public boolean isPathfindable(IBlockData state, BlockGetter level, BlockPos pos, PathMode type) {
++ return type == PathMode.AIR && !this.hasCollision ? true : super.isPathfindable(state, level, pos, type);
+ }
+ }