PaperMC/paper-server/patches/sources/net/minecraft/world/effect/InfestedMobEffect.java.patch

16 lines
671 B
Diff
Raw Normal View History

--- a/net/minecraft/world/effect/InfestedMobEffect.java
+++ b/net/minecraft/world/effect/InfestedMobEffect.java
@@ -48,7 +48,11 @@
entitysilverfish.moveTo(x, y, z, world.getRandom().nextFloat() * 360.0F, 0.0F);
entitysilverfish.setDeltaMovement(new Vec3(vector3f));
- world.addFreshEntity(entitysilverfish);
+ // CraftBukkit start
+ if (!world.addFreshEntity(entitysilverfish, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.POTION_EFFECT)) {
+ return;
+ }
+ // CraftBukkit end
entitysilverfish.playSound(SoundEvents.SILVERFISH_HURT);
}
}