@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/LayeredCauldronBlock.java
|
||||
+++ b/net/minecraft/world/level/block/LayeredCauldronBlock.java
|
||||
@@ -17,6 +17,12 @@
|
||||
@@ -18,6 +18,12 @@
|
||||
import net.minecraft.world.level.material.FluidType;
|
||||
import net.minecraft.world.level.material.FluidTypes;
|
||||
|
||||
@@ -13,24 +13,37 @@
|
||||
public class LayeredCauldronBlock extends AbstractCauldronBlock {
|
||||
|
||||
public static final MapCodec<LayeredCauldronBlock> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
||||
@@ -62,10 +68,14 @@
|
||||
@Override
|
||||
@@ -64,39 +70,67 @@
|
||||
protected void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (!world.isClientSide && entity.isOnFire() && this.isEntityInsideContent(iblockdata, blockposition, entity)) {
|
||||
- entity.clearFire();
|
||||
+ // CraftBukkit start
|
||||
if (entity.mayInteract(world, blockposition)) {
|
||||
- this.handleEntityOnFireInside(iblockdata, world, blockposition);
|
||||
+ if (!lowerFillLevel(iblockdata, world, blockposition, entity, CauldronLevelChangeEvent.ChangeReason.EXTINGUISH)) {
|
||||
+ return;
|
||||
+ }
|
||||
if (world instanceof WorldServer worldserver) {
|
||||
if (entity.isOnFire() && this.isEntityInsideContent(iblockdata, blockposition, entity)) {
|
||||
- entity.clearFire();
|
||||
+ // CraftBukkit start - moved down
|
||||
+ // entity.clearFire();
|
||||
if (entity.mayInteract(worldserver, blockposition)) {
|
||||
- this.handleEntityOnFireInside(iblockdata, world, blockposition);
|
||||
+ if (this.handleEntityOnFireInside(iblockdata, world, blockposition, entity)) {
|
||||
+ entity.clearFire();
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
+ entity.clearFire();
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,20 +90,42 @@
|
||||
|
||||
- private void handleEntityOnFireInside(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
+ // CraftBukkit start
|
||||
+ private boolean handleEntityOnFireInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (this.precipitationType == BiomeBase.Precipitation.SNOW) {
|
||||
- lowerFillLevel((IBlockData) Blocks.WATER_CAULDRON.defaultBlockState().setValue(LayeredCauldronBlock.LEVEL, (Integer) iblockdata.getValue(LayeredCauldronBlock.LEVEL)), world, blockposition);
|
||||
+ return lowerFillLevel((IBlockData) Blocks.WATER_CAULDRON.defaultBlockState().setValue(LayeredCauldronBlock.LEVEL, (Integer) iblockdata.getValue(LayeredCauldronBlock.LEVEL)), world, blockposition, entity, CauldronLevelChangeEvent.ChangeReason.EXTINGUISH);
|
||||
} else {
|
||||
- lowerFillLevel(iblockdata, world, blockposition);
|
||||
+ return lowerFillLevel(iblockdata, world, blockposition, entity, CauldronLevelChangeEvent.ChangeReason.EXTINGUISH);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void lowerFillLevel(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
@@ -77,7 +90,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,8 +144,11 @@
|
||||
@@ -115,8 +149,11 @@
|
||||
if (!this.isFull(iblockdata)) {
|
||||
IBlockData iblockdata1 = (IBlockData) iblockdata.setValue(LayeredCauldronBlock.LEVEL, (Integer) iblockdata.getValue(LayeredCauldronBlock.LEVEL) + 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user