PaperMC/nms-patches/EntitySilverfish.patch

27 lines
1.5 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/EntitySilverfish.java
+++ b/net/minecraft/server/EntitySilverfish.java
2018-07-15 02:00:00 +02:00
@@ -153,6 +153,11 @@
2015-02-26 23:41:06 +01:00
IBlockData iblockdata = world.getType(blockposition);
2018-07-22 04:00:00 +02:00
if (BlockMonsterEggs.k(iblockdata)) {
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
2018-07-15 02:00:00 +02:00
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition, BlockMonsterEggs.f(iblockdata.getBlock())).isCancelled()) {
2015-02-26 23:41:06 +01:00
+ return;
+ }
+ // CraftBukkit end
2018-07-15 02:00:00 +02:00
world.setTypeAndData(blockposition, BlockMonsterEggs.f(iblockdata.getBlock()), 3);
2016-11-17 02:41:03 +01:00
this.a.doSpawnEffect();
this.a.die();
2018-07-15 02:00:00 +02:00
@@ -197,6 +202,11 @@
Block block = iblockdata.getBlock();
2015-02-26 23:41:06 +01:00
2018-07-15 02:00:00 +02:00
if (block instanceof BlockMonsterEggs) {
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
2018-07-15 02:00:00 +02:00
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, Blocks.AIR.getBlockData()).isCancelled()) {
2015-02-26 23:41:06 +01:00
+ continue;
+ }
+ // CraftBukkit end
if (world.getGameRules().getBoolean("mobGriefing")) {
world.setAir(blockposition1, true);
} else {