1.15 Item Conversion Complete

This commit is contained in:
Driftay 2020-01-20 03:46:53 -05:00
parent ce1eedd7cd
commit 018f08699d
18 changed files with 1460 additions and 1034 deletions

View File

@ -78,6 +78,7 @@ public class FactionsPlugin extends MPlugin {
public boolean mc112 = false; public boolean mc112 = false;
public boolean mc113 = false; public boolean mc113 = false;
public boolean mc114 = false; public boolean mc114 = false;
public boolean mc115 = false;
public boolean useNonPacketParticles = false; public boolean useNonPacketParticles = false;
public boolean factionsFlight = false; public boolean factionsFlight = false;
SkriptAddon skriptAddon; SkriptAddon skriptAddon;
@ -164,6 +165,10 @@ public class FactionsPlugin extends MPlugin {
FactionsPlugin.instance.log("Minecraft Version 1.14 found."); FactionsPlugin.instance.log("Minecraft Version 1.14 found.");
mc114 = true; mc114 = true;
break; break;
case 15:
FactionsPlugin.instance.log("Minecraft Version 1.15 found.");
mc115 = true;
break;
} }
migrateFPlayerLeaders(); migrateFPlayerLeaders();
log("==== End Setup ===="); log("==== End Setup ====");
@ -464,7 +469,7 @@ public class FactionsPlugin extends MPlugin {
} }
public ItemStack createItem(Material material, int amount, short datavalue, String name, List<String> lore) { public ItemStack createItem(Material material, int amount, short datavalue, String name, List<String> lore) {
ItemStack item = new ItemStack(XMaterial.matchXMaterial(material.toString()).parseMaterial(), amount, datavalue); ItemStack item = new ItemStack(XMaterial.matchXMaterial(material.toString()).get().parseMaterial(), amount, datavalue);
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
meta.setDisplayName(color(name)); meta.setDisplayName(color(name));
meta.setLore(colorList(lore)); meta.setLore(colorList(lore));

View File

@ -62,7 +62,7 @@ public enum FLogType {
} }
public Material getMaterial() { public Material getMaterial() {
return XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("faudit-gui.materials." + name().toLowerCase())).parseMaterial(); return XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("faudit-gui.materials." + name().toLowerCase())).get().parseMaterial();
} }
public String getMsg() { public String getMsg() {

View File

@ -52,19 +52,19 @@ public class CheckSettingsFrame implements InventoryHolder, FactionGUI {
public void build() { public void build() {
Faction faction = fPlayer.getFaction(); Faction faction = fPlayer.getFaction();
ItemStack wallsStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.wall-check.Type")).parseItem(); ItemStack wallsStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.wall-check.Type")).get().parseItem();
ItemMeta wallsMeta = wallsStack.getItemMeta(); ItemMeta wallsMeta = wallsStack.getItemMeta();
wallsMeta.setDisplayName(TL.CHECK_WALL_CHECK_GUI_ICON.toString()); wallsMeta.setDisplayName(TL.CHECK_WALL_CHECK_GUI_ICON.toString());
wallsMeta.setLore(Collections.singletonList(TL.CHECK_CHECK_LORE_LINE.format(getFormatted(faction.getWallCheckMinutes())))); wallsMeta.setLore(Collections.singletonList(TL.CHECK_CHECK_LORE_LINE.format(getFormatted(faction.getWallCheckMinutes()))));
wallsStack.setItemMeta(wallsMeta); wallsStack.setItemMeta(wallsMeta);
inventory.setItem(FactionsPlugin.getInstance().getConfig().getInt("f-check.wall-check.slot"), wallsStack); inventory.setItem(FactionsPlugin.getInstance().getConfig().getInt("f-check.wall-check.slot"), wallsStack);
ItemStack bufferStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.buffer-check.Type")).parseItem(); ItemStack bufferStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.buffer-check.Type")).get().parseItem();
ItemMeta bufferMeta = bufferStack.getItemMeta(); ItemMeta bufferMeta = bufferStack.getItemMeta();
bufferMeta.setDisplayName(TL.CHECK_BUFFER_CHECK_GUI_ICON.toString()); bufferMeta.setDisplayName(TL.CHECK_BUFFER_CHECK_GUI_ICON.toString());
bufferMeta.setLore(Collections.singletonList(TL.CHECK_CHECK_LORE_LINE.format(getFormatted(faction.getBufferCheckMinutes())))); bufferMeta.setLore(Collections.singletonList(TL.CHECK_CHECK_LORE_LINE.format(getFormatted(faction.getBufferCheckMinutes()))));
bufferStack.setItemMeta(bufferMeta); bufferStack.setItemMeta(bufferMeta);
inventory.setItem(FactionsPlugin.getInstance().getConfig().getInt("f-check.buffer-check.slot"), bufferStack); inventory.setItem(FactionsPlugin.getInstance().getConfig().getInt("f-check.buffer-check.slot"), bufferStack);
ItemStack historyStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.history.Type")).parseItem(); ItemStack historyStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.history.Type")).get().parseItem();
ItemMeta historyMeta = historyStack.getItemMeta(); ItemMeta historyMeta = historyStack.getItemMeta();
historyMeta.setDisplayName(TL.CHECK_HISTORY_GUI_ICON.toString()); historyMeta.setDisplayName(TL.CHECK_HISTORY_GUI_ICON.toString());
historyStack.setItemMeta(historyMeta); historyStack.setItemMeta(historyMeta);

