mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-12-25 20:17:38 +01:00
Hopefully fixed hard cap bypass
This commit is contained in:
parent
7782a41932
commit
301cb085b8
@ -152,6 +152,14 @@ public class AnvilMerge {
|
||||
rightEnchants.remove(enchantment);
|
||||
}
|
||||
|
||||
if (PLUGIN.getConfigYml().getBool("anvil.hard-cap.enabled")) {
|
||||
if (!player.hasPermission("ecoenchants.anvil.bypasshardcap")) {
|
||||
if (outEnchants.size() >= PLUGIN.getConfigYml().getInt("anvil.hard-cap.cap")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
outEnchants.put(enchantment, level);
|
||||
}));
|
||||
|
||||
@ -182,10 +190,15 @@ public class AnvilMerge {
|
||||
canEnchantItem = true;
|
||||
}
|
||||
|
||||
if (canEnchantItem && !doesConflict.get()) {
|
||||
if (PLUGIN.getConfigYml().getBool("anvil.hard-cap.enabled") && !player.hasPermission("ecoenchants.anvil.bypasshardcap") && outEnchants.size() >= PLUGIN.getConfigYml().getInt("anvil.hard-cap.cap")) {
|
||||
return;
|
||||
if (PLUGIN.getConfigYml().getBool("anvil.hard-cap.enabled")) {
|
||||
if (!player.hasPermission("ecoenchants.anvil.bypasshardcap")) {
|
||||
if (outEnchants.size() >= PLUGIN.getConfigYml().getInt("anvil.hard-cap.cap")) {
|
||||
doesConflict.set(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (canEnchantItem && !doesConflict.get()) {
|
||||
outEnchants.put(enchantment, integer);
|
||||
}
|
||||
}));
|
||||
|
Loading…
Reference in New Issue
Block a user