summaryrefslogtreecommitdiffstats
path: root/nms-patches/EnchantmentFrostWalker.patch
blob: 8b86af35c06dcc5d8d01834b2fe25ac71ba7761c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- a/net/minecraft/server/EnchantmentFrostWalker.java
+++ b/net/minecraft/server/EnchantmentFrostWalker.java
@@ -1,5 +1,8 @@
 package net.minecraft.server;
 
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+import org.bukkit.event.block.EntityBlockFormEvent;
+
 import java.util.Iterator;
 
 public class EnchantmentFrostWalker extends Enchantment {
@@ -42,8 +45,11 @@
                         IBlockData iblockdata2 = world.getType(blockposition_mutableblockposition1);
 
                         if (iblockdata2.getMaterial() == Material.WATER && ((Integer) iblockdata2.get(BlockFluids.LEVEL)).intValue() == 0 && iblockdata.canPlace(world, blockposition_mutableblockposition1) && world.a(iblockdata, (BlockPosition) blockposition_mutableblockposition1)) {
-                            world.setTypeUpdate(blockposition_mutableblockposition1, iblockdata);
-                            world.J().a(blockposition_mutableblockposition1.h(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
+                            // CraftBukkit Start - Call EntityBlockFormEvent for Frost Walker
+                            if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition_mutableblockposition1, iblockdata, entityliving)) {
+                                world.J().a(blockposition_mutableblockposition1.h(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
+                            }
+                            // CraftBukkit End
                         }
                     }
                 }