aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/entity/monster/EntitySilverfish.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/entity/monster/EntitySilverfish.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/entity/monster/EntitySilverfish.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/entity/monster/EntitySilverfish.patch b/patch-remap/og/net/minecraft/world/entity/monster/EntitySilverfish.patch
new file mode 100644
index 0000000000..d7e3c5aabf
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/entity/monster/EntitySilverfish.patch
@@ -0,0 +1,37 @@
+--- a/net/minecraft/world/entity/monster/EntitySilverfish.java
++++ b/net/minecraft/world/entity/monster/EntitySilverfish.java
+@@ -34,6 +34,10 @@
+ import net.minecraft.world.level.block.state.IBlockData;
+ import org.joml.Vector3f;
+
++// CraftBukkit start
++import org.bukkit.craftbukkit.event.CraftEventFactory;
++// CraftBukkit end
++
+ public class EntitySilverfish extends EntityMonster {
+
+ @Nullable
+@@ -176,6 +180,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 {
+@@ -245,6 +254,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();