allow fill gui item to be air

instead of printing error on stats failure, just print a warning
This commit is contained in:
okx-code
2018-08-30 23:39:09 +01:00
parent 0bf3dd2a06
commit 6ba4dcb4d0
4 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ plugins {
} }
group 'sh.okx' group 'sh.okx'
version '3.0-alpha.17' version '3.0-alpha.19'
sourceCompatibility = 1.8 sourceCompatibility = 1.8
+1 -1
View File
@@ -117,7 +117,7 @@ public class Rankup extends JavaPlugin {
try { try {
new Stats().init(this); new Stats().init(this);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); getLogger().warning("Could not connect to stats server");
} }
} }
} }
+4
View File
@@ -70,6 +70,10 @@ public class Gui implements InventoryHolder {
item = new ItemStack(material); item = new ItemStack(material);
} }
if(item.getType() == Material.AIR && section.getName().equalsIgnoreCase("fill")) {
return item;
}
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
if (section.contains("lore")) { if (section.contains("lore")) {
meta.setLore(Arrays.stream(format(section.getString("lore"), player, oldRank, rank).split("\n")) meta.setLore(Arrays.stream(format(section.getString("lore"), player, oldRank, rank).split("\n"))
+1 -1
View File
@@ -1,5 +1,5 @@
name: Rankup name: Rankup
version: 3.0-alpha.17 version: 3.0-alpha.19
main: sh.okx.rankup.Rankup main: sh.okx.rankup.Rankup
author: Okx author: Okx
depend: [Vault] depend: [Vault]