1 Commits
V1.1 ... main

Author SHA1 Message Date
KäseToatz
7e828a42b0 Fix duplicate enchants 2025-08-23 00:11:48 +02:00
3 changed files with 9 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ plugins {
}
group = 'com.kasetoatz'
version = '1.0'
version = '1.2'
repositories {
mavenCentral()
@@ -23,7 +23,7 @@ tasks {
// Configure the Minecraft version for our task.
// This is the only required configuration besides applying the plugin.
// Your plugin's jar (or shadowJar if present) will be used automatically.
minecraftVersion("1.21")
minecraftVersion("1.21.8")
}
}

View File

@@ -15,6 +15,8 @@ import org.bukkit.inventory.view.AnvilView;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import static com.kasetoatz.superArmor.Multiplier.multipliers;
@@ -128,6 +130,10 @@ public final class SuperArmor extends JavaPlugin implements Listener {
getEnchants(right).forEach((enchant, level) -> {
if (isValidEnchant(left, enchant))
{
if (Objects.equals(getEnchants(left).getOrDefault(enchant, -1), level))
{
level = Math.min(enchant.getMaxLevel(), level + 1);
}
if (result.getItemMeta() instanceof EnchantmentStorageMeta meta)
{
meta.addStoredEnchant(enchant, level, true);

View File

@@ -1,4 +1,4 @@
name: SuperArmor
version: '1.1'
version: '1.2'
main: com.kasetoatz.superArmor.SuperArmor
api-version: '1.21'