From 97784872d2bf6c3d2abff29fdc308ad51170ec8b Mon Sep 17 00:00:00 2001 From: Trent Hensler Date: Sun, 4 Mar 2018 18:48:14 -0800 Subject: [PATCH] Try harder to set flags --- .../factions/zcore/fperms/PermissableAction.java | 5 +++-- .../factions/zcore/fperms/gui/PermissableActionGUI.java | 8 +++++++- .../factions/zcore/fperms/gui/PermissableRelationGUI.java | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java b/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java index b16f5143..d06e9805 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java @@ -5,6 +5,7 @@ import com.massivecraft.factions.P; import org.bukkit.DyeColor; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -34,8 +35,7 @@ public enum PermissableAction { PERMS("perms"), SETWARP("setwarp"), WARP("warp"), - FLIGHT("fly"), - ; + FLIGHT("fly"),; private String name; @@ -115,6 +115,7 @@ public enum PermissableAction { lore.add(replacePlaceholers(loreLine, fme, permissable)); } + itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); itemMeta.setDisplayName(displayName); itemMeta.setLore(lore); item.setItemMeta(itemMeta); diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java index 61257ce8..43e02894 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java @@ -189,7 +189,9 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI { for (String loreLine : backButtonConfig.getStringList("lore")) { lore.add(ChatColor.translateAlternateColorCodes('&', loreLine)); } + backButtonMeta.setLore(lore); + backButtonMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); backButton.setItemMeta(backButtonMeta); @@ -220,6 +222,10 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI { continue; } + ItemMeta meta = dummyItem.getItemMeta(); + meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); + dummyItem.setItemMeta(meta); + List dummySlots = section.getIntegerList("dummy-items." + key); for (Integer slot : dummySlots) { if (slot + 1 > guiSize || slot < 0) { @@ -267,8 +273,8 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI { for (String loreLine : dummySection.getStringList("lore")) { lore.add(ChatColor.translateAlternateColorCodes('&', loreLine)); } - itemMeta.setLore(lore); + itemMeta.setLore(lore); itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); itemStack.setItemMeta(itemMeta); diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java index ca6f69bc..8a994e10 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java @@ -144,6 +144,10 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI { continue; } + ItemMeta meta = dummyItem.getItemMeta(); + meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); + dummyItem.setItemMeta(meta); + List dummySlots = section.getIntegerList("dummy-items." + key); for (Integer slot : dummySlots) { if (slot + 1 > guiSize || slot < 0) {