From 635d20f8d9546ebc17ed06082c9531e9609dbeb6 Mon Sep 17 00:00:00 2001 From: Brianna O'Keefe Date: Sun, 31 Mar 2024 18:22:39 -0500 Subject: [PATCH] Removed this strange moveable stuff. --- .../com/craftaro/ultimatekits/gui/KitEditorGui.java | 9 +-------- src/main/java/com/craftaro/ultimatekits/kit/Kit.java | 4 ---- .../java/com/craftaro/ultimatekits/kit/KitItem.java | 12 +++--------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/craftaro/ultimatekits/gui/KitEditorGui.java b/src/main/java/com/craftaro/ultimatekits/gui/KitEditorGui.java index d0f0eb7..39f5554 100644 --- a/src/main/java/com/craftaro/ultimatekits/gui/KitEditorGui.java +++ b/src/main/java/com/craftaro/ultimatekits/gui/KitEditorGui.java @@ -377,15 +377,8 @@ public class KitEditorGui extends DoubleGui { if (itemStack.getItemMeta().hasLore()) { ItemMeta meta = itemStack.getItemMeta(); List newLore = new ArrayList<>(); - for (String line : meta.getLore()) { - if (line.contains("Moveable")) { - continue; - } - if (line.equals(TextUtils.formatText("&8----"))) { - break; - } + for (String line : meta.getLore()) newLore.add(line); - } meta.setLore(newLore); itemStack.setItemMeta(meta); } diff --git a/src/main/java/com/craftaro/ultimatekits/kit/Kit.java b/src/main/java/com/craftaro/ultimatekits/kit/Kit.java index e5220f4..7248d14 100644 --- a/src/main/java/com/craftaro/ultimatekits/kit/Kit.java +++ b/src/main/java/com/craftaro/ultimatekits/kit/Kit.java @@ -80,14 +80,10 @@ public class Kit implements Cloneable { List list = new ArrayList<>(); for (ItemStack is : items) { if (is != null && is.getType() != Material.AIR) { - if (is.getItemMeta().hasLore()) { ItemMeta meta = is.getItemMeta(); List newLore = new ArrayList<>(); for (String line : meta.getLore()) { - if (line.contains("Moveable")) { - continue; - } if (line.equals(TextUtils.formatText("&8----"))) { break; } diff --git a/src/main/java/com/craftaro/ultimatekits/kit/KitItem.java b/src/main/java/com/craftaro/ultimatekits/kit/KitItem.java index 5478bbf..9089029 100644 --- a/src/main/java/com/craftaro/ultimatekits/kit/KitItem.java +++ b/src/main/java/com/craftaro/ultimatekits/kit/KitItem.java @@ -195,15 +195,9 @@ public class KitItem implements Cloneable { return null; } ItemStack item = this.content.getItemForDisplay().clone(); - ItemMeta meta = item.getItemMeta(); - List lore = meta.hasLore() && meta.getLore().get(0).equals(TextUtils.formatText("&8&oMoveable")) - ? new ArrayList<>() : new ArrayList<>(Collections.singletonList(TextUtils.formatText("&8&oMoveable"))); - if (meta.hasLore()) { - lore.addAll(meta.getLore()); - } - meta.setLore(lore); - item.setItemMeta(meta); - return compileOptions(item); + NBTItem nbtItem = new NBTItem(item); + nbtItem.setBoolean("moveable", true); + return compileOptions(nbtItem.getItem()); } public ItemStack getItemForDisplay(Kit kit) {