13
0
geforkt von Mirrors/Paper

SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2021-07-18 10:14:55 +10:00
Ursprung 59f5a7ab59
Commit 5eb7a2ed61

Datei anzeigen

@ -0,0 +1,27 @@
--- 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 a(IBlockData iblockdata, World world, BlockPosition blockposition, FluidType fluidtype) {
if (fluidtype == FluidTypes.WATER) {
- world.setTypeUpdate(blockposition, Blocks.WATER_CAULDRON.getBlockData());
+ LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, Blocks.WATER_CAULDRON.getBlockData(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
world.triggerEffect(1047, blockposition, 0);
world.a((Entity) null, GameEvent.FLUID_PLACE, blockposition);
} else if (fluidtype == FluidTypes.LAVA) {
- world.setTypeUpdate(blockposition, Blocks.LAVA_CAULDRON.getBlockData());
+ LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, Blocks.LAVA_CAULDRON.getBlockData(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
world.triggerEffect(1046, blockposition, 0);
world.a((Entity) null, GameEvent.FLUID_PLACE, blockposition);
}