summaryrefslogtreecommitdiffstats
path: root/nms-patches/EnchantmentFrostWalker.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-12-09 12:45:21 +1100
committermd_5 <git@md-5.net>2016-12-09 12:45:21 +1100
commitcaf86c88a91b7b87bb2ace9b28d4ecaa60120c92 (patch)
treea782d3a940503406abab48c2cd9b3ebad72cfcff /nms-patches/EnchantmentFrostWalker.patch
parent521b64741e4ba929fbf8bc9f4da4caa2f0e3d9e1 (diff)
downloadcraftbukkit-caf86c88a91b7b87bb2ace9b28d4ecaa60120c92.tar
craftbukkit-caf86c88a91b7b87bb2ace9b28d4ecaa60120c92.tar.gz
craftbukkit-caf86c88a91b7b87bb2ace9b28d4ecaa60120c92.tar.lz
craftbukkit-caf86c88a91b7b87bb2ace9b28d4ecaa60120c92.tar.xz
craftbukkit-caf86c88a91b7b87bb2ace9b28d4ecaa60120c92.zip
Use CraftEventFactory for BlockFormEvent
Diffstat (limited to 'nms-patches/EnchantmentFrostWalker.patch')
-rw-r--r--nms-patches/EnchantmentFrostWalker.patch11
1 files changed, 2 insertions, 9 deletions
diff --git a/nms-patches/EnchantmentFrostWalker.patch b/nms-patches/EnchantmentFrostWalker.patch
index 91fda45b..fedf1a39 100644
--- a/nms-patches/EnchantmentFrostWalker.patch
+++ b/nms-patches/EnchantmentFrostWalker.patch
@@ -9,21 +9,14 @@
import java.util.Iterator;
public class EnchantmentFrostWalker extends Enchantment {
-@@ -42,8 +45,18 @@
+@@ -42,8 +45,11 @@
IBlockData iblockdata1 = world.getType(blockposition_mutableblockposition1);
if (iblockdata1.getMaterial() == Material.WATER && ((Integer) iblockdata1.get(BlockFluids.LEVEL)).intValue() == 0 && world.a(Blocks.FROSTED_ICE, blockposition_mutableblockposition1, false, EnumDirection.DOWN, (Entity) null)) {
- world.setTypeUpdate(blockposition_mutableblockposition1, Blocks.FROSTED_ICE.getBlockData());
- world.a(blockposition_mutableblockposition1.h(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
+ // CraftBukkit Start - Call EntityBlockFormEvent for Frost Walker
-+ org.bukkit.block.BlockState blockState = world.getWorld().getBlockAt(blockposition_mutableblockposition1.getX(), blockposition_mutableblockposition1.getY(), blockposition_mutableblockposition1.getZ()).getState();
-+ blockState.setType(CraftMagicNumbers.getMaterial(Blocks.FROSTED_ICE));
-+
-+ EntityBlockFormEvent event = new EntityBlockFormEvent(entityliving.bukkitEntity, blockState.getBlock(), blockState);
-+ world.getServer().getPluginManager().callEvent(event);
-+
-+ if (!event.isCancelled()) {
-+ blockState.update(true);
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition_mutableblockposition1, Blocks.FROSTED_ICE, entityliving)) {
+ world.a(blockposition_mutableblockposition1.h(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120));
+ }
+ // CraftBukkit End