summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntitySnowman.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/EntitySnowman.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/EntitySnowman.patch')
-rw-r--r--nms-patches/EntitySnowman.patch14
1 files changed, 2 insertions, 12 deletions
diff --git a/nms-patches/EntitySnowman.patch b/nms-patches/EntitySnowman.patch
index 0fc4443b..244f48b1 100644
--- a/nms-patches/EntitySnowman.patch
+++ b/nms-patches/EntitySnowman.patch
@@ -21,22 +21,12 @@
}
if (!this.world.getGameRules().getBoolean("mobGriefing")) {
-@@ -73,7 +78,17 @@
+@@ -73,7 +78,7 @@
BlockPosition blockposition = new BlockPosition(i, j, k);
if (this.world.getType(blockposition).getMaterial() == Material.AIR && this.world.getBiome(blockposition).a(blockposition) < 0.8F && Blocks.SNOW_LAYER.canPlace(this.world, blockposition)) {
- this.world.setTypeUpdate(blockposition, Blocks.SNOW_LAYER.getBlockData());
-+ // CraftBukkit start
-+ org.bukkit.block.BlockState blockState = this.world.getWorld().getBlockAt(i, j, k).getState();
-+ blockState.setType(CraftMagicNumbers.getMaterial(Blocks.SNOW_LAYER));
-+
-+ EntityBlockFormEvent event = new EntityBlockFormEvent(this.getBukkitEntity(), blockState.getBlock(), blockState);
-+ this.world.getServer().getPluginManager().callEvent(event);
-+
-+ if(!event.isCancelled()) {
-+ blockState.update(true);
-+ }
-+ // CraftBukkit end
++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this.world, blockposition, Blocks.SNOW_LAYER, this); // CraftBukkit
}
}
}