PaperMC/paper-server/patches/sources/net/minecraft/world/effect/InfestedMobEffect.java.patch
CraftBukkit/Spigot 30e4583dbe Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
2024-12-11 22:26:55 +01:00

15 lines
671 B
Diff

--- 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);
}
}