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.config.FileManager;
|
||||||
import com.songoda.skyblock.island.Island;
|
import com.songoda.skyblock.island.Island;
|
||||||
import com.songoda.skyblock.island.IslandRole;
|
import com.songoda.skyblock.island.IslandRole;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.inventory.ItemFlag;
|
import org.bukkit.inventory.ItemFlag;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -48,18 +49,19 @@ public abstract class BasicPermission {
|
|||||||
|| role == IslandRole.Coop)
|
|| role == IslandRole.Coop)
|
||||||
roleName = "Default";
|
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
|
im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
|
||||||
.getStringList("Menu.Settings." + roleName + ".Item.Setting.Status."
|
im.setLore(itemLore);
|
||||||
+ (permissionEnabled ? "Enabled" : "Disabled") + ".Lore"))
|
is.setItemMeta(im);
|
||||||
itemLore.add(TextUtils.formatText(itemLoreList));
|
}
|
||||||
|
|
||||||
im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
|
|
||||||
im.setLore(itemLore);
|
|
||||||
is.setItemMeta(im);
|
|
||||||
|
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user