Paper/paper-server/nms-patches/net/minecraft/world/level/block/BlockCauldron.patch
CraftBukkit/Spigot 8398e12b34 Update to Minecraft 1.20.3
By: md_5 <git@md-5.net>
2023-12-06 03:40:00 +11:00

30 lines
1.5 KiB
Diff

--- a/net/minecraft/world/level/block/BlockCauldron.java
+++ b/net/minecraft/world/level/block/BlockCauldron.java
@@ -12,6 +12,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 {
public static final MapCodec<BlockCauldron> CODEC = simpleCodec(BlockCauldron::new);
@@ -61,13 +65,11 @@
if (fluidtype == FluidTypes.WATER) {
iblockdata1 = Blocks.WATER_CAULDRON.defaultBlockState();
- world.setBlockAndUpdate(blockposition, iblockdata1);
- world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata1));
+ LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
world.levelEvent(1047, blockposition, 0);
} else if (fluidtype == FluidTypes.LAVA) {
iblockdata1 = Blocks.LAVA_CAULDRON.defaultBlockState();
- world.setBlockAndUpdate(blockposition, iblockdata1);
- world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata1));
+ LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
world.levelEvent(1046, blockposition, 0);
}