mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 12:02:36 +01:00
b97cc9b99f
By: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
37 lines
1.8 KiB
Diff
37 lines
1.8 KiB
Diff
--- a/net/minecraft/world/entity/monster/EntitySilverfish.java
|
|
+++ b/net/minecraft/world/entity/monster/EntitySilverfish.java
|
|
@@ -33,6 +33,10 @@
|
|
import net.minecraft.world.level.block.BlockMonsterEggs;
|
|
import net.minecraft.world.level.block.state.IBlockData;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
+// CraftBukkit end
|
|
+
|
|
public class EntitySilverfish extends EntityMonster {
|
|
|
|
@Nullable
|
|
@@ -175,6 +179,11 @@
|
|
Block block = iblockdata.getBlock();
|
|
|
|
if (block instanceof BlockMonsterEggs) {
|
|
+ // CraftBukkit start
|
|
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, net.minecraft.world.level.block.Blocks.AIR.defaultBlockState())) {
|
|
+ continue;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
if (world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
|
|
world.destroyBlock(blockposition1, true, this.silverfish);
|
|
} else {
|
|
@@ -244,6 +253,11 @@
|
|
IBlockData iblockdata = world.getBlockState(blockposition);
|
|
|
|
if (BlockMonsterEggs.isCompatibleHostBlock(iblockdata)) {
|
|
+ // CraftBukkit start
|
|
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, BlockMonsterEggs.infestedStateByHost(iblockdata))) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
world.setBlock(blockposition, BlockMonsterEggs.infestedStateByHost(iblockdata), 3);
|
|
this.mob.spawnAnim();
|
|
this.mob.discard();
|