aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/level/block/PointedDripstoneBlock.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/PointedDripstoneBlock.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/level/block/PointedDripstoneBlock.patch93
1 files changed, 93 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/PointedDripstoneBlock.patch b/patch-remap/og/net/minecraft/world/level/block/PointedDripstoneBlock.patch
new file mode 100644
index 0000000000..9e2b95127e
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/level/block/PointedDripstoneBlock.patch
@@ -0,0 +1,93 @@
+--- a/net/minecraft/world/level/block/PointedDripstoneBlock.java
++++ b/net/minecraft/world/level/block/PointedDripstoneBlock.java
+@@ -43,6 +43,11 @@
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+
++// CraftBukkit start
++import org.bukkit.craftbukkit.block.CraftBlock;
++import org.bukkit.craftbukkit.event.CraftEventFactory;
++// CraftBukkit end
++
+ public class PointedDripstoneBlock extends Block implements Fallable, IBlockWaterlogged {
+
+ public static final MapCodec<PointedDripstoneBlock> CODEC = simpleCodec(PointedDripstoneBlock::new);
+@@ -132,6 +137,11 @@
+ BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
+
+ if (iprojectile.mayInteract(world, blockposition) && iprojectile.mayBreak(world) && iprojectile instanceof EntityThrownTrident && iprojectile.getDeltaMovement().length() > 0.6D) {
++ // CraftBukkit start
++ if (!CraftEventFactory.callEntityChangeBlockEvent(iprojectile, blockposition, Blocks.AIR.defaultBlockState())) {
++ return;
++ }
++ // CraftBukkit end
+ world.destroyBlock(blockposition, true);
+ }
+
+@@ -141,7 +151,9 @@
+ @Override
+ public void fallOn(World world, IBlockData iblockdata, BlockPosition blockposition, Entity entity, float f) {
+ if (iblockdata.getValue(PointedDripstoneBlock.TIP_DIRECTION) == EnumDirection.UP && iblockdata.getValue(PointedDripstoneBlock.THICKNESS) == DripstoneThickness.TIP) {
++ CraftEventFactory.blockDamage = CraftBlock.at(world, blockposition); // CraftBukkit
+ entity.causeFallDamage(f + 2.0F, 2.0F, world.damageSources().stalagmite());
++ CraftEventFactory.blockDamage = null; // CraftBukkit
+ } else {
+ super.fallOn(world, iblockdata, blockposition, entity, f);
+ }
+@@ -386,15 +398,15 @@
+ if (isUnmergedTipWithDirection(iblockdata, enumdirection.getOpposite())) {
+ createMergedTips(iblockdata, worldserver, blockposition1);
+ } else if (iblockdata.isAir() || iblockdata.is(Blocks.WATER)) {
+- createDripstone(worldserver, blockposition1, enumdirection, DripstoneThickness.TIP);
++ createDripstone(worldserver, blockposition1, enumdirection, DripstoneThickness.TIP, blockposition); // CraftBukkit
+ }
+
+ }
+
+- private static void createDripstone(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection enumdirection, DripstoneThickness dripstonethickness) {
++ private static void createDripstone(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection enumdirection, DripstoneThickness dripstonethickness, BlockPosition 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() == FluidTypes.WATER);
+
+- generatoraccess.setBlock(blockposition, iblockdata, 3);
++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(generatoraccess, source, blockposition, iblockdata, 3); // CraftBukkit
+ }
+
+ private static void createMergedTips(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
+@@ -409,8 +421,8 @@
+ blockposition1 = blockposition.below();
+ }
+
+- createDripstone(generatoraccess, blockposition2, EnumDirection.DOWN, DripstoneThickness.TIP_MERGE);
+- createDripstone(generatoraccess, blockposition1, EnumDirection.UP, DripstoneThickness.TIP_MERGE);
++ createDripstone(generatoraccess, blockposition2, EnumDirection.DOWN, DripstoneThickness.TIP_MERGE, blockposition); // CraftBukkit
++ createDripstone(generatoraccess, blockposition1, EnumDirection.UP, DripstoneThickness.TIP_MERGE, blockposition); // CraftBukkit
+ }
+
+ public static void spawnDripParticle(World world, BlockPosition blockposition, IBlockData iblockdata) {
+@@ -443,7 +455,7 @@
+
+ return (BlockPosition) findBlockVertical(generatoraccess, blockposition, enumdirection.getAxisDirection(), bipredicate, (iblockdata1) -> {
+ return isTip(iblockdata1, flag);
+- }, i).orElse((Object) null);
++ }, i).orElse(null); // CraftBukkit - decompile error
+ }
+ }
+
+@@ -559,7 +571,7 @@
+ return canDripThrough(world, blockposition1, iblockdata);
+ };
+
+- return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.DOWN.getAxisDirection(), bipredicate, predicate, 11).orElse((Object) null);
++ return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.DOWN.getAxisDirection(), bipredicate, predicate, 11).orElse(null); // CraftBukkit - decompile error
+ }
+
+ @Nullable
+@@ -568,7 +580,7 @@
+ return canDripThrough(world, blockposition1, iblockdata);
+ };
+
+- return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.UP.getAxisDirection(), bipredicate, PointedDripstoneBlock::canDrip, 11).orElse((Object) null);
++ return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.UP.getAxisDirection(), bipredicate, PointedDripstoneBlock::canDrip, 11).orElse(null); // CraftBukkit - decompile error
+ }
+
+ public static FluidType getCauldronFillFluidType(WorldServer worldserver, BlockPosition blockposition) {