Simplified setting icon creation

This commit is contained in:
Fabrizio La Rosa 2020-06-18 20:04:17 +02:00
parent 24f722d408
commit bb62bc5617

View File

@ -6,6 +6,7 @@ import com.songoda.skyblock.SkyBlock;
import com.songoda.skyblock.config.FileManager;
import com.songoda.skyblock.island.Island;
import com.songoda.skyblock.island.IslandRole;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
@ -48,18 +49,19 @@ public abstract class BasicPermission {
|| role == IslandRole.Coop)
roleName = "Default";
String nameFinal = configLoad.getString("Menu.Settings." + roleName + ".Item.Setting." + name + ".Displayname");
String nameFinal = TextUtils.formatText(configLoad.getString("Menu.Settings." + roleName + ".Item.Setting." + name + ".Displayname", name));
im.setDisplayName(TextUtils.formatText(nameFinal == null ? name : nameFinal));
if(im != null){
im.setDisplayName(nameFinal);
for (String itemLoreList : configLoad
.getStringList("Menu.Settings." + roleName + ".Item.Setting.Status."
+ (permissionEnabled ? "Enabled" : "Disabled") + ".Lore"))
itemLore.add(TextUtils.formatText(itemLoreList));
for (String itemLoreList : configLoad
.getStringList("Menu.Settings." + roleName + ".Item.Setting.Status."
+ (permissionEnabled ? "Enabled" : "Disabled") + ".Lore"))
itemLore.add(TextUtils.formatText(itemLoreList));
im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
im.setLore(itemLore);
is.setItemMeta(im);
im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
im.setLore(itemLore);
is.setItemMeta(im);
}
return is;
}