mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-23 18:55:30 +01:00
Simplified setting icon creation
This commit is contained in:
parent
24f722d408
commit
bb62bc5617
@ -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,10 +49,10 @@ public abstract class BasicPermission {
|
||||
|| role == IslandRole.Coop)
|
||||
roleName = "Default";
|
||||
|
||||
String nameFinal = configLoad.getString("Menu.Settings." + roleName + ".Item.Setting." + name + ".Displayname");
|
||||
|
||||
im.setDisplayName(TextUtils.formatText(nameFinal == null ? name : nameFinal));
|
||||
String nameFinal = TextUtils.formatText(configLoad.getString("Menu.Settings." + roleName + ".Item.Setting." + name + ".Displayname", name));
|
||||
|
||||
if(im != null){
|
||||
im.setDisplayName(nameFinal);
|
||||
for (String itemLoreList : configLoad
|
||||
.getStringList("Menu.Settings." + roleName + ".Item.Setting.Status."
|
||||
+ (permissionEnabled ? "Enabled" : "Disabled") + ".Lore"))
|
||||
@ -60,6 +61,7 @@ public abstract class BasicPermission {
|
||||
im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
|
||||
im.setLore(itemLore);
|
||||
is.setItemMeta(im);
|
||||
}
|
||||
|
||||
return is;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user