From 360a42d99fc3b984ef8d67e63cb970f1a6dd1275 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Mon, 30 Dec 2019 17:12:36 +0100 Subject: [PATCH] !Fixed skill GUI display issue --- src/main/java/net/Indyuce/mmocore/gui/QuestViewer.java | 2 +- src/main/java/net/Indyuce/mmocore/gui/SkillList.java | 2 +- .../mmocore/gui/api/item/InventoryPlaceholderItem.java | 6 +++--- src/main/java/net/Indyuce/mmocore/skill/Ice_Spikes.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/Indyuce/mmocore/gui/QuestViewer.java b/src/main/java/net/Indyuce/mmocore/gui/QuestViewer.java index 0575895a..41adc337 100644 --- a/src/main/java/net/Indyuce/mmocore/gui/QuestViewer.java +++ b/src/main/java/net/Indyuce/mmocore/gui/QuestViewer.java @@ -134,7 +134,7 @@ public class QuestViewer extends EditableInventory { /* * generate item */ - ItemStack item = new ItemStack(getStack()); + ItemStack item = cloneItem(); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(holders.apply(inv.getPlayer(), getName())); meta.addItemFlags(ItemFlag.values()); diff --git a/src/main/java/net/Indyuce/mmocore/gui/SkillList.java b/src/main/java/net/Indyuce/mmocore/gui/SkillList.java index ad3b783e..9f8650a7 100644 --- a/src/main/java/net/Indyuce/mmocore/gui/SkillList.java +++ b/src/main/java/net/Indyuce/mmocore/gui/SkillList.java @@ -170,7 +170,7 @@ public class SkillList extends EditableInventory { for (int j = 0; j < lore.size(); j++) lore.set(j, ChatColor.GRAY + ChatColor.translateAlternateColorCodes('&', lore.get(j))); - ItemStack item = new ItemStack(getStack()); + ItemStack item = cloneItem(); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', getName().replace("{skill}", skill.getSkill().getName()).replace("{roman}", MMOCoreUtils.intToRoman(skillLevel)).replace("{level}", "" + skillLevel))); meta.addItemFlags(ItemFlag.values()); diff --git a/src/main/java/net/Indyuce/mmocore/gui/api/item/InventoryPlaceholderItem.java b/src/main/java/net/Indyuce/mmocore/gui/api/item/InventoryPlaceholderItem.java index b942faee..6608b1de 100644 --- a/src/main/java/net/Indyuce/mmocore/gui/api/item/InventoryPlaceholderItem.java +++ b/src/main/java/net/Indyuce/mmocore/gui/api/item/InventoryPlaceholderItem.java @@ -45,8 +45,8 @@ public abstract class InventoryPlaceholderItem extends InventoryItem { this.modelData = config.getInt("custom-model-data"); } - public ItemStack getStack() { - return stack; + public ItemStack cloneItem() { + return stack.clone(); } public boolean hideFlags() { @@ -92,7 +92,7 @@ public abstract class InventoryPlaceholderItem extends InventoryItem { public ItemStack display(GeneratedInventory inv, int n) { Placeholders placeholders = getPlaceholders(inv, n); - ItemStack item = getStack(); + ItemStack item = cloneItem(); ItemMeta meta = item.getItemMeta(); if (texture != null && meta instanceof SkullMeta) diff --git a/src/main/java/net/Indyuce/mmocore/skill/Ice_Spikes.java b/src/main/java/net/Indyuce/mmocore/skill/Ice_Spikes.java index ee8b5b75..714658a2 100644 --- a/src/main/java/net/Indyuce/mmocore/skill/Ice_Spikes.java +++ b/src/main/java/net/Indyuce/mmocore/skill/Ice_Spikes.java @@ -30,7 +30,7 @@ public class Ice_Spikes extends Skill { public Ice_Spikes() { super(); setMaterial(VersionMaterial.SNOWBALL.toMaterial()); - setLore("Ice spikes summon from the ground", "and shatters, each dealing &9{damage} &7damage", "to hit enemies and slowing them down", "for &9{slow} &7seconds.", "", "&e{cooldown}s Cooldown", "&9Costs {mana} {mana_name}"); + setLore("Ice spikes summon from the ground", "and shatter, each dealing &9{damage} &7damage", "to hit enemies and slowing them down", "for &9{slow} &7seconds.", "", "&e{cooldown}s Cooldown", "&9Costs {mana} {mana_name}"); addModifier("cooldown", new LinearValue(6, -.1, 2, 6)); addModifier("mana", new LinearValue(20, 2));