summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntitySilverfish.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/EntitySilverfish.patch')
-rw-r--r--nms-patches/EntitySilverfish.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/nms-patches/EntitySilverfish.patch b/nms-patches/EntitySilverfish.patch
new file mode 100644
index 00000000..098e5be2
--- /dev/null
+++ b/nms-patches/EntitySilverfish.patch
@@ -0,0 +1,26 @@
+--- /home/matt/mc-dev-private//net/minecraft/server/EntitySilverfish.java 2015-02-26 22:40:22.679608138 +0000
++++ src/main/java/net/minecraft/server/EntitySilverfish.java 2015-02-26 22:40:22.683608138 +0000
+@@ -144,6 +144,11 @@
+ IBlockData iblockdata = world.getType(blockposition);
+
+ if (BlockMonsterEggs.d(iblockdata)) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition.getX(), blockposition.getY(), blockposition.getZ(), Blocks.MONSTER_EGG, Block.getId(BlockMonsterEggs.getById(iblockdata.getBlock().toLegacyData(iblockdata)))).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
+ world.setTypeAndData(blockposition, Blocks.MONSTER_EGG.getBlockData().set(BlockMonsterEggs.VARIANT, BlockMonsterEggs.EnumMonsterEggVarient.a(iblockdata)), 3);
+ this.silverfish.y();
+ this.silverfish.die();
+@@ -187,6 +192,11 @@
+ IBlockData iblockdata = world.getType(blockposition1);
+
+ if (iblockdata.getBlock() == Blocks.MONSTER_EGG) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1.getX(), blockposition1.getY(), blockposition1.getZ(), Blocks.AIR, 0).isCancelled()) {
++ continue;
++ }
++ // CraftBukkit end
+ if (world.getGameRules().getBoolean("mobGriefing")) {
+ world.setAir(blockposition1, true);
+ } else {