aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/world/level/block/IceBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/level/block/IceBlock.java.patch')
-rw-r--r--patch-remap/mache-spigotflower/net/minecraft/world/level/block/IceBlock.java.patch91
1 files changed, 91 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/level/block/IceBlock.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/IceBlock.java.patch
new file mode 100644
index 0000000000..82382fe39c
--- /dev/null
+++ b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/IceBlock.java.patch
@@ -0,0 +1,91 @@
+--- a/net/minecraft/world/level/block/IceBlock.java
++++ b/net/minecraft/world/level/block/IceBlock.java
+@@ -9,64 +9,66 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.item.enchantment.EnchantmentHelper;
+ import net.minecraft.world.item.enchantment.Enchantments;
++import net.minecraft.world.level.EnumSkyBlock;
+ import net.minecraft.world.level.Level;
+-import net.minecraft.world.level.LightLayer;
+ import net.minecraft.world.level.block.entity.BlockEntity;
+ import net.minecraft.world.level.block.state.BlockBehaviour;
+-import net.minecraft.world.level.block.state.BlockState;
++import net.minecraft.world.level.block.state.IBlockData;
+
+ public class IceBlock extends HalfTransparentBlock {
+
+ public static final MapCodec<IceBlock> CODEC = simpleCodec(IceBlock::new);
+
+ @Override
+- @Override
+ public MapCodec<? extends IceBlock> codec() {
+ return IceBlock.CODEC;
+ }
+
+- public IceBlock(BlockBehaviour.Properties blockbehaviour_properties) {
+- super(blockbehaviour_properties);
++ public IceBlock(BlockBehaviour.Properties properties) {
++ super(properties);
+ }
+
+- public static BlockState meltsInto() {
++ public static IBlockData meltsInto() {
+ return Blocks.WATER.defaultBlockState();
+ }
+
+ @Override
+- @Override
+- public void playerDestroy(Level level, Player player, BlockPos blockpos, BlockState blockstate, @Nullable BlockEntity blockentity, ItemStack itemstack) {
+- super.playerDestroy(level, player, blockpos, blockstate, blockentity, itemstack);
+- if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
++ public void playerDestroy(Level level, Player player, BlockPos pos, IBlockData state, @Nullable BlockEntity te, ItemStack stack) {
++ super.playerDestroy(level, player, pos, state, te, stack);
++ if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) == 0) {
+ if (level.dimensionType().ultraWarm()) {
+- level.removeBlock(blockpos, false);
++ level.removeBlock(pos, false);
+ return;
+ }
+
+- BlockState blockstate1 = level.getBlockState(blockpos.below());
++ IBlockData iblockdata1 = level.getBlockState(pos.below());
+
+- if (blockstate1.blocksMotion() || blockstate1.liquid()) {
+- level.setBlockAndUpdate(blockpos, meltsInto());
++ if (iblockdata1.blocksMotion() || iblockdata1.liquid()) {
++ level.setBlockAndUpdate(pos, meltsInto());
+ }
+ }
+
+ }
+
+ @Override
+- @Override
+- public void randomTick(BlockState blockstate, ServerLevel serverlevel, BlockPos blockpos, RandomSource randomsource) {
+- if (serverlevel.getBrightness(LightLayer.BLOCK, blockpos) > 11 - blockstate.getLightBlock(serverlevel, blockpos)) {
+- this.melt(blockstate, serverlevel, blockpos);
++ public void randomTick(IBlockData state, ServerLevel level, BlockPos pos, RandomSource random) {
++ if (level.getBrightness(EnumSkyBlock.BLOCK, pos) > 11 - state.getLightBlock(level, pos)) {
++ this.melt(state, level, pos);
+ }
+
+ }
+
+- protected void melt(BlockState blockstate, Level level, BlockPos blockpos) {
++ protected void melt(IBlockData state, Level level, BlockPos pos) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(level, pos, level.dimensionType().ultraWarm() ? Blocks.AIR.defaultBlockState() : Blocks.WATER.defaultBlockState()).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
+ if (level.dimensionType().ultraWarm()) {
+- level.removeBlock(blockpos, false);
++ level.removeBlock(pos, false);
+ } else {
+- level.setBlockAndUpdate(blockpos, meltsInto());
+- level.neighborChanged(blockpos, meltsInto().getBlock(), blockpos);
++ level.setBlockAndUpdate(pos, meltsInto());
++ level.neighborChanged(pos, meltsInto().getBlock(), pos);
+ }
+ }
+ }