From 20c9b6f42d0f92f0d7f2f612c5fe9c9d8894048f Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 24 Sep 2024 15:52:19 +0100 Subject: [PATCH] Reduce chance of mobs reproducing when they have the corrupt influence effect. Fixes #467 --- src/main/java/com/minelittlepony/unicopia/entity/Living.java | 2 +- .../unicopia/entity/effect/CorruptInfluenceStatusEffect.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Living.java b/src/main/java/com/minelittlepony/unicopia/entity/Living.java index 756a4491..e109876a 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Living.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Living.java @@ -381,7 +381,7 @@ public abstract class Living implements Equine, Caste } } - if (entity instanceof HostileEntity mob && mob.hasStatusEffect(UEffects.CORRUPT_INFLUENCE) && mob.getRandom().nextInt(4) == 0) { + if (entity instanceof HostileEntity mob && mob.hasStatusEffect(UEffects.CORRUPT_INFLUENCE) && mob.getRandom().nextInt(4000) == 0) { CorruptInfluenceStatusEffect.reproduce(mob); } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/effect/CorruptInfluenceStatusEffect.java b/src/main/java/com/minelittlepony/unicopia/entity/effect/CorruptInfluenceStatusEffect.java index bf98ef9d..a30d7656 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/effect/CorruptInfluenceStatusEffect.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/effect/CorruptInfluenceStatusEffect.java @@ -89,6 +89,9 @@ public class CorruptInfluenceStatusEffect extends StatusEffect { } } + if (mob.getRandom().nextInt(4) != 0) { + clone.clearStatusEffects(); + } mob.getWorld().spawnEntity(clone); if (!mob.isSilent()) {