PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockCauldron.patch
CraftBukkit/Spigot 25f3b50f6b Update to Minecraft 1.19
By: md_5 <git@md-5.net>
2022-06-08 02:00:00 +10:00

29 lines
1.5 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;
@@ -54,13 +58,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);
}