mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
27 lines
1.6 KiB
Diff
27 lines
1.6 KiB
Diff
--- a/net/minecraft/server/EntitySilverfish.java
|
|
+++ b/net/minecraft/server/EntitySilverfish.java
|
|
@@ -156,6 +156,11 @@
|
|
IBlockData iblockdata = world.getType(blockposition);
|
|
|
|
if (BlockMonsterEggs.i(iblockdata)) {
|
|
+ // CraftBukkit start
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition, 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.doSpawnEffect();
|
|
this.silverfish.die();
|
|
@@ -199,6 +204,11 @@
|
|
IBlockData iblockdata = world.getType(blockposition1);
|
|
|
|
if (iblockdata.getBlock() == Blocks.MONSTER_EGG) {
|
|
+ // CraftBukkit start
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, Blocks.AIR, 0).isCancelled()) {
|
|
+ continue;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
if (world.getGameRules().getBoolean("mobGriefing")) {
|
|
world.setAir(blockposition1, true);
|
|
} else {
|