From 76a29f66bd32c894f24d58ddebb95756844c3715 Mon Sep 17 00:00:00 2001 From: Demeng <43016355+Demeng7215@users.noreply.github.com> Date: Sat, 25 May 2024 01:27:35 -0400 Subject: [PATCH] Fix MC 1.20.5/6 result, change native version to 1.20.6 --- .../dev/demeng/pluginbase/item/ItemBuilder.java | 17 +++++++++++------ pom.xml | 6 ++++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pluginbase-core/src/main/java/dev/demeng/pluginbase/item/ItemBuilder.java b/pluginbase-core/src/main/java/dev/demeng/pluginbase/item/ItemBuilder.java index 57c1380d..dba3d739 100644 --- a/pluginbase-core/src/main/java/dev/demeng/pluginbase/item/ItemBuilder.java +++ b/pluginbase-core/src/main/java/dev/demeng/pluginbase/item/ItemBuilder.java @@ -24,6 +24,7 @@ package dev.demeng.pluginbase.item; +import com.cryptomorin.xseries.XEnchantment; import com.cryptomorin.xseries.XMaterial; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; @@ -325,13 +326,17 @@ public ItemBuilder clearFlags() { */ public ItemBuilder glow(final boolean glow) { - if (glow) { - enchant(Enchantment.DURABILITY, 1); - flags(ItemFlag.HIDE_ENCHANTS); + final Enchantment enchant = XEnchantment.UNBREAKING.getEnchant(); - } else { - stack.removeEnchantment(Enchantment.DURABILITY); - updateMeta(meta -> meta.removeItemFlags(ItemFlag.HIDE_ENCHANTS)); + if (enchant != null) { + if (glow) { + enchant(XEnchantment.UNBREAKING.getEnchant(), 1); + flags(ItemFlag.HIDE_ENCHANTS); + + } else { + stack.removeEnchantment(XEnchantment.UNBREAKING.getEnchant()); + updateMeta(meta -> meta.removeItemFlags(ItemFlag.HIDE_ENCHANTS)); + } } return this; diff --git a/pom.xml b/pom.xml index 7f83fd47..6f12c14a 100644 --- a/pom.xml +++ b/pom.xml @@ -60,6 +60,7 @@ org.apache.maven.plugins maven-source-plugin + 3.2.1 attach-sources @@ -72,6 +73,7 @@ org.apache.maven.plugins maven-javadoc-plugin + 3.3.2 none @@ -131,7 +133,7 @@ org.spigotmc spigot-api - 1.16.4-R0.1-SNAPSHOT + 1.20.6-R0.1-SNAPSHOT provided @@ -143,7 +145,7 @@ org.projectlombok lombok - 1.18.30 + 1.18.32 provided