mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Continuing to eat/drink a food will prolong the effects
This commit is contained in:
parent
c8b2bc8b5f
commit
aff0a488a4
1 changed files with 6 additions and 1 deletions
|
@ -99,7 +99,12 @@ public interface Toxin extends Affliction {
|
|||
text = new TranslatableText("potion.withDuration", text, ChatUtil.ticksToString(ticks));
|
||||
|
||||
return of(text, (player, stack) -> {
|
||||
player.addStatusEffect(new StatusEffectInstance(effect, ticks, amplifier, false, false, false));
|
||||
StatusEffectInstance current = player.getStatusEffect(effect);
|
||||
if (current != null) {
|
||||
player.addStatusEffect(new StatusEffectInstance(effect, ticks + current.getDuration(), amplifier + current.getAmplifier(), false, false, false));
|
||||
} else {
|
||||
player.addStatusEffect(new StatusEffectInstance(effect, ticks, amplifier, false, false, false));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue