From 954f57e596e1a80124f58adbd817a96082ccc51d Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 30 Dec 2021 14:02:13 -0800 Subject: [PATCH] fix powder snow cauldrons not turning to water Powder snow cauldrons should turn to water when extinguishing an entity --- .../level/block/LayeredCauldronBlock.java.patch | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/LayeredCauldronBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/LayeredCauldronBlock.java.patch index 183eacd5c..18e45c40c 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/LayeredCauldronBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/LayeredCauldronBlock.java.patch @@ -12,7 +12,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock { -@@ -62,41 +67,76 @@ +@@ -62,41 +67,86 @@ @Override protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { @@ -24,7 +24,7 @@ + // entity.clearFire(); if (entity.mayInteract(worldserver, pos)) { - this.handleEntityOnFireInside(state, world, pos); -+ if (this.handleEntityOnFireInside(state, world, pos, entity)) { ++ if (this.handleEntityOnFireInsideWithEvent(state, world, pos, entity)) { // Paper - fix powdered snow cauldron extinguishing entities + entity.clearFire(); + } + // CraftBukkit end @@ -36,6 +36,7 @@ - private void handleEntityOnFireInside(BlockState state, Level world, BlockPos pos) { + // CraftBukkit start ++ @io.papermc.paper.annotation.DoNotUse @Deprecated // Paper - fix powdered snow cauldron extinguishing entities; use #handleEntityOnFireInsideWithEvent + private boolean handleEntityOnFireInside(BlockState iblockdata, Level world, BlockPos blockposition, Entity entity) { if (this.precipitationType == Biome.Precipitation.SNOW) { - LayeredCauldronBlock.lowerFillLevel((BlockState) Blocks.WATER_CAULDRON.defaultBlockState().setValue(LayeredCauldronBlock.LEVEL, (Integer) state.getValue(LayeredCauldronBlock.LEVEL)), world, pos); @@ -47,6 +48,15 @@ } } ++ // Paper start - fix powdered snow cauldron extinguishing entities ++ protected boolean handleEntityOnFireInsideWithEvent(BlockState state, Level world, BlockPos pos, Entity entity) { ++ if (this.precipitationType == Biome.Precipitation.SNOW) { ++ return LayeredCauldronBlock.lowerFillLevel((BlockState) Blocks.WATER_CAULDRON.defaultBlockState().setValue(LayeredCauldronBlock.LEVEL, (Integer) state.getValue(LayeredCauldronBlock.LEVEL)), world, pos, entity, CauldronLevelChangeEvent.ChangeReason.EXTINGUISH); ++ } else { ++ return LayeredCauldronBlock.lowerFillLevel(state, world, pos, entity, CauldronLevelChangeEvent.ChangeReason.EXTINGUISH); ++ } ++ } ++ // Paper end - fix powdered snow cauldron extinguishing entities public static void lowerFillLevel(BlockState state, Level world, BlockPos pos) { - int i = (Integer) state.getValue(LayeredCauldronBlock.LEVEL) - 1; @@ -100,7 +110,7 @@ } } -@@ -115,8 +155,11 @@ +@@ -115,8 +165,11 @@ if (!this.isFull(state)) { BlockState iblockdata1 = (BlockState) state.setValue(LayeredCauldronBlock.LEVEL, (Integer) state.getValue(LayeredCauldronBlock.LEVEL) + 1);