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