diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch new file mode 100644 index 0000000000..5a04d1bb18 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch @@ -0,0 +1,81 @@ +--- a/net/minecraft/world/level/block/PointedDripstoneBlock.java ++++ b/net/minecraft/world/level/block/PointedDripstoneBlock.java +@@ -42,6 +42,10 @@ + import net.minecraft.world.phys.shapes.CollisionContext; + import net.minecraft.world.phys.shapes.Shapes; + import net.minecraft.world.phys.shapes.VoxelShape; ++// CraftBukkit start ++import org.bukkit.craftbukkit.block.CraftBlock; ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++// CraftBukkit end + + public class PointedDripstoneBlock extends Block implements Fallable, SimpleWaterloggedBlock { + +@@ -136,18 +135,24 @@ + if (!level.isClientSide) { + BlockPos blockpos = blockhitresult.getBlockPos(); + +- if (projectile.mayInteract(level, blockpos) && projectile.mayBreak(level) && projectile instanceof ThrownTrident && projectile.getDeltaMovement().length() > 0.6D) { +- level.destroyBlock(blockpos, true); ++ if (projectile.mayInteract(level, blockposition) && projectile.mayBreak(level) && projectile instanceof ThrownTrident && projectile.getDeltaMovement().length() > 0.6D) { ++ // CraftBukkit start ++ if (!CraftEventFactory.callEntityChangeBlockEvent(projectile, blockposition, Blocks.AIR.defaultBlockState())) { ++ return; ++ } ++ // CraftBukkit end ++ level.destroyBlock(blockposition, true); + } + + } + } + + @Override +- @Override +- public void fallOn(Level level, BlockState blockstate, BlockPos blockpos, Entity entity, float f) { +- if (blockstate.getValue(PointedDripstoneBlock.TIP_DIRECTION) == Direction.UP && blockstate.getValue(PointedDripstoneBlock.THICKNESS) == DripstoneThickness.TIP) { +- entity.causeFallDamage(f + 2.0F, 2.0F, level.damageSources().stalagmite()); ++ public void fallOn(Level level, IBlockData state, BlockPos pos, Entity entity, float fallDistance) { ++ if (state.getValue(PointedDripstoneBlock.TIP_DIRECTION) == Direction.UP && state.getValue(PointedDripstoneBlock.THICKNESS) == DripstoneThickness.TIP) { ++ CraftEventFactory.blockDamage = CraftBlock.at(level, pos); // CraftBukkit ++ entity.causeFallDamage(fallDistance + 2.0F, 2.0F, level.damageSources().stalagmite()); ++ CraftEventFactory.blockDamage = null; // CraftBukkit + } else { + super.fallOn(level, blockstate, blockpos, entity, f); + } +@@ -400,18 +394,18 @@ + BlockPos blockpos1 = blockpos.relative(direction); + BlockState blockstate = serverlevel.getBlockState(blockpos1); + +- if (isUnmergedTipWithDirection(blockstate, direction.getOpposite())) { +- createMergedTips(blockstate, serverlevel, blockpos1); +- } else if (blockstate.isAir() || blockstate.is(Blocks.WATER)) { +- createDripstone(serverlevel, blockpos1, direction, DripstoneThickness.TIP); ++ if (isUnmergedTipWithDirection(iblockdata, direction.getOpposite())) { ++ createMergedTips(iblockdata, server, blockposition1); ++ } else if (iblockdata.isAir() || iblockdata.is(Blocks.WATER)) { ++ createDripstone(server, blockposition1, direction, DripstoneThickness.TIP, pos); // CraftBukkit + } + + } + +- private static void createDripstone(LevelAccessor levelaccessor, BlockPos blockpos, Direction direction, DripstoneThickness dripstonethickness) { +- BlockState blockstate = (BlockState) ((BlockState) ((BlockState) Blocks.POINTED_DRIPSTONE.defaultBlockState().setValue(PointedDripstoneBlock.TIP_DIRECTION, direction)).setValue(PointedDripstoneBlock.THICKNESS, dripstonethickness)).setValue(PointedDripstoneBlock.WATERLOGGED, levelaccessor.getFluidState(blockpos).getType() == Fluids.WATER); ++ private static void createDripstone(LevelAccessor generatoraccess, BlockPos blockposition, Direction enumdirection, DripstoneThickness dripstonethickness, BlockPos source) { // CraftBukkit ++ IBlockData iblockdata = (IBlockData) ((IBlockData) ((IBlockData) Blocks.POINTED_DRIPSTONE.defaultBlockState().setValue(PointedDripstoneBlock.TIP_DIRECTION, enumdirection)).setValue(PointedDripstoneBlock.THICKNESS, dripstonethickness)).setValue(PointedDripstoneBlock.WATERLOGGED, generatoraccess.getFluidState(blockposition).getType() == Fluids.WATER); + +- levelaccessor.setBlock(blockpos, blockstate, 3); ++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(generatoraccess, source, blockposition, iblockdata, 3); // CraftBukkit + } + + private static void createMergedTips(BlockState blockstate, LevelAccessor levelaccessor, BlockPos blockpos) { +@@ -426,8 +420,8 @@ + blockpos1 = blockpos.below(); + } + +- createDripstone(levelaccessor, blockpos2, Direction.DOWN, DripstoneThickness.TIP_MERGE); +- createDripstone(levelaccessor, blockpos1, Direction.UP, DripstoneThickness.TIP_MERGE); ++ createDripstone(level, blockposition2, Direction.DOWN, DripstoneThickness.TIP_MERGE, pos); // CraftBukkit ++ createDripstone(level, blockposition1, Direction.UP, DripstoneThickness.TIP_MERGE, pos); // CraftBukkit + } + + public static void spawnDripParticle(Level level, BlockPos blockpos, BlockState blockstate) { |