!Small cleanup

This commit is contained in:
Indyuce 2020-08-17 13:31:22 +02:00
parent d3e05b82a7
commit 8cbc7d697c
2 changed files with 2 additions and 36 deletions

View File

@ -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());
}
}
}

View File

@ -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;
// }
}