3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-23 23:00:08 +01:00
Paper/nms-patches/EntitySilverfish.patch
2018-07-22 12:00:00 +10:00

27 Zeilen
1.5 KiB
Diff

--- a/net/minecraft/server/EntitySilverfish.java
+++ b/net/minecraft/server/EntitySilverfish.java
@@ -153,6 +153,11 @@
IBlockData iblockdata = world.getType(blockposition);
if (BlockMonsterEggs.k(iblockdata)) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition, BlockMonsterEggs.f(iblockdata.getBlock())).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, BlockMonsterEggs.f(iblockdata.getBlock()), 3);
this.a.doSpawnEffect();
this.a.die();
@@ -197,6 +202,11 @@
Block block = iblockdata.getBlock();
if (block instanceof BlockMonsterEggs) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, Blocks.AIR.getBlockData()).isCancelled()) {
+ continue;
+ }
+ // CraftBukkit end
if (world.getGameRules().getBoolean("mobGriefing")) {
world.setAir(blockposition1, true);
} else {