9
0
mirror of https://github.com/Auxilor/EcoArmor.git synced 2025-12-28 03:19:25 +00:00

Migrated changes from master

This commit is contained in:
Auxilor
2021-07-04 13:15:27 +02:00
parent 28eb237be2
commit 794121b20e
3 changed files with 7 additions and 6 deletions

View File

@@ -96,6 +96,7 @@ public class EcoArmorPlugin extends EcoPlugin {
public void onReload() {
Effects.values().forEach(effect -> this.getEventManager().unregisterListener(effect));
Effects.values().stream().filter(Effect::isEnabled).forEach(effect -> this.getEventManager().registerListener(effect));
this.getLogger().info(Tiers.values().size() + " Tiers Loaded");
this.getLogger().info(ArmorSets.values().size() + " Sets Loaded");
}

View File

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

View File

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