diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/monster/Silverfish.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/monster/Silverfish.java.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/monster/Silverfish.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/monster/Silverfish.java.patch new file mode 100644 index 0000000000..78592dad43 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/monster/Silverfish.java.patch @@ -0,0 +1,45 @@ +--- a/net/minecraft/world/entity/monster/Silverfish.java ++++ b/net/minecraft/world/entity/monster/Silverfish.java +@@ -34,6 +34,10 @@ + import net.minecraft.world.level.block.state.BlockState; + import org.joml.Vector3f; + ++// CraftBukkit start ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++// CraftBukkit end ++ + public class Silverfish extends Monster { + + @Nullable +@@ -191,8 +180,13 @@ + Block block = blockstate.getBlock(); + + if (block instanceof InfestedBlock) { +- if (level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { +- level.destroyBlock(blockpos1, true, this.silverfish); ++ // 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 { + level.setBlock(blockpos1, ((InfestedBlock) block).hostStateByInfested(level.getBlockState(blockpos1)), 3); + } +@@ -262,8 +253,13 @@ + BlockPos blockpos = BlockPos.containing(this.mob.getX(), this.mob.getY() + 0.5D, this.mob.getZ()).relative(this.selectedDirection); + BlockState blockstate = level.getBlockState(blockpos); + +- if (InfestedBlock.isCompatibleHostBlock(blockstate)) { +- level.setBlock(blockpos, InfestedBlock.infestedStateByHost(blockstate), 3); ++ if (InfestedBlock.isCompatibleHostBlock(iblockdata)) { ++ // CraftBukkit start ++ if (!CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, InfestedBlock.infestedStateByHost(iblockdata))) { ++ return; ++ } ++ // CraftBukkit end ++ world.setBlock(blockposition, InfestedBlock.infestedStateByHost(iblockdata), 3); + this.mob.spawnAnim(); + this.mob.discard(); + } |