Clean up the Clans blacklist GUI

This commit is contained in:
AlexTheCoder 2017-07-14 06:49:47 -04:00
parent f00d9fbb54
commit 99c2522e92
2 changed files with 32 additions and 14 deletions

View File

@ -2,7 +2,6 @@ package mineplex.core.punish.clans;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.bukkit.Bukkit;

View File

@ -86,19 +86,38 @@ public class ClansBanPage extends ShopPageBase<ClansBanManager, ClansBanShop>
for (ClansBan ban : _victimClient._bans)
{
ItemStack item = new ItemBuilder(ban.isActive() ? Material.EMERALD_BLOCK : Material.REDSTONE_BLOCK)
.setTitle(ban.isActive() ? C.cGreenB + "Active" : C.cRedB + "Inactive")
.addLore(" ")
.addLore(C.cGray + "Date banned: " + C.cYellow + UtilTime.date(ban.getBanTime().getTime()))
.addLore(C.cGray + "Admin: " + C.cYellow + ban.getAdmin())
.addLore(C.cGray + "Time left: " + C.cYellow + (ban.isActive() ? ban.getBanTimeFormatted(false) : "None"))
.addLore(C.cGray + "Permanent: " + C.cYellow + (ban.isPermanent() ? "Yes" : "No"))
.addLore(C.cGray + "Reason: " + C.cYellow + ban.getReason(), 16)
.addLore(C.cGray + "Is Disabled: " + C.cYellow + (ban.isRemoved() ? "Yes" : "No"))
.addLore(ban.isActive() ? " " : null)
.addLore(ban.isActive() ? C.cDAqua + "Left-Click to disable ban" : null)
.setGlow(ban.isActive())
.build();
ItemStack item;
if (ban.isPermanent())
{
item = new ItemBuilder(ban.isActive() ? Material.EMERALD_BLOCK : Material.REDSTONE_BLOCK)
.setTitle(ban.isActive() ? C.cGreenB + "Active" : C.cRedB + "Inactive")
.addLore(" ")
.addLore(C.cGray + "Date Banned: " + C.cYellow + UtilTime.date(ban.getBanTime().getTime()))
.addLore(C.cGray + "Admin: " + C.cYellow + ban.getAdmin())
.addLore(C.cGray + "Permanent: " + C.cYellow + (ban.isPermanent() ? "Yes" : "No"))
.addLore(C.cGray + "Reason: " + C.cYellow + ban.getReason(), 16)
.addLore(C.cGray + "Disabled: " + C.cYellow + (ban.isRemoved() ? "Yes" : "No"))
.addLore(ban.isActive() ? " " : null)
.addLore(ban.isActive() ? C.cDAqua + "Left-Click to disable ban" : null)
.setGlow(ban.isActive())
.build();
}
else
{
item = new ItemBuilder(ban.isActive() ? Material.EMERALD_BLOCK : Material.REDSTONE_BLOCK)
.setTitle(ban.isActive() ? C.cGreenB + "Active" : C.cRedB + "Inactive")
.addLore(" ")
.addLore(C.cGray + "Date Banned: " + C.cYellow + UtilTime.date(ban.getBanTime().getTime()))
.addLore(C.cGray + "Admin: " + C.cYellow + ban.getAdmin())
.addLore(C.cGray + "Time Left: " + C.cYellow + (ban.isActive() ? ban.getBanTimeFormatted(false) : "None"))
.addLore(C.cGray + "Permanent: " + C.cYellow + (ban.isPermanent() ? "Yes" : "No"))
.addLore(C.cGray + "Reason: " + C.cYellow + ban.getReason(), 16)
.addLore(C.cGray + "Disabled: " + C.cYellow + (ban.isRemoved() ? "Yes" : "No"))
.addLore(ban.isActive() ? " " : null)
.addLore(ban.isActive() ? C.cDAqua + "Left-Click to disable ban" : null)
.setGlow(ban.isActive())
.build();
}
addButton(slot++, item, (player, click) ->
{