Don't show the kit items chance if all are 100%.
This commit is contained in:
parent
3680f9bfec
commit
d8bcb4b9a7
|
@ -126,7 +126,7 @@ public class Kit implements Cloneable {
|
|||
if ((!item.getSerialized().startsWith("/") && !item.getSerialized().startsWith(Settings.CURRENCY_SYMBOL.getString())) || commands) { //ToDO: I doubt this is correct.
|
||||
ItemStack stack = moveable ? item.getMoveableItem() : item.getItem();
|
||||
if (preview) {
|
||||
stack = item.getItemForDisplay();
|
||||
stack = item.getItemForDisplay(this);
|
||||
}
|
||||
if (stack == null) {
|
||||
continue;
|
||||
|
@ -243,6 +243,15 @@ public class Kit implements Cloneable {
|
|||
return this.name;
|
||||
}
|
||||
|
||||
public boolean all100Percent() {
|
||||
for (KitItem item : this.contents) {
|
||||
if (item.getChance() != 100) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack getDisplayItem() {
|
||||
return this.displayItem;
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ public class KitItem implements Cloneable {
|
|||
return compileOptions(item);
|
||||
}
|
||||
|
||||
public ItemStack getItemForDisplay() {
|
||||
public ItemStack getItemForDisplay(Kit kit) {
|
||||
if (this.content == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ public class KitItem implements Cloneable {
|
|||
meta.setLore(Collections.singletonList(ChatColor.translateAlternateColorCodes('&', this.displayLore)));
|
||||
}
|
||||
|
||||
if (UltimateKits.getInstance().getConfig().getBoolean("Main.Display Chance In Preview")) {
|
||||
if (UltimateKits.getInstance().getConfig().getBoolean("Main.Display Chance In Preview") && !kit.all100Percent()) {
|
||||
ArrayDeque<String> lore;
|
||||
if (meta.hasLore()) {
|
||||
lore = new ArrayDeque<>(meta.getLore());
|
||||
|
|
Loading…
Reference in New Issue