From 8cbc7d697c9fa7570f8e44edf2da8dd6c7685daa Mon Sep 17 00:00:00 2001 From: Indyuce Date: Mon, 17 Aug 2020 13:31:22 +0200 Subject: [PATCH] !Small cleanup --- .../api/item/build/ItemStackBuilder.java | 3 +- .../Indyuce/mmoitems/stat/DisplayName.java | 35 +------------------ 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/src/main/java/net/Indyuce/mmoitems/api/item/build/ItemStackBuilder.java b/src/main/java/net/Indyuce/mmoitems/api/item/build/ItemStackBuilder.java index 58856114..c865bba0 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/item/build/ItemStackBuilder.java +++ b/src/main/java/net/Indyuce/mmoitems/api/item/build/ItemStackBuilder.java @@ -149,7 +149,7 @@ public class ItemStackBuilder { private final UpgradeData upgradeData; /** - * @deprecated Will be improved with MMOItems 6. Currently used to + * @deprecated Will be improved with MMOItems 7. Currently used to * display upgrade stats in the lore. Should be improved to * be more OOP friendly. NO MODIFICATIONS ALLOWED BEFORE A * REWRITE @@ -256,5 +256,4 @@ public class ItemStackBuilder { return Double.parseDouble(getStoredTags().get("BASE_" + stat.getNBTPath()).getValue().toString()); } } - } diff --git a/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java b/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java index 0bede15c..9ab2f3f7 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/DisplayName.java @@ -25,39 +25,6 @@ public class DisplayName extends StringStat { @Override public void whenLoaded(ReadMMOItem mmoitem) { if (mmoitem.getNBT().getItem().getItemMeta().hasDisplayName()) - (mmoitem).setData(ItemStat.NAME, new StringData(mmoitem.getNBT().getItem().getItemMeta().getDisplayName())); + mmoitem.setData(ItemStat.NAME, new StringData(mmoitem.getNBT().getItem().getItemMeta().getDisplayName())); } - - /* - * When loading display names, Spigot does not register white color codes - * when they are placed first in the item name. If the name starts with the - * white color code, just add an extra color code which won't be seen on the - * item - */ - // @Deprecated - // private String fix(String str) { - // return str.startsWith(ChatColor.WHITE + "") ? "" + ChatColor.GREEN + - // ChatColor.WHITE + str : str; - // } - - // public String getDisplayName(String display) { - // - // // name placeholders - // String[] split = display.split("\\<"); - // if (split.length > 1) - // // starting at 0 is pointless - // for (int j = 1; j < split.length; j++) { - // String jstr = split[j]; - // if (!jstr.contains(">")) - // continue; - // - // String ref = jstr.split("\\>")[0]; - // String placeholder = - // MMOItems.plugin.getLanguage().getNamePlaceholder(ref); - // if (placeholder != null) - // display = display.replace("<" + ref + ">", placeholder); - // } - // - // return display; - // } }