Fix UI glitches with WarHub and Dye color updates

This commit is contained in:
Connor Monahan 2018-11-19 02:03:01 -06:00
parent db7a7864f9
commit 5e4f0022df
2 changed files with 17 additions and 15 deletions

View File

@ -26,12 +26,14 @@ public class JoinZoneUI extends ChestUI {
ChatColor.DARK_GRAY + "Warzone doors located here"));
item.setItemMeta(meta);
int i = 0;
this.addItem(inv, i++, item, new Runnable() {
@Override
public void run() {
player.teleport(War.war.getWarHub().getLocation());
}
});
if (War.war.getWarHub() != null) {
this.addItem(inv, i++, item, new Runnable() {
@Override
public void run() {
player.teleport(War.war.getWarHub().getLocation());
}
});
}
for (final Warzone zone : War.war.getEnabledWarzones()) {
item = new ItemStack(Material.ENDER_PEARL);
meta = item.getItemMeta();

View File

@ -41,7 +41,7 @@ public class UIConfigHelper {
}
if (option.getConfigType() == Boolean.class) {
status += config.resolveBoolean(option) ? ChatColor.GREEN + "true" : ChatColor.DARK_GRAY + "false";
item = new Dye(config.resolveBoolean(option) ? DyeColor.LIME : DyeColor.GRAY).toItemStack(1);
item = new ItemStack(config.resolveBoolean(option) ? Material.LIME_DYE : Material.GRAY_DYE, 1);
meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(new ImmutableList.Builder<String>().add(desc).add(status).add(inheritance).build());
@ -55,7 +55,7 @@ public class UIConfigHelper {
});
} else if (option.getConfigType() == Integer.class || option.getConfigType() == Double.class || option.getConfigType() == String.class) {
status += ChatColor.LIGHT_PURPLE + config.resolveValue(option).toString();
item = new Dye(DyeColor.PURPLE).toItemStack(1);
item = new ItemStack(Material.PURPLE_DYE, 1);
meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(new ImmutableList.Builder<String>().add(desc).add(status).add(inheritance).build());
@ -80,7 +80,7 @@ public class UIConfigHelper {
});
} else if (option.getConfigType() == FlagReturn.class) {
status += ChatColor.YELLOW + config.resolveValue(option).toString();
item = new Dye(DyeColor.PINK).toItemStack(1);
item = new ItemStack(Material.PINK_DYE, 1);
meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(new ImmutableList.Builder<String>().add(desc).add(status).add(inheritance).build());
@ -103,7 +103,7 @@ public class UIConfigHelper {
});
} else if (option.getConfigType() == TeamSpawnStyle.class) {
status += ChatColor.YELLOW + config.resolveValue(option).toString();
item = new Dye(DyeColor.PINK).toItemStack(1);
item = new ItemStack(Material.PINK_DYE, 1);
meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(new ImmutableList.Builder<String>().add(desc).add(status).add(inheritance).build());
@ -174,7 +174,7 @@ public class UIConfigHelper {
}
if (option.getConfigType() == Boolean.class) {
status += config.getBoolean(option) ? ChatColor.GREEN + "true" : ChatColor.DARK_GRAY + "false";
item = new Dye(config.getBoolean(option) ? DyeColor.LIME : DyeColor.GRAY).toItemStack(1);
item = new ItemStack(config.getBoolean(option) ? Material.LIME_DYE : Material.GRAY_DYE, 1);
meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(new ImmutableList.Builder<String>().add(desc).add(status).add(inheritance).build());
@ -188,7 +188,7 @@ public class UIConfigHelper {
});
} else if (option.getConfigType() == Integer.class || option.getConfigType() == Double.class || option.getConfigType() == String.class) {
status += ChatColor.LIGHT_PURPLE + config.getValue(option).toString();
item = new Dye(DyeColor.PURPLE).toItemStack(1);
item = new ItemStack(Material.PURPLE_DYE, 1);
meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(new ImmutableList.Builder<String>().add(desc).add(status).add(inheritance).build());
@ -213,7 +213,7 @@ public class UIConfigHelper {
});
} else if (option.getConfigType() == ScoreboardType.class) {
status += ChatColor.YELLOW + config.getValue(option).toString();
item = new Dye(DyeColor.PINK).toItemStack(1);
item = new ItemStack(Material.PINK_DYE, 1);
meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(new ImmutableList.Builder<String>().add(desc).add(status).add(inheritance).build());
@ -277,7 +277,7 @@ public class UIConfigHelper {
}
if (option.getConfigType() == Boolean.class) {
status += config.getBoolean(option) ? ChatColor.GREEN + "true" : ChatColor.DARK_GRAY + "false";
item = new Dye(config.getBoolean(option) ? DyeColor.LIME : DyeColor.GRAY).toItemStack(1);
item = new ItemStack(config.getBoolean(option) ? Material.LIME_DYE : Material.GRAY_DYE, 1);
meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(new ImmutableList.Builder<String>().add(desc).add(status).build());
@ -291,7 +291,7 @@ public class UIConfigHelper {
});
} else if (option.getConfigType() == Integer.class || option.getConfigType() == Double.class || option.getConfigType() == String.class) {
status += ChatColor.LIGHT_PURPLE + config.getValue(option).toString();
item = new Dye(DyeColor.PURPLE).toItemStack(1);
item = new ItemStack(Material.PURPLE_DYE, 1);
meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(new ImmutableList.Builder<String>().add(desc).add(status).build());