Try harder to set flags

This commit is contained in:
Trent Hensler 2018-03-04 18:48:14 -08:00
parent ff37d0c241
commit 97784872d2
3 changed files with 14 additions and 3 deletions

View File

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

View File

@ -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<Integer> 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);

View File

@ -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<Integer> dummySlots = section.getIntegerList("dummy-items." + key);
for (Integer slot : dummySlots) {
if (slot + 1 > guiSize || slot < 0) {