Fixed level-clamp removing the enchantment rather than clamping it

This commit is contained in:
Auxilor 2021-07-04 00:49:48 +02:00
parent b65ecc4e29
commit 8abd254270
2 changed files with 1 additions and 1 deletions

View File

@ -1,6 +1,5 @@
package com.willfp.ecoenchants;
import com.willfp.eco.core.AbstractPacketAdapter;
import com.willfp.eco.core.EcoPlugin;
import com.willfp.eco.core.command.AbstractCommand;
import com.willfp.eco.core.display.DisplayModule;

View File

@ -288,6 +288,7 @@ public class ItemConversions extends PluginDependent implements Listener {
new HashMap<>(meta.getEnchants()).forEach((enchantment, integer) -> {
if (integer > enchantment.getMaxLevel()) {
meta.removeEnchant(enchantment);
meta.addEnchant(enchantment, enchantment.getMaxLevel(), true);
}
});
}