View File

@ -46,7 +46,7 @@ public class WildGUI implements FactionGUI {
@Override @Override
public void build() { public void build() {
inv = Bukkit.createInventory(this, FactionsPlugin.getInstance().getConfig().getInt("Wild.GUI.Size"), FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("Wild.GUI.Name"))); inv = Bukkit.createInventory(this, FactionsPlugin.getInstance().getConfig().getInt("Wild.GUI.Size"), FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("Wild.GUI.Name")));
ItemStack fillItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.GUI.FillMaterial")).parseItem(); ItemStack fillItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.GUI.FillMaterial")).get().parseItem();
ItemMeta meta = fillItem.getItemMeta(); ItemMeta meta = fillItem.getItemMeta();
if (meta == null) return; if (meta == null) return;
meta.setDisplayName(""); meta.setDisplayName("");
@ -55,7 +55,7 @@ public class WildGUI implements FactionGUI {
inv.setItem(fill, fillItem); inv.setItem(fill, fillItem);
} }
for (String key : Objects.requireNonNull(FactionsPlugin.getInstance().getConfig().getConfigurationSection("Wild.Zones")).getKeys(false)) { for (String key : Objects.requireNonNull(FactionsPlugin.getInstance().getConfig().getConfigurationSection("Wild.Zones")).getKeys(false)) {
ItemStack zoneItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.Zones." + key + ".Material")).parseItem(); ItemStack zoneItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.Zones." + key + ".Material")).get().parseItem();
ItemMeta zoneMeta = zoneItem.getItemMeta(); ItemMeta zoneMeta = zoneItem.getItemMeta();
if (zoneMeta == null) return; if (zoneMeta == null) return;
List<String> lore = new ArrayList<>(); List<String> lore = new ArrayList<>();

View File

