diff --git a/src/main/java/land/battle/practice/Practice.java b/src/main/java/land/battle/practice/Practice.java index 17c44df..7ee5870 100644 --- a/src/main/java/land/battle/practice/Practice.java +++ b/src/main/java/land/battle/practice/Practice.java @@ -38,6 +38,7 @@ import land.battle.practice.shop.item.EffectShopItem; import land.battle.practice.shop.item.message.KillMessageItem; import land.battle.practice.shop.item.statreset.NameColorItem; import land.battle.practice.shop.item.statreset.StatisticResetItem; +import land.battle.practice.util.Animation; import land.battle.practice.util.CC; import land.battle.practice.util.timer.TimerManager; import land.battle.practice.util.timer.impl.EnderpearlTimer; @@ -104,7 +105,7 @@ public class Practice extends ExtendedJavaPlugin { this.registerCommands(); this.registerListeners(); this.registerManagers(); - + Animation.init(); pracConfig = factory.fromFile("settings", PracticeConfig.class); holanda = pracConfig.isHolanda(); // an alternative to bukkit's default entity hider system diff --git a/src/main/java/land/battle/practice/PracticeConstants.java b/src/main/java/land/battle/practice/PracticeConstants.java index 6510f4e..028a205 100644 --- a/src/main/java/land/battle/practice/PracticeConstants.java +++ b/src/main/java/land/battle/practice/PracticeConstants.java @@ -28,10 +28,10 @@ public class PracticeConstants { public static final Type STRING_INTEGER_MAP_TYPE = new TypeToken>(){}.getType(); public static final Type STRING_BOOLEAN_MAP_TYPE = new TypeToken>(){}.getType(); - public static final String PARTY_PREFIX = ChatColor.AQUA + ChatColor.BOLD.toString() + "Party " + ChatColor.GRAY + ChatColor.BOLD + "»" + " "; - public static final String KIT_PREFIX = ChatColor.AQUA + ChatColor.BOLD.toString() + "Kit " + ChatColor.GRAY + ChatColor.BOLD + "»" + " "; - public static final String ARENA_PREFIX = ChatColor.AQUA + ChatColor.BOLD.toString() + "Arena " + ChatColor.GRAY + ChatColor.BOLD + "»" + " "; - public static final String TOURNAMENT_PREFIX = ChatColor.AQUA + ChatColor.BOLD.toString() + "Tournament " + ChatColor.GRAY + ChatColor.BOLD + "»" + " "; + public static final String PARTY_PREFIX = ChatColor.GOLD + ChatColor.BOLD.toString() + "Party " + ChatColor.GRAY + ChatColor.BOLD + "»" + " "; + public static final String KIT_PREFIX = ChatColor.GOLD + ChatColor.BOLD.toString() + "Kit " + ChatColor.GRAY + ChatColor.BOLD + "»" + " "; + public static final String ARENA_PREFIX = ChatColor.GOLD + ChatColor.BOLD.toString() + "Arena " + ChatColor.GRAY + ChatColor.BOLD + "»" + " "; + public static final String TOURNAMENT_PREFIX = ChatColor.GOLD + ChatColor.BOLD.toString() + "Tournament " + ChatColor.GRAY + ChatColor.BOLD + "»" + " "; public static final String JEDIS_PRACTICE_SETTING_CATEGORY = "practice_settings"; public static final String JEDIS_DISCORD_REWARD_CATEGORY = "discord_rewards"; @@ -39,12 +39,12 @@ public class PracticeConstants { public static final int DEFAULT_ELO = 1000; public static final List CHANGELOG = Arrays.asList( - CC.GRAY + "Leaderboards " + CC.AQUA + "(/leaderboards)", - CC.GRAY + "Statistics " + CC.AQUA + "(/stats)", - CC.GRAY + "Guilds " + CC.AQUA + "(/guilds)", - CC.GRAY + "Friends " + CC.AQUA + "(/friends)", - CC.GRAY + "Win Streaks " + CC.AQUA + "(Top 10 win streaks viewable via /lb)", - CC.GRAY + "Ranked Divisions " + CC.AQUA + "(Learn more - discord.gg/nodebuff)" + CC.GRAY + "Leaderboards " + CC.GOLD + "(/leaderboards)", + CC.GRAY + "Statistics " + CC.GOLD + "(/stats)", + CC.GRAY + "Guilds " + CC.GOLD + "(/guilds)", + CC.GRAY + "Friends " + CC.GOLD + "(/friends)", + CC.GRAY + "Win Streaks " + CC.GOLD + "(Top 10 win streaks viewable via /lb)", + CC.GRAY + "Ranked Divisions " + CC.GOLD + "(Learn more - discord.gg/nodebuff)" ); public static final Map BOARD_ADAPTERS = new HashMap<>(); diff --git a/src/main/java/land/battle/practice/board/BoardAdapter.java b/src/main/java/land/battle/practice/board/BoardAdapter.java index d9e4672..6e1b33e 100644 --- a/src/main/java/land/battle/practice/board/BoardAdapter.java +++ b/src/main/java/land/battle/practice/board/BoardAdapter.java @@ -1,17 +1,24 @@ package land.battle.practice.board; +import com.solexgames.core.CorePlugin; +import com.solexgames.core.player.PotPlayer; import com.solexgames.core.util.Color; import land.battle.practice.Practice; import land.battle.practice.PracticeConstants; import land.battle.practice.party.Party; import land.battle.practice.player.PlayerData; import land.battle.practice.player.PlayerState; -import land.battle.practice.settings.item.SidebarOptionsItemState; +import land.battle.practice.util.Animation; import land.battle.practice.util.CC; import io.github.nosequel.scoreboard.element.ScoreboardElement; import io.github.nosequel.scoreboard.element.ScoreboardElementHandler; import org.bukkit.entity.Player; +/** + * @author BattleLand Team + * @since 8/14/2021 + */ + public class BoardAdapter implements ScoreboardElementHandler { @Override @@ -61,14 +68,15 @@ public class BoardAdapter implements ScoreboardElementHandler { switch (playerData.getOptions().getScoreboardStyle()) { case MODERN: element.add(""); - element.add(CC.GOLD + (Practice.getInstance().isHolanda() ? "wtap.gg" : "battle.land") + " " + CC.GRAY + " " + CC.GRAY + " "); + element.add(CC.GOLD + (Practice.getInstance().isHolanda() ? CC.translate(Animation.getScoreboardFooter()) : "battle.land") + " " + CC.GRAY + " " + CC.GRAY + " "); break; case OLD: element.add(""); - element.add(CC.GOLD + (Practice.getInstance().isHolanda() ? "wtap.gg" : "battle.land")); + element.add(CC.GOLD + (Practice.getInstance().isHolanda() ? CC.translate(Animation.getScoreboardFooter()) : "battle.land")); element.add(CC.SB_LINE); break; } + return element; } diff --git a/src/main/java/land/battle/practice/commands/PartyCommand.java b/src/main/java/land/battle/practice/commands/PartyCommand.java index 19a15e9..4c5a667 100644 --- a/src/main/java/land/battle/practice/commands/PartyCommand.java +++ b/src/main/java/land/battle/practice/commands/PartyCommand.java @@ -274,15 +274,15 @@ public class PartyCommand extends BaseCommand { } else { final List members = new ArrayList<>(party.getMembers()); final String[] information = new String[]{ - CC.GRAY + CC.STRIKE_THROUGH + "----------------------------------------------------", - CC.DARK_AQUA + CC.BOLD + "Party Information:", + "", + CC.GOLD + CC.BOLD + "Party Information:", "", CC.GRAY + "Members: " + members.stream() .map(this.plugin.getServer()::getPlayer) .map(player1 -> (player1.getUniqueId().equals(party.getLeader()) ? CC.GRAY + "*" : "") + player1.getDisplayName()) .collect(Collectors.joining(ChatColor.WHITE + ", ")), - CC.GRAY + "Status: " + CC.AQUA + (party.isOpen() ? CC.GREEN + "Public" : CC.PINK + "Private"), - CC.GRAY + CC.STRIKE_THROUGH + "----------------------------------------------------" + CC.GRAY + "Status: " + CC.GOLD + (party.isOpen() ? CC.GREEN + "Public" : CC.PINK + "Private"), + "" }; player.sendMessage(information); diff --git a/src/main/java/land/battle/practice/commands/administration/TournamentCommand.java b/src/main/java/land/battle/practice/commands/administration/TournamentCommand.java index 3fd7358..5cc3eed 100644 --- a/src/main/java/land/battle/practice/commands/administration/TournamentCommand.java +++ b/src/main/java/land/battle/practice/commands/administration/TournamentCommand.java @@ -25,7 +25,15 @@ public class TournamentCommand extends BaseCommand { @HelpCommand @Syntax("[page]") public void onHelp(CommandHelp help) { - help.showHelp(); + if (!help.getIssuer().isPlayer()) return; + help.getIssuer().sendMessage(""); + help.getIssuer().sendMessage(CC.GOLD + "/tournament alert " + CC.GRAY + ""); + help.getIssuer().sendMessage(CC.GOLD + "/tournament start " + CC.GRAY + " "); + help.getIssuer().sendMessage(CC.GOLD + "/tournament end " + CC.GRAY + ""); + help.getIssuer().sendMessage(CC.GOLD + "/tournament forcestart " + CC.GRAY + ""); + help.getIssuer().sendMessage(CC.GOLD + "/tournament leave"); + help.getIssuer().sendMessage(CC.GOLD + "/tournament join " + CC.GRAY + ""); + help.getIssuer().sendMessage(""); } @Subcommand("start|create") diff --git a/src/main/java/land/battle/practice/listeners/PlayerListener.java b/src/main/java/land/battle/practice/listeners/PlayerListener.java index 9c83229..8733cb0 100644 --- a/src/main/java/land/battle/practice/listeners/PlayerListener.java +++ b/src/main/java/land/battle/practice/listeners/PlayerListener.java @@ -26,6 +26,7 @@ import land.battle.practice.party.Party; import land.battle.practice.player.PlayerData; import land.battle.practice.player.PlayerState; import land.battle.practice.queue.QueueType; +import land.battle.practice.settings.PracticeSettingsMenu; import land.battle.practice.util.CC; import land.battle.practice.util.DeathUtils; import land.battle.practice.util.PlayerUtil; @@ -396,6 +397,9 @@ public class PlayerListener implements Listener { case PAINTING: new LeaderboardsMenu().openMenu(player); break; + case WATCH: + new PracticeSettingsMenu().openMenu(player); + break; case SKULL_ITEM: player.performCommand("party info"); break; diff --git a/src/main/java/land/battle/practice/managers/ItemManager.java b/src/main/java/land/battle/practice/managers/ItemManager.java index 4b38e8d..eaf6d3e 100644 --- a/src/main/java/land/battle/practice/managers/ItemManager.java +++ b/src/main/java/land/battle/practice/managers/ItemManager.java @@ -51,7 +51,7 @@ public class ItemManager { null, ItemUtil.createItem(Material.NETHER_STAR, CC.GOLD + "Create a Party" + CC.GRAY + " (Right Click)"), null, - null, + ItemUtil.createItem(Material.WATCH, CC.GOLD + "Settings" + CC.GRAY + " (Right Click)"), ItemUtil.createItem(Material.PAINTING, CC.GOLD + "Leaderboards" + CC.GRAY + " (Right Click)"), ItemUtil.createItem(Material.BOOK, CC.GOLD + "Kit Editor" + CC.GRAY + " (Right Click)") }; diff --git a/src/main/java/land/battle/practice/managers/PlayerManager.java b/src/main/java/land/battle/practice/managers/PlayerManager.java index 8b8e2df..d500daa 100644 --- a/src/main/java/land/battle/practice/managers/PlayerManager.java +++ b/src/main/java/land/battle/practice/managers/PlayerManager.java @@ -38,7 +38,7 @@ public class PlayerManager { private Arena lastArenaPlayed; private static final ItemStack REMATCH_ITEM = new ItemBuilder(Material.BLAZE_POWDER) - .setDisplayName(CC.AQUA + "Rematch " + CC.GRAY + "(Right Click)") + .setDisplayName(CC.GOLD + "Rematch " + CC.GRAY + "(Right Click)") .addLore( CC.GRAY + "Click to rematch your opponent." ) @@ -244,7 +244,7 @@ public class PlayerManager { } if (isRematching && !inParty && !inTournament) { - player.getInventory().setItem(4, PlayerManager.REMATCH_ITEM); + player.getInventory().setItem(2, PlayerManager.REMATCH_ITEM); } player.updateInventory(); diff --git a/src/main/java/land/battle/practice/managers/QueueManager.java b/src/main/java/land/battle/practice/managers/QueueManager.java index 3fa9785..94c33e3 100644 --- a/src/main/java/land/battle/practice/managers/QueueManager.java +++ b/src/main/java/land/battle/practice/managers/QueueManager.java @@ -63,7 +63,7 @@ public class QueueManager { this.giveQueueItems(player); - final String message = CC.YELLOW + "You've been added to the " + CC.AQUA + type.getName() + " " + kitName + CC.YELLOW + " queue." + (type.isRanked() ? CC.GRAY + " (" + elo + " elo)" : ""); + final String message = CC.WHITE + "You've been added to the " + CC.GOLD + type.getName() + " " + kitName + CC.WHITE + " queue." + (type.isRanked() ? CC.GRAY + " (" + elo + " elo)" : ""); player.sendMessage(message); this.playerQueueTime.put(player.getUniqueId(), System.currentTimeMillis()); diff --git a/src/main/java/land/battle/practice/menu/LeaderboardsMenu.java b/src/main/java/land/battle/practice/menu/LeaderboardsMenu.java index 480fcfe..7ed02aa 100644 --- a/src/main/java/land/battle/practice/menu/LeaderboardsMenu.java +++ b/src/main/java/land/battle/practice/menu/LeaderboardsMenu.java @@ -48,11 +48,15 @@ public class LeaderboardsMenu extends Menu { globalEloLore.addAll(LeaderboardUpdateRunnable.GLOBAL_ELO_LEADERBOARD_LORE); final RankedDivision rankedDivision = RankedDivision.getByGlobalElo(playerData.getGlobalElo()); - - if (rankedDivision != null) { + if (!Practice.getInstance().isHolanda()) { + if (rankedDivision != null) { + globalEloLore.add(" "); + globalEloLore.add(CC.GRAY + "Your current division is " + rankedDivision.getFancyName()); + globalEloLore.add(CC.GRAY + "and you have " + CC.WHITE + playerData.getGlobalElo() + CC.GRAY + " elo."); + } + } else { globalEloLore.add(" "); - globalEloLore.add(CC.GRAY + "Your current division is " + rankedDivision.getFancyName()); - globalEloLore.add(CC.GRAY + "and you have " + CC.WHITE + playerData.getGlobalElo() + CC.GRAY + " elo."); + globalEloLore.add(CC.GRAY + "You currently have " + CC.WHITE + playerData.getGlobalElo() + CC.GRAY + " elo."); } buttonMap.put(4, new ItemBuilder(Material.NETHER_STAR) diff --git a/src/main/java/land/battle/practice/menu/StatisticsMenu.java b/src/main/java/land/battle/practice/menu/StatisticsMenu.java index 3beadc1..8899ec4 100644 --- a/src/main/java/land/battle/practice/menu/StatisticsMenu.java +++ b/src/main/java/land/battle/practice/menu/StatisticsMenu.java @@ -41,9 +41,10 @@ public class StatisticsMenu extends Menu { globalStats.add(CC.GRAY + "ELO: " + CC.WHITE + playerData.getGlobalElo()); final RankedDivision rankedDivision = RankedDivision.getByGlobalElo(playerData.getGlobalElo()); - - if (rankedDivision != null) { - globalStats.add(CC.GRAY + "Division: " + CC.WHITE + rankedDivision.getFancyName()); + if (!Practice.getInstance().isHolanda()) { + if (rankedDivision != null) { + globalStats.add(CC.GRAY + "Division: " + CC.WHITE + rankedDivision.getFancyName()); + } } globalStats.add(" "); @@ -71,7 +72,7 @@ public class StatisticsMenu extends Menu { final String percentage = String.format("%.2f", (currentReality * 100.0f) / amountNeeded); - buttonMap.put(5, new ItemBuilder(Material.GLOWSTONE_DUST) + if (!Practice.getInstance().isHolanda()) buttonMap.put(5, new ItemBuilder(Material.GLOWSTONE_DUST) .setDisplayName(CC.AQUA + CC.BOLD + "Division Statistics") .addLore( CC.GRAY + "Current Division: " + CC.WHITE + rankedDivision.getFancyName(), diff --git a/src/main/java/land/battle/practice/menu/duel/DuelMenu.java b/src/main/java/land/battle/practice/menu/duel/DuelMenu.java index fa36fe8..576d71d 100644 --- a/src/main/java/land/battle/practice/menu/duel/DuelMenu.java +++ b/src/main/java/land/battle/practice/menu/duel/DuelMenu.java @@ -103,7 +103,7 @@ public class DuelMenu extends Menu { } buttonMap.put(48, new ItemBuilder(this.arenaSelecting ? Material.CHEST : Material.PAPER) - .setDisplayName(this.arenaSelecting ? CC.AQUA + CC.BOLD + "Kit Selection" : CC.AQUA + CC.BOLD + "Arena Selection") + .setDisplayName(this.arenaSelecting ? CC.GOLD + CC.BOLD + "Kit Selection" : CC.GOLD + CC.BOLD + "Arena Selection") .addLore( CC.GRAY + "Click to switch inventories." ) @@ -118,7 +118,7 @@ public class DuelMenu extends Menu { ); buttonMap.put(50, new ItemBuilder(Material.INK_SACK) - .setDisplayName(CC.AQUA + CC.BOLD + "Confirm Duel") + .setDisplayName(CC.GOLD + CC.BOLD + "Confirm Duel") .addLore( CC.GRAY + "Confirm your settings and send", CC.GRAY + "the duel to out.", diff --git a/src/main/java/land/battle/practice/runnable/RematchRunnable.java b/src/main/java/land/battle/practice/runnable/RematchRunnable.java index 2b398bb..1950d46 100644 --- a/src/main/java/land/battle/practice/runnable/RematchRunnable.java +++ b/src/main/java/land/battle/practice/runnable/RematchRunnable.java @@ -4,7 +4,10 @@ import land.battle.practice.Practice; import land.battle.practice.managers.ItemManager; import land.battle.practice.player.PlayerData; import land.battle.practice.player.PlayerState; +import land.battle.practice.util.CC; +import land.battle.practice.util.ItemUtil; import lombok.RequiredArgsConstructor; +import org.bukkit.Material; import org.bukkit.entity.Player; import java.util.UUID; @@ -23,7 +26,7 @@ public class RematchRunnable implements Runnable { final PlayerData playerData = this.plugin.getPlayerManager().getPlayerData(player.getUniqueId()); if (playerData != null && playerData.getPlayerState() == PlayerState.SPAWN && this.plugin.getMatchManager().isRematching(player.getUniqueId()) && this.plugin.getPartyManager().getParty(player.getUniqueId()) == null) { - player.getInventory().setItem(4, ItemManager.SHOP_ITEM); + player.getInventory().setItem(4, !Practice.getInstance().isHolanda() ? ItemManager.SHOP_ITEM : ItemUtil.createItem(Material.NETHER_STAR, CC.GOLD + "Create a Party" + CC.GRAY + " (Right Click)")); player.updateInventory(); playerData.setRematchID(-1); diff --git a/src/main/java/land/battle/practice/settings/PracticeSettingsImpl.java b/src/main/java/land/battle/practice/settings/PracticeSettingsImpl.java index 5a4ccce..6fd10b5 100644 --- a/src/main/java/land/battle/practice/settings/PracticeSettingsImpl.java +++ b/src/main/java/land/battle/practice/settings/PracticeSettingsImpl.java @@ -91,10 +91,10 @@ public class PracticeSettingsImpl implements ISettings { .toUpdatingButton((player1, clickType) -> { switch (data.getOptions().getScoreboardStyle()) { case OLD: - data.getOptions().setScoreboardStyle(SidebarOptionsItemState.OLD); + data.getOptions().setScoreboardStyle(SidebarOptionsItemState.MODERN); break; case MODERN: - data.getOptions().setScoreboardStyle(SidebarOptionsItemState.MODERN); + data.getOptions().setScoreboardStyle(SidebarOptionsItemState.OLD); break; } }) diff --git a/src/main/java/land/battle/practice/util/Animation.java b/src/main/java/land/battle/practice/util/Animation.java new file mode 100644 index 0000000..c5e0e85 --- /dev/null +++ b/src/main/java/land/battle/practice/util/Animation.java @@ -0,0 +1,29 @@ +package land.battle.practice.util; + +import land.battle.practice.Practice; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + + +public class Animation { + + public static String footer; + + public static void init() { + List footers = Arrays.asList(" &7wtap.gg", " &7discord.wtap.gg"); + + AtomicInteger atomicInteger = new AtomicInteger(); + + Practice.getInstance().getServer().getScheduler().runTaskTimerAsynchronously(Practice.getInstance(), () -> { + if (atomicInteger.get() == footers.size()) atomicInteger.set(0); + footer = footers.get(atomicInteger.getAndIncrement()); + }, 0L, (long) (5.0 * 20L)); + } + + public static String getScoreboardFooter() { + return footer; + } +} diff --git a/src/main/java/land/battle/practice/util/timer/impl/EnderpearlTimer.java b/src/main/java/land/battle/practice/util/timer/impl/EnderpearlTimer.java index 907f9b3..8887041 100644 --- a/src/main/java/land/battle/practice/util/timer/impl/EnderpearlTimer.java +++ b/src/main/java/land/battle/practice/util/timer/impl/EnderpearlTimer.java @@ -31,7 +31,7 @@ public class EnderpearlTimer extends PlayerTimer implements Listener { return; } - player.sendMessage(CC.GRAY + "Your enderpearl cooldown timer has expired."); + player.sendMessage(CC.GREEN + "Your enderpearl cooldown timer has expired."); } @EventHandler diff --git a/src/main/java/land/battle/practice/vote/VoteManager.java b/src/main/java/land/battle/practice/vote/VoteManager.java index 0966f62..eb24a76 100644 --- a/src/main/java/land/battle/practice/vote/VoteManager.java +++ b/src/main/java/land/battle/practice/vote/VoteManager.java @@ -31,9 +31,9 @@ public class VoteManager { public void sendVoteMessage(Player player, Arena arena) { ChatComponentBuilder builder = new ChatComponentBuilder(""); - builder.append(CC.AQUA + "Give us some feedback about "); + builder.append(CC.WHITE + "Give us some feedback about "); builder.append(CC.GOLD + arena.getName()); - builder.append(CC.PINK + " by clicking one of the stars: "); + builder.append(CC.WHITE + " by clicking one of the stars: "); Arrays.stream(Vote.values()).forEach(rating -> builder.append(rating.getDisplayName() + " ") .event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/rate " + rating.name()))