use BlockFormEvent for mud converting into clay

This commit is contained in:
Legitimoose 2022-09-29 16:25:50 -07:00
parent 1695d7c138
commit 074f19e7fb

View File

@ -21,7 +21,22 @@
} else {
super.fallOn(world, state, pos, entity, fallDistance);
}
@@ -391,15 +396,15 @@
@@ -214,10 +219,13 @@
if (((PointedDripstoneBlock.FluidInfo) optional.get()).sourceState.is(Blocks.MUD) && fluidtype == Fluids.WATER) {
BlockState iblockdata1 = Blocks.CLAY.defaultBlockState();
- world.setBlockAndUpdate(((PointedDripstoneBlock.FluidInfo) optional.get()).pos, iblockdata1);
+ // Paper start - Call BlockFormEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos, iblockdata1)) {
Block.pushEntitiesUp(((PointedDripstoneBlock.FluidInfo) optional.get()).sourceState, iblockdata1, world, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos);
world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos, GameEvent.Context.of(iblockdata1));
world.levelEvent(1504, blockposition1, 0);
+ }
+ // Paper end - Call BlockFormEvent
} else {
BlockPos blockposition2 = PointedDripstoneBlock.findFillableCauldronBelowStalactiteTip(world, blockposition1, fluidtype);
@@ -391,15 +399,15 @@
if (PointedDripstoneBlock.isUnmergedTipWithDirection(iblockdata, direction.getOpposite())) {
PointedDripstoneBlock.createMergedTips(iblockdata, world, blockposition1);
} else if (iblockdata.isAir() || iblockdata.is(Blocks.WATER)) {
@ -41,7 +56,7 @@
}
private static void createMergedTips(BlockState state, LevelAccessor world, BlockPos pos) {
@@ -414,8 +419,8 @@
@@ -414,8 +422,8 @@
blockposition1 = pos.below();
}
@ -52,7 +67,7 @@
}
public static void spawnDripParticle(Level world, BlockPos pos, BlockState state) {
@@ -448,7 +453,7 @@
@@ -448,7 +456,7 @@
return (BlockPos) PointedDripstoneBlock.findBlockVertical(world, pos, enumdirection.getAxisDirection(), bipredicate, (iblockdata1) -> {
return PointedDripstoneBlock.isTip(iblockdata1, allowMerged);
@ -61,7 +76,7 @@
}
}
@@ -564,7 +569,7 @@
@@ -564,7 +572,7 @@
return PointedDripstoneBlock.canDripThrough(world, blockposition1, iblockdata);
};
@ -70,7 +85,7 @@
}
@Nullable
@@ -573,7 +578,7 @@
@@ -573,7 +581,7 @@
return PointedDripstoneBlock.canDripThrough(world, blockposition1, iblockdata);
};