2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/monster/EntitySilverfish.java
|
|
|
|
+++ b/net/minecraft/world/entity/monster/EntitySilverfish.java
|
2022-02-28 16:00:00 +01:00
|
|
|
@@ -175,6 +175,11 @@
|
2018-07-15 02:00:00 +02:00
|
|
|
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
|
2021-11-21 23:00:00 +01:00
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, net.minecraft.world.level.block.Blocks.AIR.defaultBlockState()).isCancelled()) {
|
2015-02-26 23:41:06 +01:00
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-06-11 07:00:00 +02:00
|
|
|
if (world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
|
2021-11-21 23:00:00 +01:00
|
|
|
world.destroyBlock(blockposition1, true, this.silverfish);
|
2015-02-26 23:41:06 +01:00
|
|
|
} else {
|
2022-02-28 16:00:00 +01:00
|
|
|
@@ -244,6 +249,11 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
IBlockData iblockdata = world.getBlockState(blockposition);
|
2021-06-11 07:00:00 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
if (BlockMonsterEggs.isCompatibleHostBlock(iblockdata)) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ // CraftBukkit start
|
2021-11-21 23:00:00 +01:00
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, BlockMonsterEggs.infestedStateByHost(iblockdata)).isCancelled()) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
world.setBlock(blockposition, BlockMonsterEggs.infestedStateByHost(iblockdata), 3);
|
|
|
|
this.mob.spawnAnim();
|
|
|
|
this.mob.discard();
|