mirror of
https://github.com/Auxilor/EcoArmor.git
synced 2025-12-28 11:29:18 +00:00
Fixed bug with potion effects
This commit is contained in:
@@ -80,19 +80,19 @@ public abstract class Condition<T> implements Listener {
|
||||
}
|
||||
|
||||
set.getPotionEffects().forEach((potionEffectType, integer) -> {
|
||||
player.addPotionEffect(new PotionEffect(potionEffectType, 0x6fffffff, integer - 1, false, false, true));
|
||||
player.addPotionEffect(new PotionEffect(potionEffectType, 0x6ffffff, integer - 1, false, false, true));
|
||||
});
|
||||
|
||||
if (ArmorUtils.isWearingAdvanced(player)) {
|
||||
set.getAdvancedPotionEffects().forEach((potionEffectType, integer) -> {
|
||||
player.addPotionEffect(new PotionEffect(potionEffectType, 0x6fffffff, integer - 1, false, false, true));
|
||||
player.addPotionEffect(new PotionEffect(potionEffectType, 0x6ffffff, integer - 1, false, false, true));
|
||||
});
|
||||
}
|
||||
} else {
|
||||
set.getEffects().keySet().forEach(effect -> effect.disable(player));
|
||||
|
||||
for (PotionEffect effect : player.getActivePotionEffects()) {
|
||||
if (effect.getDuration() >= 500000000) {
|
||||
if (effect.getDuration() >= 0x5ffffff && effect.getDuration() <= 0x6ffffff) {
|
||||
player.removePotionEffect(effect.getType());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,18 +71,18 @@ public class EffectWatcher extends PluginDependent implements Listener {
|
||||
|
||||
if (set == null || !conditionsMet) {
|
||||
for (PotionEffect effect : player.getActivePotionEffects()) {
|
||||
if (effect.getDuration() >= 500000000) {
|
||||
if (effect.getDuration() >= 0x5ffffff && effect.getDuration() <= 0x6ffffff) {
|
||||
player.removePotionEffect(effect.getType());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
set.getPotionEffects().forEach((potionEffectType, integer) -> {
|
||||
player.addPotionEffect(new PotionEffect(potionEffectType, 0x6fffffff, integer - 1, false, false, true));
|
||||
player.addPotionEffect(new PotionEffect(potionEffectType, 0x6ffffff, integer - 1, false, false, true));
|
||||
});
|
||||
|
||||
if (ArmorUtils.isWearingAdvanced(player)) {
|
||||
set.getAdvancedPotionEffects().forEach((potionEffectType, integer) -> {
|
||||
player.addPotionEffect(new PotionEffect(potionEffectType, 0x6fffffff, integer - 1, false, false, true));
|
||||
player.addPotionEffect(new PotionEffect(potionEffectType, 0x6ffffff, integer - 1, false, false, true));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user