2021-06-11 07:00:00 +02:00
|
|
|
--- a/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
|
|
|
+++ b/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -44,6 +44,11 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
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 BlockStateDirection TIP_DIRECTION = BlockProperties.VERTICAL_DIRECTION;
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -126,6 +131,11 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
2021-06-11 07:00:00 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
if (!world.isClientSide && iprojectile.mayInteract(world, blockposition) && iprojectile instanceof EntityThrownTrident && iprojectile.getDeltaMovement().length() > 0.6D) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ // CraftBukkit start
|
2021-11-21 23:00:00 +01:00
|
|
|
+ if (CraftEventFactory.callEntityChangeBlockEvent(iprojectile, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
world.destroyBlock(blockposition, true);
|
2021-06-11 07:00:00 +02:00
|
|
|
}
|
|
|
|
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -134,7 +144,9 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
@Override
|
|
|
|
public void fallOn(World world, IBlockData iblockdata, BlockPosition blockposition, Entity entity, float f) {
|
2021-11-21 23:00:00 +01:00
|
|
|
if (iblockdata.getValue(PointedDripstoneBlock.TIP_DIRECTION) == EnumDirection.UP && iblockdata.getValue(PointedDripstoneBlock.THICKNESS) == DripstoneThickness.TIP) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ CraftEventFactory.blockDamage = CraftBlock.at(world, blockposition); // CraftBukkit
|
2023-03-14 17:30:00 +01:00
|
|
|
entity.causeFallDamage(f + 2.0F, 2.0F, world.damageSources().stalagmite());
|
2021-06-11 07:00:00 +02:00
|
|
|
+ CraftEventFactory.blockDamage = null; // CraftBukkit
|
|
|
|
} else {
|
|
|
|
super.fallOn(world, iblockdata, blockposition, entity, f);
|
|
|
|
}
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -389,15 +401,15 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
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
|
2021-06-11 07:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
- 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);
|
2021-06-11 07:00:00 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
- generatoraccess.setBlock(blockposition, iblockdata, 3);
|
2021-06-11 07:00:00 +02:00
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(generatoraccess, source, blockposition, iblockdata, 3); // CraftBukkit
|
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
private static void createMergedTips(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -412,8 +424,8 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
blockposition1 = blockposition.below();
|
2021-06-11 07:00:00 +02:00
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
- 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
|
2021-06-11 07:00:00 +02:00
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
public static void spawnDripParticle(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -446,7 +458,7 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
|
2022-02-28 16:00:00 +01:00
|
|
|
return (BlockPosition) findBlockVertical(generatoraccess, blockposition, enumdirection.getAxisDirection(), bipredicate, (iblockdata1) -> {
|
2021-11-21 23:00:00 +01:00
|
|
|
return isTip(iblockdata1, flag);
|
2021-06-11 07:00:00 +02:00
|
|
|
- }, i).orElse((Object) null);
|
|
|
|
+ }, i).orElse(null); // CraftBukkit - decompile error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -562,7 +574,7 @@
|
2022-02-28 16:00:00 +01:00
|
|
|
return canDripThrough(world, blockposition1, iblockdata);
|
2021-06-11 07:00:00 +02:00
|
|
|
};
|
|
|
|
|
2022-02-28 16:00:00 +01:00
|
|
|
- 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
|
2021-06-11 07:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -571,7 +583,7 @@
|
2022-02-28 16:00:00 +01:00
|
|
|
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
|
2021-06-11 07:00:00 +02:00
|
|
|
}
|
|
|
|
|
2022-06-07 18:00:00 +02:00
|
|
|
public static FluidType getCauldronFillFluidType(WorldServer worldserver, BlockPosition blockposition) {
|