mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-26 15:45:12 +01:00
Optimised armor listener
This commit is contained in:
parent
43dcd427f4
commit
f1b6b33ef6
@ -10,7 +10,6 @@ import com.willfp.eco.core.integrations.mcmmo.McmmoManager;
|
|||||||
import com.willfp.eco.util.TridentUtils;
|
import com.willfp.eco.util.TridentUtils;
|
||||||
import com.willfp.ecoenchants.EcoEnchantsPlugin;
|
import com.willfp.ecoenchants.EcoEnchantsPlugin;
|
||||||
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||||
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.*;
|
||||||
@ -580,7 +579,7 @@ public class WatcherTriggers extends PluginDependent implements Listener {
|
|||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
this.getPlugin().getScheduler().runLater(() -> EcoEnchants.values().forEach(enchant -> {
|
this.getPlugin().getScheduler().runLater(() -> EnchantChecks.getEnchantsOnArmor(player).forEach((enchant, integer) -> {
|
||||||
if (!enchant.isEnabled()) {
|
if (!enchant.isEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -589,8 +588,7 @@ public class WatcherTriggers extends PluginDependent implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int level = EnchantChecks.getArmorPoints(player, enchant);
|
enchant.onArmorEquip(player, integer, event);
|
||||||
enchant.onArmorEquip(player, level, event);
|
|
||||||
}), 1);
|
}), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user