aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/world/level/block/WaterlilyBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/level/block/WaterlilyBlock.java.patch')
-rw-r--r--patch-remap/mache-spigotflower/net/minecraft/world/level/block/WaterlilyBlock.java.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/level/block/WaterlilyBlock.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/WaterlilyBlock.java.patch
new file mode 100644
index 0000000000..fd16d2e1d9
--- /dev/null
+++ b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/WaterlilyBlock.java.patch
@@ -0,0 +1,71 @@
+--- a/net/minecraft/world/level/block/WaterlilyBlock.java
++++ b/net/minecraft/world/level/block/WaterlilyBlock.java
+@@ -8,11 +8,14 @@
+ import net.minecraft.world.level.BlockGetter;
+ import net.minecraft.world.level.Level;
+ 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.material.FluidState;
+ import net.minecraft.world.level.material.Fluids;
+ import net.minecraft.world.phys.shapes.CollisionContext;
+ import net.minecraft.world.phys.shapes.VoxelShape;
++// CraftBukkit start
++import org.bukkit.craftbukkit.event.CraftEventFactory;
++// CraftBukkit end
+
+ public class WaterlilyBlock extends BushBlock {
+
+@@ -20,37 +23,38 @@
+ protected static final VoxelShape AABB = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 1.5D, 15.0D);
+
+ @Override
+- @Override
+ public MapCodec<WaterlilyBlock> codec() {
+ return WaterlilyBlock.CODEC;
+ }
+
+- protected WaterlilyBlock(BlockBehaviour.Properties blockbehaviour_properties) {
+- super(blockbehaviour_properties);
++ protected WaterlilyBlock(BlockBehaviour.Properties properties) {
++ super(properties);
+ }
+
+ @Override
+- @Override
+- public void entityInside(BlockState blockstate, Level level, BlockPos blockpos, Entity entity) {
+- super.entityInside(blockstate, level, blockpos, entity);
++ public void entityInside(IBlockData state, Level level, BlockPos pos, Entity entity) {
++ super.entityInside(state, level, pos, entity);
+ if (level instanceof ServerLevel && entity instanceof Boat) {
+- level.destroyBlock(new BlockPos(blockpos), true, entity);
++ // CraftBukkit start
++ if (!CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState())) {
++ return;
++ }
++ // CraftBukkit end
++ level.destroyBlock(new BlockPos(pos), true, entity);
+ }
+
+ }
+
+ @Override
+- @Override
+- public VoxelShape getShape(BlockState blockstate, BlockGetter blockgetter, BlockPos blockpos, CollisionContext collisioncontext) {
++ public VoxelShape getShape(IBlockData state, BlockGetter level, BlockPos pos, CollisionContext context) {
+ return WaterlilyBlock.AABB;
+ }
+
+ @Override
+- @Override
+- protected boolean mayPlaceOn(BlockState blockstate, BlockGetter blockgetter, BlockPos blockpos) {
+- FluidState fluidstate = blockgetter.getFluidState(blockpos);
+- FluidState fluidstate1 = blockgetter.getFluidState(blockpos.above());
++ protected boolean mayPlaceOn(IBlockData state, BlockGetter level, BlockPos pos) {
++ FluidState fluid = level.getFluidState(pos);
++ FluidState fluid1 = level.getFluidState(pos.above());
+
+- return (fluidstate.getType() == Fluids.WATER || blockstate.getBlock() instanceof IceBlock) && fluidstate1.getType() == Fluids.EMPTY;
++ return (fluid.getType() == Fluids.WATER || state.getBlock() instanceof IceBlock) && fluid1.getType() == Fluids.EMPTY;
+ }
+ }