Paper/nms-patches/EnchantmentFrostWalker.patch

28 lines
1.5 KiB
Diff
Raw Normal View History

--- a/net/minecraft/server/EnchantmentFrostWalker.java
+++ b/net/minecraft/server/EnchantmentFrostWalker.java
2018-12-06 00:00:00 +01:00
@@ -1,6 +1,10 @@
package net.minecraft.server;
2018-12-06 00:00:00 +01:00
import java.util.Iterator;
+// CraftBukkit start
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+import org.bukkit.event.block.EntityBlockFormEvent;
2018-12-06 00:00:00 +01:00
+// CraftBukkit end
public class EnchantmentFrostWalker extends Enchantment {
2018-12-06 00:00:00 +01:00
2019-04-23 04:00:00 +02:00
@@ -41,8 +45,11 @@
IBlockData iblockdata2 = world.getType(blockposition1);
2019-04-23 04:00:00 +02:00
if (iblockdata2.getMaterial() == Material.WATER && (Integer) iblockdata2.get(BlockFluids.LEVEL) == 0 && iblockdata.canPlace(world, blockposition1) && world.a(iblockdata, blockposition1, VoxelShapeCollision.a())) {
- world.setTypeUpdate(blockposition1, iblockdata);
- world.getBlockTickList().a(blockposition1.immutableCopy(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
+ // CraftBukkit Start - Call EntityBlockFormEvent for Frost Walker
2019-04-23 04:00:00 +02:00
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition1, iblockdata, entityliving)) {
+ world.getBlockTickList().a(blockposition1.immutableCopy(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
+ }
+ // CraftBukkit End
}
}
}