@ -40,6 +40,7 @@ import org.bukkit.potion.PotionEffectType;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@ -377,7 +378,7 @@ public class FactionsBlockListener implements Listener {
int radius = FactionsPlugin.getInstance().getConfig().getInt("fbanners.Banner-Effect-Radius"); int radius = FactionsPlugin.getInstance().getConfig().getInt("fbanners.Banner-Effect-Radius");
List<String> effects = FactionsPlugin.getInstance().getConfig().getStringList("fbanners.Effects"); List<String> effects = FactionsPlugin.getInstance().getConfig().getStringList("fbanners.Effects");
int affectorTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(FactionsPlugin.getInstance(), () -> { int affectorTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(FactionsPlugin.getInstance(), () -> {
for (Entity e1 : banner.getLocation().getWorld().getNearbyEntities(banner.getLocation(), radius, 255.0, radius)) { for (Entity e1 : Objects.requireNonNull(banner.getLocation().getWorld()).getNearbyEntities(banner.getLocation(), radius, 255.0, radius)) {
if (e1 instanceof Player) { if (e1 instanceof Player) {
Player player = (Player) e1; Player player = (Player) e1;
FPlayer fplayer = FPlayers.getInstance().getByPlayer(player); FPlayer fplayer = FPlayers.getInstance().getByPlayer(player);
@ -386,7 +387,7 @@ public class FactionsBlockListener implements Listener {
} }
for (String effect : effects) { for (String effect : effects) {
String[] components = effect.split(":"); String[] components = effect.split(":");
player.addPotionEffect(new PotionEffect(PotionEffectType.getByName(components[0]), 100, Integer.parseInt(components[1]))); player.addPotionEffect(new PotionEffect(Objects.requireNonNull(PotionEffectType.getByName(components[0])), 100, Integer.parseInt(components[1])));
} }
ParticleEffect.LAVA.display(1.0f, 1.0f, 1.0f, 1.0f, 10, banner.getLocation(), 16.0); ParticleEffect.LAVA.display(1.0f, 1.0f, 1.0f, 1.0f, 10, banner.getLocation(), 16.0);
ParticleEffect.FLAME.display(1.0f, 1.0f, 1.0f, 1.0f, 10, banner.getLocation(), 16.0); ParticleEffect.FLAME.display(1.0f, 1.0f, 1.0f, 1.0f, 10, banner.getLocation(), 16.0);
@ -499,7 +500,7 @@ public class FactionsBlockListener implements Listener {
return; return;
} }
if (block != null && isSpawner) { if (block != null && isSpawner) {
ItemStack item = new ItemStack(block.getType(), 1, (short) block.getData()); ItemStack item = new ItemStack(block.getType(), 1, block.getData());
if (at != null && at.isNormal()) { if (at != null && at.isNormal()) {
FPlayer fplayer = FPlayers.getInstance().getByPlayer(event.getPlayer()); FPlayer fplayer = FPlayers.getInstance().getByPlayer(event.getPlayer());
if (fplayer != null) { if (fplayer != null) {

View File

@ -819,7 +819,7 @@ public class FactionsPlayerListener implements Listener {
Material type; Material type;
if (event.getItem() != null) { if (event.getItem() != null) {
// Convert 1.8 Material Names -> 1.14 // Convert 1.8 Material Names -> 1.14
type = XMaterial.matchXMaterial(event.getItem().getType().toString()).parseMaterial(); type = XMaterial.matchXMaterial(event.getItem().getType().toString()).get().parseMaterial();
} else { } else {
type = null; type = null;
} }

View File

@ -96,7 +96,7 @@ public class MissionGUI implements FactionGUI {
if (configurationSection == null) { if (configurationSection == null) {
return; return;
} }
ItemStack fillItem = XMaterial.matchXMaterial(configurationSection.getString("FillItem.Material")).parseItem(); ItemStack fillItem = XMaterial.matchXMaterial(configurationSection.getString("FillItem.Material")).get().parseItem();
ItemMeta fillmeta = fillItem.getItemMeta(); ItemMeta fillmeta = fillItem.getItemMeta();
fillmeta.setDisplayName(""); fillmeta.setDisplayName("");
fillItem.setItemMeta(fillmeta); fillItem.setItemMeta(fillmeta);
@ -109,7 +109,7 @@ public class MissionGUI implements FactionGUI {
ConfigurationSection section = configurationSection.getConfigurationSection(key); ConfigurationSection section = configurationSection.getConfigurationSection(key);
int slot = section.getInt("Slot"); int slot = section.getInt("Slot");
ItemStack itemStack = XMaterial.matchXMaterial(section.getString("Material")).parseItem(); ItemStack itemStack = XMaterial.matchXMaterial(section.getString("Material")).get().parseItem();
ItemMeta itemMeta = itemStack.getItemMeta(); ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', section.getString("Name"))); itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', section.getString("Name")));
List<String> loreLines = new ArrayList<>(); List<String> loreLines = new ArrayList<>();
@ -134,7 +134,7 @@ public class MissionGUI implements FactionGUI {
if (plugin.getConfig().getBoolean("Randomization.Enabled")) { if (plugin.getConfig().getBoolean("Randomization.Enabled")) {
ItemStack start; ItemStack start;
ItemMeta meta; ItemMeta meta;
start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Allowed.Material")).parseItem(); start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Allowed.Material")).get().parseItem();
meta = start.getItemMeta(); meta = start.getItemMeta();
meta.setDisplayName(plugin.color(plugin.getConfig().getString("Randomization.Start-Item.Allowed.Name"))); meta.setDisplayName(plugin.color(plugin.getConfig().getString("Randomization.Start-Item.Allowed.Name")));
List<String> loree = new ArrayList<>(); List<String> loree = new ArrayList<>();
@ -144,7 +144,7 @@ public class MissionGUI implements FactionGUI {
meta.setLore(loree); meta.setLore(loree);
start.setItemMeta(meta); start.setItemMeta(meta);
if (fPlayer.getFaction().getCompletedMissions().size() >= configurationSection.getKeys(false).size() - 1 && plugin.getConfig().getBoolean("DenyMissionsMoreThenOnce")) { if (fPlayer.getFaction().getCompletedMissions().size() >= configurationSection.getKeys(false).size() - 1 && plugin.getConfig().getBoolean("DenyMissionsMoreThenOnce")) {
start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Material")).parseItem(); start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Material")).get().parseItem();
meta = start.getItemMeta(); meta = start.getItemMeta();
meta.setDisplayName(plugin.color(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Name"))); meta.setDisplayName(plugin.color(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Name")));
List<String> lore = new ArrayList<>(); List<String> lore = new ArrayList<>();
@ -155,7 +155,7 @@ public class MissionGUI implements FactionGUI {
start.setItemMeta(meta); start.setItemMeta(meta);
} }
if (fPlayer.getFaction().getMissions().size() >= plugin.getConfig().getInt("MaximumMissionsAllowedAtOnce")) { if (fPlayer.getFaction().getMissions().size() >= plugin.getConfig().getInt("MaximumMissionsAllowedAtOnce")) {
start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Material")).parseItem(); start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Material")).get().parseItem();
meta = start.getItemMeta(); meta = start.getItemMeta();
meta.setDisplayName(plugin.color(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Name"))); meta.setDisplayName(plugin.color(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Name")));
List<String> lore = new ArrayList<>(); List<String> lore = new ArrayList<>();

View File

@ -47,7 +47,7 @@ public class ShopGUIFrame {
for (int a = 1; a <= items; a++) { for (int a = 1; a <= items; a++) {
String s = a + ""; String s = a + "";
int slot = ShopConfig.getShop().getInt("items." + s + ".slot"); int slot = ShopConfig.getShop().getInt("items." + s + ".slot");
Material material = XMaterial.matchXMaterial(ShopConfig.getShop().getString("items." + s + ".block")).parseMaterial(); Material material = XMaterial.matchXMaterial(ShopConfig.getShop().getString("items." + s + ".block")).get().parseMaterial();
int cost = ShopConfig.getShop().getInt("items." + s + ".cost"); int cost = ShopConfig.getShop().getInt("items." + s + ".cost");
String name = ShopConfig.getShop().getString("items." + s + ".name"); String name = ShopConfig.getShop().getString("items." + s + ".name");
boolean glowing = ShopConfig.getShop().getBoolean("items." + s + ".glowing"); boolean glowing = ShopConfig.getShop().getBoolean("items." + s + ".glowing");
@ -93,7 +93,7 @@ public class ShopGUIFrame {
private ItemStack buildDummyItem(Faction f) { private ItemStack buildDummyItem(Faction f) {
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("F-Shop.GUI.dummy-item"); ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("F-Shop.GUI.dummy-item");
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem(); ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
if (meta != null) { if (meta != null) {
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore"))); meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));

View File

@ -210,7 +210,7 @@ public enum Relation implements Permissable {
String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", "")); String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", ""));
List<String> lore = new ArrayList<>(); List<String> lore = new ArrayList<>();
Material material = XMaterial.matchXMaterial(RELATION_CONFIG.getString("materials." + name().toLowerCase())).parseMaterial(); Material material = XMaterial.matchXMaterial(RELATION_CONFIG.getString("materials." + name().toLowerCase())).get().parseMaterial();
if (material == null) { if (material == null) {
return null; return null;
} }

View File

@ -128,7 +128,7 @@ public enum Role implements Permissable {
String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", "")); String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", ""));
List<String> lore = new ArrayList<>(); List<String> lore = new ArrayList<>();
Material material = XMaterial.matchXMaterial(RELATION_CONFIG.getString("materials." + name().toLowerCase(), "STAINED_CLAY")).parseMaterial(); Material material = XMaterial.matchXMaterial(RELATION_CONFIG.getString("materials." + name().toLowerCase(), "STAINED_CLAY")).get().parseMaterial();
if (material == null) { if (material == null) {
return null; return null;
} }

View File

@ -72,7 +72,7 @@ public class FactionWarpsFrame {
private ItemStack buildWarpAsset(final Map.Entry<String, LazyLocation> warp, final Faction faction) { private ItemStack buildWarpAsset(final Map.Entry<String, LazyLocation> warp, final Faction faction) {
final ConfigurationSection config = this.section.getConfigurationSection("warp-item"); final ConfigurationSection config = this.section.getConfigurationSection("warp-item");
final ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem(); final ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
final ItemMeta meta = item.getItemMeta(); final ItemMeta meta = item.getItemMeta();
meta.setLore(FactionsPlugin.getInstance().colorList(FactionsPlugin.getInstance().replacePlaceholders(config.getStringList("Lore"), new Placeholder("{warp-protected}", faction.hasWarpPassword(warp.getKey()) ? "Enabled" : "Disabled"), new Placeholder("{warp-cost}", FactionsPlugin.getInstance().getConfig().getBoolean("warp-cost.enabled", false) ? Integer.toString(FactionsPlugin.getInstance().getConfig().getInt("warp-cost.warp", 5)) : "Disabled")))); meta.setLore(FactionsPlugin.getInstance().colorList(FactionsPlugin.getInstance().replacePlaceholders(config.getStringList("Lore"), new Placeholder("{warp-protected}", faction.hasWarpPassword(warp.getKey()) ? "Enabled" : "Disabled"), new Placeholder("{warp-cost}", FactionsPlugin.getInstance().getConfig().getBoolean("warp-cost.enabled", false) ? Integer.toString(FactionsPlugin.getInstance().getConfig().getInt("warp-cost.warp", 5)) : "Disabled"))));
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name").replace("{warp}", warp.getKey()))); meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name").replace("{warp}", warp.getKey())));
@ -82,7 +82,7 @@ public class FactionWarpsFrame {
private ItemStack buildDummyItem() { private ItemStack buildDummyItem() {
final ConfigurationSection config = this.section.getConfigurationSection("dummy-item"); final ConfigurationSection config = this.section.getConfigurationSection("dummy-item");
final ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem(); final ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
final ItemMeta meta = item.getItemMeta(); final ItemMeta meta = item.getItemMeta();
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore"))); meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name"))); meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));

File diff suppressed because it is too large Load Diff

View File

@ -61,7 +61,7 @@ public class FDisbandFrame {
private ItemStack buildConfirmDummyItem(Faction faction) { private ItemStack buildConfirmDummyItem(Faction faction) {
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("f-disband-gui.confirm-item"); ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("f-disband-gui.confirm-item");
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem(); ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
if (meta != null) { if (meta != null) {
List<String> lore = new ArrayList<>(); List<String> lore = new ArrayList<>();
@ -77,7 +77,7 @@ public class FDisbandFrame {
private ItemStack buildDenyDummyItem() { private ItemStack buildDenyDummyItem() {
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("f-disband-gui.deny-item"); ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("f-disband-gui.deny-item");
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem(); ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
if (meta != null) { if (meta != null) {
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore"))); meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));

View File

@ -104,7 +104,7 @@ public enum PermissableAction {
public ItemStack buildAsset(FPlayer fme, Permissable perm) { public ItemStack buildAsset(FPlayer fme, Permissable perm) {
ConfigurationSection section = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.action"); ConfigurationSection section = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.action");
ItemStack item = XMaterial.matchXMaterial(section.getString("Materials." + this.name)).parseItem(); ItemStack item = XMaterial.matchXMaterial(section.getString("Materials." + this.name)).get().parseItem();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
meta.setDisplayName(FactionsPlugin.getInstance().color(section.getString("placeholder-item.name").replace("{action}", this.name))); meta.setDisplayName(FactionsPlugin.getInstance().color(section.getString("placeholder-item.name").replace("{action}", this.name)));

View File

@ -91,7 +91,7 @@ public class PermissableActionFrame {
private ItemStack buildDummyItem() { private ItemStack buildDummyItem() {
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.dummy-item"); ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.dummy-item");
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem(); ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore"))); meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name"))); meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));
@ -101,7 +101,7 @@ public class PermissableActionFrame {
private ItemStack buildBackItem() { private ItemStack buildBackItem() {
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.back-item"); ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.back-item");
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem(); ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore"))); meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name"))); meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));

View File

@ -56,7 +56,7 @@ public class PermissableRelationFrame {
} }
private ItemStack buildAsset(String loc, String relation) { private ItemStack buildAsset(String loc, String relation) {
ItemStack item = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString(loc)).parseItem(); ItemStack item = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString(loc)).get().parseItem();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
meta.setDisplayName(FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fperm-gui.relation.Placeholder-Item.Name").replace("{relation}", relation))); meta.setDisplayName(FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fperm-gui.relation.Placeholder-Item.Name").replace("{relation}", relation)));
item.setItemMeta(meta); item.setItemMeta(meta);
@ -65,7 +65,7 @@ public class PermissableRelationFrame {
private ItemStack buildDummyItem() { private ItemStack buildDummyItem() {
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.dummy-item"); ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.dummy-item");
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem(); ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore"))); meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name"))); meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));

View File

@ -101,7 +101,7 @@ public class FUpgradeFrame {
private ItemStack buildDummyItem() { private ItemStack buildDummyItem() {
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fupgrades.MainMenu.DummyItem"); ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fupgrades.MainMenu.DummyItem");
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem(); ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
if (meta != null) { if (meta != null) {
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore"))); meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));

View File

@ -58,7 +58,7 @@ public enum UpgradeType {
public ItemStack buildAsset(Faction f) { public ItemStack buildAsset(Faction f) {
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fupgrades.MainMenu." + this.id + ".DisplayItem"); ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fupgrades.MainMenu." + this.id + ".DisplayItem");
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem(); ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
int level = f.getUpgrade(this); int level = f.getUpgrade(this);
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
if (meta != null) { if (meta != null) {