PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockCauldron.patch
CraftBukkit/Spigot 43702a9e10 Update to Minecraft 1.18-pre5
By: md_5 <git@md-5.net>
2021-11-22 09:00:00 +11:00

27 lines
1.6 KiB
Diff

--- a/net/minecraft/world/level/block/BlockCauldron.java
+++ b/net/minecraft/world/level/block/BlockCauldron.java
@@ -11,6 +11,10 @@
import net.minecraft.world.level.material.FluidType;
import net.minecraft.world.level.material.FluidTypes;
+// CraftBukkit start
+import org.bukkit.event.block.CauldronLevelChangeEvent;
+// CraftBukkit end
+
public class BlockCauldron extends AbstractCauldronBlock {
private static final float RAIN_FILL_CHANCE = 0.05F;
@@ -51,11 +55,11 @@
@Override
protected void receiveStalactiteDrip(IBlockData iblockdata, World world, BlockPosition blockposition, FluidType fluidtype) {
if (fluidtype == FluidTypes.WATER) {
- world.setBlockAndUpdate(blockposition, Blocks.WATER_CAULDRON.defaultBlockState());
+ LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, Blocks.WATER_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
world.levelEvent(1047, blockposition, 0);
world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, blockposition);
} else if (fluidtype == FluidTypes.LAVA) {
- world.setBlockAndUpdate(blockposition, Blocks.LAVA_CAULDRON.defaultBlockState());
+ LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, Blocks.LAVA_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
world.levelEvent(1046, blockposition, 0);
world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, blockposition);
}