diff options
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/level/block/WaterlilyBlock.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower/net/minecraft/world/level/block/WaterlilyBlock.java.patch | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/level/block/WaterlilyBlock.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/level/block/WaterlilyBlock.java.patch new file mode 100644 index 0000000000..8cab7f6cb8 --- /dev/null +++ b/patch-remap/mache-vineflower/net/minecraft/world/level/block/WaterlilyBlock.java.patch @@ -0,0 +1,66 @@ +--- a/net/minecraft/world/level/block/WaterlilyBlock.java ++++ b/net/minecraft/world/level/block/WaterlilyBlock.java +@@ -8,19 +8,23 @@ + 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 { ++ + public static final MapCodec<WaterlilyBlock> CODEC = simpleCodec(WaterlilyBlock::new); +- protected static final VoxelShape AABB = Block.box(1.0, 0.0, 1.0, 15.0, 1.5, 15.0); ++ protected static final VoxelShape AABB = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 1.5D, 15.0D); + + @Override + public MapCodec<WaterlilyBlock> codec() { +- return CODEC; ++ return WaterlilyBlock.CODEC; + } + + protected WaterlilyBlock(BlockBehaviour.Properties properties) { +@@ -28,22 +32,29 @@ + } + + @Override +- public void entityInside(BlockState state, Level level, BlockPos pos, Entity 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) { ++ // CraftBukkit start ++ if (!CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState())) { ++ return; ++ } ++ // CraftBukkit end + level.destroyBlock(new BlockPos(pos), true, entity); + } ++ + } + + @Override +- public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) { +- return AABB; ++ public VoxelShape getShape(IBlockData state, BlockGetter level, BlockPos pos, CollisionContext context) { ++ return WaterlilyBlock.AABB; + } + + @Override +- protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) { +- FluidState fluidState = level.getFluidState(pos); +- FluidState fluidState1 = level.getFluidState(pos.above()); +- return (fluidState.getType() == Fluids.WATER || state.getBlock() instanceof IceBlock) && fluidState1.getType() == Fluids.EMPTY; ++ protected boolean mayPlaceOn(IBlockData state, BlockGetter level, BlockPos pos) { ++ FluidState fluid = level.getFluidState(pos); ++ FluidState fluid1 = level.getFluidState(pos.above()); ++ ++ return (fluid.getType() == Fluids.WATER || state.getBlock() instanceof IceBlock) && fluid1.getType() == Fluids.EMPTY; + } + } |