diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/level/block/CauldronBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/level/block/CauldronBlock.java.patch | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/level/block/CauldronBlock.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/CauldronBlock.java.patch new file mode 100644 index 0000000000..e1a9e019c4 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/CauldronBlock.java.patch @@ -0,0 +1,100 @@ +--- a/net/minecraft/world/level/block/CauldronBlock.java ++++ b/net/minecraft/world/level/block/CauldronBlock.java +@@ -7,10 +7,13 @@ + import net.minecraft.world.level.Level; + import net.minecraft.world.level.biome.Biome; + import net.minecraft.world.level.block.state.BlockBehaviour; +-import net.minecraft.world.level.block.state.BlockState; ++import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.level.gameevent.GameEvent; + import net.minecraft.world.level.material.Fluid; + import net.minecraft.world.level.material.Fluids; ++// CraftBukkit start ++import org.bukkit.event.block.CauldronLevelChangeEvent; ++// CraftBukkit end + + public class CauldronBlock extends AbstractCauldronBlock { + +@@ -19,61 +22,54 @@ + private static final float POWDER_SNOW_FILL_CHANCE = 0.1F; + + @Override +- @Override + public MapCodec<CauldronBlock> codec() { + return CauldronBlock.CODEC; + } + +- public CauldronBlock(BlockBehaviour.Properties blockbehaviour_properties) { +- super(blockbehaviour_properties, CauldronInteraction.EMPTY); ++ public CauldronBlock(BlockBehaviour.Properties properties) { ++ super(properties, CauldronInteraction.EMPTY); + } + + @Override +- @Override +- public boolean isFull(BlockState blockstate) { ++ public boolean isFull(IBlockData state) { + return false; + } + +- protected static boolean shouldHandlePrecipitation(Level level, Biome.Precipitation biome_precipitation) { +- return biome_precipitation == Biome.Precipitation.RAIN ? level.getRandom().nextFloat() < 0.05F : (biome_precipitation == Biome.Precipitation.SNOW ? level.getRandom().nextFloat() < 0.1F : false); ++ protected static boolean shouldHandlePrecipitation(Level level, Biome.Precipitation precipitation) { ++ return precipitation == Biome.Precipitation.RAIN ? level.getRandom().nextFloat() < 0.05F : (precipitation == Biome.Precipitation.SNOW ? level.getRandom().nextFloat() < 0.1F : false); + } + + @Override +- @Override +- public void handlePrecipitation(BlockState blockstate, Level level, BlockPos blockpos, Biome.Precipitation biome_precipitation) { +- if (shouldHandlePrecipitation(level, biome_precipitation)) { +- if (biome_precipitation == Biome.Precipitation.RAIN) { +- level.setBlockAndUpdate(blockpos, Blocks.WATER_CAULDRON.defaultBlockState()); +- level.gameEvent((Entity) null, GameEvent.BLOCK_CHANGE, blockpos); +- } else if (biome_precipitation == Biome.Precipitation.SNOW) { +- level.setBlockAndUpdate(blockpos, Blocks.POWDER_SNOW_CAULDRON.defaultBlockState()); +- level.gameEvent((Entity) null, GameEvent.BLOCK_CHANGE, blockpos); ++ public void handlePrecipitation(IBlockData state, Level level, BlockPos pos, Biome.Precipitation precipitation) { ++ if (shouldHandlePrecipitation(level, precipitation)) { ++ if (precipitation == Biome.Precipitation.RAIN) { ++ level.setBlockAndUpdate(pos, Blocks.WATER_CAULDRON.defaultBlockState()); ++ level.gameEvent((Entity) null, GameEvent.BLOCK_CHANGE, pos); ++ } else if (precipitation == Biome.Precipitation.SNOW) { ++ level.setBlockAndUpdate(pos, Blocks.POWDER_SNOW_CAULDRON.defaultBlockState()); ++ level.gameEvent((Entity) null, GameEvent.BLOCK_CHANGE, pos); + } + + } + } + + @Override +- @Override + protected boolean canReceiveStalactiteDrip(Fluid fluid) { + return true; + } + + @Override +- @Override +- protected void receiveStalactiteDrip(BlockState blockstate, Level level, BlockPos blockpos, Fluid fluid) { +- BlockState blockstate1; ++ protected void receiveStalactiteDrip(IBlockData state, Level level, BlockPos pos, Fluid fluid) { ++ IBlockData iblockdata1; + + if (fluid == Fluids.WATER) { +- blockstate1 = Blocks.WATER_CAULDRON.defaultBlockState(); +- level.setBlockAndUpdate(blockpos, blockstate1); +- level.gameEvent(GameEvent.BLOCK_CHANGE, blockpos, GameEvent.Context.of(blockstate1)); +- level.levelEvent(1047, blockpos, 0); ++ iblockdata1 = Blocks.WATER_CAULDRON.defaultBlockState(); ++ LayeredCauldronBlock.changeLevel(state, level, pos, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit ++ level.levelEvent(1047, pos, 0); + } else if (fluid == Fluids.LAVA) { +- blockstate1 = Blocks.LAVA_CAULDRON.defaultBlockState(); +- level.setBlockAndUpdate(blockpos, blockstate1); +- level.gameEvent(GameEvent.BLOCK_CHANGE, blockpos, GameEvent.Context.of(blockstate1)); +- level.levelEvent(1046, blockpos, 0); ++ iblockdata1 = Blocks.LAVA_CAULDRON.defaultBlockState(); ++ LayeredCauldronBlock.changeLevel(state, level, pos, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit ++ level.levelEvent(1046, pos, 0); + } + + } |