diff --git a/VotingPlugin/src/com/bencodez/votingplugin/VotingPluginMetrics.java b/VotingPlugin/src/com/bencodez/votingplugin/VotingPluginMetrics.java index 8c93d251a..f1315bbc7 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/VotingPluginMetrics.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/VotingPluginMetrics.java @@ -2,7 +2,7 @@ import java.util.concurrent.Callable; -import com.bencodez.advancedcore.api.metrics.BStatsMetrics; +import com.bencodez.simpleapi.metrics.BStatsMetrics; public class VotingPluginMetrics { diff --git a/VotingPlugin/src/com/bencodez/votingplugin/broadcast/BroadcastHandler.java b/VotingPlugin/src/com/bencodez/votingplugin/broadcast/BroadcastHandler.java index cb3eb26a5..ea99c1806 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/broadcast/BroadcastHandler.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/broadcast/BroadcastHandler.java @@ -12,6 +12,7 @@ import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.misc.MiscUtils; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; public class BroadcastHandler { @@ -30,8 +31,7 @@ public void check() { for (int i = 0; i < size; i++) { votedPlayers.poll(); } - String bc = StringParser.getInstance() - .colorize(plugin.getConfigFile().getFormatAlternateBroadcastBroadcast()); + String bc = MessageAPI.colorize(plugin.getConfigFile().getFormatAlternateBroadcastBroadcast()); String playersText = ""; while (!votedPlayers.isEmpty()) { playersText += votedPlayers.remove(); diff --git a/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java b/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java index f6a773d88..a8daf263c 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java @@ -34,7 +34,6 @@ import com.bencodez.advancedcore.api.misc.ArrayUtils; import com.bencodez.advancedcore.api.misc.encryption.EncryptionHandler; -import com.bencodez.advancedcore.api.misc.jsonparser.JsonParser; import com.bencodez.advancedcore.api.time.TimeType; import com.bencodez.advancedcore.api.user.usercache.value.DataValue; import com.bencodez.advancedcore.api.user.usercache.value.DataValueBoolean; @@ -51,6 +50,7 @@ import com.bencodez.advancedcore.bungeeapi.sockets.SocketHandler; import com.bencodez.advancedcore.bungeeapi.sockets.SocketReceiver; import com.bencodez.advancedcore.bungeeapi.time.BungeeTimeChecker; +import com.bencodez.simpleapi.json.JsonParser; import com.bencodez.votingplugin.bungee.global.multiproxy.MultiProxyHandler; import com.bencodez.votingplugin.bungee.global.multiproxy.MultiProxyMethod; import com.bencodez.votingplugin.bungee.global.multiproxy.MultiProxyServerSocketConfiguration; @@ -547,7 +547,7 @@ public void onDisable() { num++; } } - + voteCacheFile.save(); nonVotedPlayersCache.save(); if (mysql != null) { diff --git a/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java b/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java index f58da9789..08c6787fa 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java @@ -44,7 +44,6 @@ import com.bencodez.advancedcore.api.misc.ArrayUtils; import com.bencodez.advancedcore.api.misc.encryption.EncryptionHandler; -import com.bencodez.advancedcore.api.misc.jsonparser.JsonParser; import com.bencodez.advancedcore.api.time.TimeType; import com.bencodez.advancedcore.api.user.usercache.value.DataValue; import com.bencodez.advancedcore.api.user.usercache.value.DataValueBoolean; @@ -62,6 +61,7 @@ import com.bencodez.advancedcore.bungeeapi.sockets.SocketReceiver; import com.bencodez.advancedcore.bungeeapi.time.BungeeTimeChecker; import com.bencodez.advancedcore.bungeeapi.velocity.VelocityYMLFile; +import com.bencodez.simpleapi.json.JsonParser; import com.bencodez.votingplugin.bungee.BungeeMessageData; import com.bencodez.votingplugin.bungee.BungeeMethod; import com.bencodez.votingplugin.bungee.BungeeVersion; diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/CommandLoader.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/CommandLoader.java index 3289c9794..6b53d02db 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/CommandLoader.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/CommandLoader.java @@ -34,7 +34,7 @@ import com.bencodez.advancedcore.api.item.ItemBuilder; import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.misc.ArrayUtils; -import com.bencodez.advancedcore.api.misc.PlayerUtils; +import com.bencodez.advancedcore.api.misc.PlayerManager; import com.bencodez.advancedcore.api.rewards.RewardOptions; import com.bencodez.advancedcore.api.updater.Updater; import com.bencodez.advancedcore.api.user.UserStorage; @@ -46,6 +46,7 @@ import com.bencodez.advancedcore.api.yml.editor.ConfigEditor; import com.bencodez.advancedcore.api.yml.updater.ConfigUpdater; import com.bencodez.advancedcore.command.gui.UserGUI; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.commands.executers.CommandAliases; import com.bencodez.votingplugin.commands.gui.AdminGUI; @@ -102,27 +103,27 @@ public CommandLoader(VotingPluginMain plugin) { } public void processSlotClick(Player player, VotingPluginUser user, String slot) { - if (StringParser.getInstance().startsWithIgnoreCase(slot, "url")) { + if (MessageAPI.startsWithIgnoreCase(slot, "url")) { new VoteURL(plugin, player, user, true).open(); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "next")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "next")) { new VoteNext(plugin, player, user).open(GUIMethod.CHEST); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "last")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "last")) { new VoteLast(plugin, player, user).open(GUIMethod.CHEST); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "total")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "total")) { new VoteTotal(plugin, player, user).open(GUIMethod.CHEST); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "top")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "top")) { new VoteTopVoter(plugin, player, user, TopVoter.getDefault(), 1).open(GUIMethod.CHEST); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "today")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "today")) { new VoteToday(plugin, player, user, 1).open(GUIMethod.CHEST); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "help")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "help")) { player.performCommand("vote help"); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "shop")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "shop")) { new VoteShop(plugin, player, user).open(GUIMethod.CHEST); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "lastmonth")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "lastmonth")) { new VoteTopVoterLastMonth(plugin, player, user).open(GUIMethod.CHEST); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "best")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "best")) { new VoteBest(plugin, player, user).open(GUIMethod.CHEST); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "streak")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "streak")) { new VoteStreak(plugin, player, user).open(GUIMethod.CHEST); } } @@ -293,7 +294,7 @@ public void executeSinglePlayer(CommandSender sender, String[] args) { VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(args[1]); user.setPoints(Integer.parseInt(args[3])); sender.sendMessage( - StringParser.getInstance().colorize("&cSet " + args[1] + " points to " + args[3])); + MessageAPI.colorize("&cSet " + args[1] + " points to " + args[3])); } @Override @@ -301,7 +302,7 @@ public void executeAll(CommandSender sender, String[] args) { int num = Integer.parseInt(args[3]); sender.sendMessage( - StringParser.getInstance().colorize("&cSetting all players points to " + args[3])); + MessageAPI.colorize("&cSetting all players points to " + args[3])); for (String uuidStr : plugin.getUserManager().getAllUUIDs()) { UUID uuid = UUID.fromString(uuidStr); VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(uuid); @@ -311,7 +312,7 @@ public void executeAll(CommandSender sender, String[] args) { plugin.getBungeeSettings().isUseBungeecoord()); } sender.sendMessage( - StringParser.getInstance().colorize("&cDone setting all players points to " + args[3])); + MessageAPI.colorize("&cDone setting all players points to " + args[3])); } }); @@ -445,7 +446,7 @@ public void executeSinglePlayer(CommandSender sender, String[] args) { user.cache(); int newTotal = 0; newTotal = user.addPoints(Integer.parseInt(args[3])); - sender.sendMessage(StringParser.getInstance().colorize("&cGave " + args[1] + " " + args[3] + sender.sendMessage(MessageAPI.colorize("&cGave " + args[1] + " " + args[3] + " points" + ", " + args[1] + " now has " + newTotal + " points")); } } @@ -454,7 +455,7 @@ public void executeSinglePlayer(CommandSender sender, String[] args) { public void executeAll(CommandSender sender, String[] args) { int num = Integer.parseInt(args[3]); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cGiving " + "all players" + " " + args[3] + " points")); for (String uuidStr : plugin.getUserManager().getAllUUIDs()) { UUID uuid = UUID.fromString(uuidStr); @@ -464,7 +465,7 @@ public void executeAll(CommandSender sender, String[] args) { plugin.getSpecialRewards().checkMilestone(user, null, plugin.getBungeeSettings().isUseBungeecoord()); } - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cGave " + "all players" + " " + args[3] + " points")); } }); @@ -478,7 +479,7 @@ public void execute(CommandSender sender, String[] args) { VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(args[1]); user.cache(); user.removePoints(Integer.parseInt(args[3])); - sender.sendMessage(StringParser.getInstance().colorize("&cRemoved " + args[3] + " points from " + sender.sendMessage(MessageAPI.colorize("&cRemoved " + args[3] + " points from " + args[1] + ", " + args[1] + " now has " + user.getPoints() + " points")); } }); @@ -802,7 +803,7 @@ public void execute(CommandSender sender, String[] args) { @Override public void execute(CommandSender sender, String[] args) { sender.sendMessage(ChatColor.GREEN + "UUID of player " + ChatColor.DARK_GREEN + args[1] - + ChatColor.GREEN + " is: " + PlayerUtils.getInstance().getUUID(args[1])); + + ChatColor.GREEN + " is: " + PlayerManager.getInstance().getUUID(args[1])); } }); @@ -815,7 +816,7 @@ public void execute(CommandSender sender, String[] args) { try { sender.sendMessage(ChatColor.GREEN + "PlayerName of player " + ChatColor.DARK_GREEN + args[1] + ChatColor.GREEN + " is: " - + PlayerUtils.getInstance().getPlayerName( + + PlayerManager.getInstance().getPlayerName( plugin.getVotingPluginUserManager().getVotingPluginUser(UUID.fromString(args[1])), args[1])); } catch (IllegalArgumentException e) { @@ -832,7 +833,7 @@ public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { if (sender instanceof Player) { sender.sendMessage( - StringParser.getInstance().colorize("&cThis command can not be done from ingame")); + MessageAPI.colorize("&cThis command can not be done from ingame")); return; } @@ -841,7 +842,7 @@ public void execute(CommandSender sender, String[] args) { } plugin.getUserManager().getDataManager().clearCache(); plugin.setUpdate(true); - sender.sendMessage(StringParser.getInstance().colorize("&cCleared totals for everyone")); + sender.sendMessage(MessageAPI.colorize("&cCleared totals for everyone")); } }); @@ -852,14 +853,14 @@ public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { if (sender instanceof Player) { sender.sendMessage( - StringParser.getInstance().colorize("&cThis command can not be done from ingame")); + MessageAPI.colorize("&cThis command can not be done from ingame")); return; } plugin.getUserManager().removeAllKeyValues("OfflineVotes", DataType.STRING); plugin.getUserManager().removeAllKeyValues(plugin.getUserManager().getOfflineRewardsPath(), DataType.STRING); plugin.getUserManager().getDataManager().clearCache(); - sender.sendMessage(StringParser.getInstance().colorize("&cCleared offline votes/rewards")); + sender.sendMessage(MessageAPI.colorize("&cCleared offline votes/rewards")); } }); @@ -871,7 +872,7 @@ public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { plugin.getVotingPluginUserManager().getVotingPluginUser(args[1]) .setDayVoteStreak(Integer.parseInt(args[4])); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cSet votestreak day for '" + args[1] + "' to " + args[4])); } }); @@ -884,7 +885,7 @@ public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { plugin.getVotingPluginUserManager().getVotingPluginUser(args[1]) .setWeekVoteStreak(Integer.parseInt(args[4])); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cSet votestreak week for '" + args[1] + "' to " + args[4])); } }); @@ -897,7 +898,7 @@ public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { plugin.getVotingPluginUserManager().getVotingPluginUser(args[1]) .setMonthVoteStreak(Integer.parseInt(args[4])); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cSet votestreak month for '" + args[1] + "' to " + args[4])); } }); @@ -913,7 +914,7 @@ public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { plugin.getVotingPluginUserManager().getVotingPluginUser(args[1]).setTotal(top, Integer.parseInt(args[4])); - sender.sendMessage(StringParser.getInstance().colorize( + sender.sendMessage(MessageAPI.colorize( "&cSet " + top.toString() + " total for '" + args[1] + "' to " + args[4])); } }); @@ -928,7 +929,7 @@ public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(args[1]); user.setTotal(top, user.getTotal(top) + Integer.parseInt(args[4])); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cAdded " + top.toString() + " total for " + args[1])); } }); @@ -941,7 +942,7 @@ public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(args[1]); user.clearTotals(); - sender.sendMessage(StringParser.getInstance().colorize("&cCleared totals for '" + args[1] + "'")); + sender.sendMessage(MessageAPI.colorize("&cCleared totals for '" + args[1] + "'")); } }); @@ -956,7 +957,7 @@ public void execute(CommandSender sender, String[] args) { plugin.getCoolDownCheck().check(user); plugin.getCoolDownCheck().checkPerSite(user); sender.sendMessage( - StringParser.getInstance().colorize("&cVoted sites reset for '" + args[1] + "'")); + MessageAPI.colorize("&cVoted sites reset for '" + args[1] + "'")); } }); @@ -970,7 +971,7 @@ public void execute(CommandSender sender, String[] args) { VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(args[1]); user.resetLastVoted(plugin.getVoteSite(args[3], false)); plugin.getCoolDownCheck().checkPerSite(user); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cVoted site reset for '" + args[1] + "'" + " on " + args[3])); } }); @@ -987,7 +988,7 @@ public void executeSinglePlayer(CommandSender sender, String[] args) { plugin.getSpecialRewards().checkMilestone(user, null, plugin.getBungeeSettings().isUseBungeecoord()); sender.sendMessage( - StringParser.getInstance().colorize("&cAdded milestonecount for " + args[1])); + MessageAPI.colorize("&cAdded milestonecount for " + args[1])); } @Override @@ -995,7 +996,7 @@ public void executeAll(CommandSender sender, String[] args) { int toAdd = Integer.parseInt(args[3]); sender.sendMessage( - StringParser.getInstance().colorize("&cAdding milestonecount for all players...")); + MessageAPI.colorize("&cAdding milestonecount for all players...")); for (String uuidStr : plugin.getUserManager().getAllUUIDs()) { UUID uuid = UUID.fromString(uuidStr); VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(uuid); @@ -1004,7 +1005,7 @@ public void executeAll(CommandSender sender, String[] args) { plugin.getSpecialRewards().checkMilestone(user, null, plugin.getBungeeSettings().isUseBungeecoord()); } - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cFinished adding milestonecount for all players")); } }); @@ -1017,7 +1018,7 @@ public void executeAll(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(args[1]); user.setMilestoneCount(Integer.parseInt(args[3])); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cSet milestonecount for " + args[1] + " to " + args[3])); } }); @@ -1032,7 +1033,7 @@ public void executeSinglePlayer(CommandSender sender, String[] args) { VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(args[1]); user.setHasGottenMilestone(new HashMap()); sender.sendMessage( - StringParser.getInstance().colorize("&cClearing gotten milestones for " + args[1])); + MessageAPI.colorize("&cClearing gotten milestones for " + args[1])); } @Override @@ -1042,12 +1043,12 @@ public void executeAll(CommandSender sender, String[] args) { path = plugin.getBungeeSettings().getServerNameStorage() + "_" + "GottenMilestones"; } sender.sendMessage( - StringParser.getInstance().colorize("&cClearing gotten milestones for all players...")); + MessageAPI.colorize("&cClearing gotten milestones for all players...")); plugin.getUserManager().removeAllKeyValues(path, DataType.STRING); for (Player p : Bukkit.getOnlinePlayers()) { plugin.getUserManager().getDataManager().cacheUser(p.getUniqueId()); } - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cFinished clearing gotten milestones for all players")); } }); @@ -1234,10 +1235,10 @@ public void execute(CommandSender sender, String[] args) { @Override public void execute(CommandSender sender, String[] args) { - sender.sendMessage(StringParser.getInstance().colorize("&cCreating VoteSite..." + args[1])); + sender.sendMessage(MessageAPI.colorize("&cCreating VoteSite..." + args[1])); plugin.getConfigVoteSites().generateVoteSite(args[1]); - sender.sendMessage(StringParser.getInstance().colorize("&cCreated VoteSite: &c&l" + args[1])); + sender.sendMessage(MessageAPI.colorize("&cCreated VoteSite: &c&l" + args[1])); } }); @@ -1291,7 +1292,7 @@ public void execute(CommandSender sender, String[] args) { String voteSite = plugin.getVoteSiteName(true, args[1]); String serviceSite = args[3]; plugin.getConfigVoteSites().setServiceSite(voteSite, serviceSite); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cSet ServiceSite to &c&l" + serviceSite + "&c on &c&l" + voteSite)); } }); @@ -1315,7 +1316,7 @@ public void run() { } }, 5, TimeUnit.SECONDS); sender.sendMessage( - StringParser.getInstance().colorize("&cForce checking on vote cooldown rewards")); + MessageAPI.colorize("&cForce checking on vote cooldown rewards")); } }); @@ -1328,7 +1329,7 @@ public void execute(CommandSender sender, String[] args) { String voteSite = plugin.getVoteSiteName(true, args[1]); String url = args[3]; plugin.getConfigVoteSites().setVoteURL(voteSite, url); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cSet VoteURL to &c&l" + url + "&c on &c&l" + voteSite)); } }); @@ -1342,7 +1343,7 @@ public void execute(CommandSender sender, String[] args) { String voteSite = plugin.getVoteSiteName(true, args[1]); int value = Integer.parseInt(args[3]); plugin.getConfigVoteSites().setPriority(voteSite, value); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cSet priortiy to &c&l" + value + "&c on &c&l" + voteSite)); } @@ -1357,7 +1358,7 @@ public void execute(CommandSender sender, String[] args) { String voteSite = plugin.getVoteSiteName(true, args[1]); int delay = Integer.parseInt(args[3]); plugin.getConfigVoteSites().setVoteDelay(voteSite, delay); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cSet VoteDelay to &c&l" + delay + "&c on &c&l" + voteSite)); } @@ -1373,22 +1374,22 @@ public void execute(CommandSender sender, String[] args) { @Override public void run() { - sender.sendMessage(StringParser.getInstance().colorize("&cChecking for update...")); + sender.sendMessage(MessageAPI.colorize("&cChecking for update...")); plugin.setUpdater(new Updater(plugin, 15358, false)); final Updater.UpdateResult result = plugin.getUpdater().getResult(); switch (result) { case FAIL_SPIGOT: { - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cFailed to check for update for &c&l" + plugin.getName() + "&c!")); break; } case NO_UPDATE: { - sender.sendMessage(StringParser.getInstance().colorize("&c&l" + plugin.getName() + sender.sendMessage(MessageAPI.colorize("&c&l" + plugin.getName() + " &cis up to date! Version: &c&l" + plugin.getUpdater().getVersion())); break; } case UPDATE_AVAILABLE: { - sender.sendMessage(StringParser.getInstance().colorize( + sender.sendMessage(MessageAPI.colorize( "&c&l" + plugin.getName() + " &chas an update available! Your Version: &c&l" + plugin.getDescription().getVersion() + " &cNew Version: &c&l" + plugin.getUpdater().getVersion())); @@ -1414,7 +1415,7 @@ public void execute(CommandSender sender, String[] args) { boolean value = Boolean.parseBoolean(args[3]); plugin.getConfigVoteSites().setEnabled(voteSite, value); - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cSet votesite " + voteSite + " enabled to " + value)); } @@ -1427,23 +1428,23 @@ public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { String siteName = args[1]; if (!plugin.getConfigVoteSites().isServiceSiteGood(siteName)) { - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cServiceSite is invalid, votes may not work properly")); } else { String service = plugin.getConfigVoteSites().getServiceSite(siteName); if (plugin.getServerData().getServiceSites().contains(service)) { - sender.sendMessage(StringParser.getInstance().colorize("&aServiceSite is properly setup")); + sender.sendMessage(MessageAPI.colorize("&aServiceSite is properly setup")); } else { - sender.sendMessage(StringParser.getInstance() + sender.sendMessage(MessageAPI .colorize("&cService may not be valid, haven't recieved a vote from " + service + ", see /av servicesites")); } } if (!plugin.getConfigVoteSites().isVoteURLGood(siteName)) { - sender.sendMessage(StringParser.getInstance().colorize("&cVoteURL is invalid")); + sender.sendMessage(MessageAPI.colorize("&cVoteURL is invalid")); } else { - sender.sendMessage(StringParser.getInstance().colorize("&aVoteURL is properly setup")); + sender.sendMessage(MessageAPI.colorize("&aVoteURL is properly setup")); } } }); @@ -1455,7 +1456,7 @@ public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { plugin.setUpdate(true); plugin.update(); - sender.sendMessage(StringParser.getInstance().colorize("&cUpdating...")); + sender.sendMessage(MessageAPI.colorize("&cUpdating...")); } }); @@ -1466,7 +1467,7 @@ public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) { plugin.getUserManager().removeAllKeyValues("OfflineVotes", DataType.STRING); plugin.getUserManager().getDataManager().clearCache(); - sender.sendMessage(StringParser.getInstance().colorize("&cOffline votes Cleared")); + sender.sendMessage(MessageAPI.colorize("&cOffline votes Cleared")); } }); @@ -1978,7 +1979,7 @@ public void onClick(ClickEvent event) { String playerName = (String) event.getMeta(player, "Player"); BInventory inv = new BInventory("MileStones: " + playerName); for (String mileStoneName : plugin.getSpecialRewardsConfig().getMilestoneVotes()) { - if (StringParser.getInstance().isInt(mileStoneName)) { + if (MessageAPI.isInt(mileStoneName)) { int mileStone = Integer.parseInt(mileStoneName); inv.addButton(inv.getNextSlot(), @@ -1990,7 +1991,7 @@ public void onClick(ClickEvent event) { @Override public void onClick(ClickEvent clickEvent) { - if (StringParser.getInstance().isInt(clickEvent.getClickedItem() + if (MessageAPI.isInt(clickEvent.getClickedItem() .getItemMeta().getDisplayName())) { Player player = clickEvent.getPlayer(); int mileStone = Integer.parseInt(clickEvent.getClickedItem() @@ -2115,7 +2116,7 @@ public void execute(CommandSender sender, String[] args) { } else { try { user.setPrimaryAccount( - java.util.UUID.fromString(PlayerUtils.getInstance().getUUID(args[1]))); + java.util.UUID.fromString(PlayerManager.getInstance().getUUID(args[1]))); sendMessage(sender, "&cPrimary account set"); } catch (Exception e) { e.printStackTrace(); @@ -2182,7 +2183,7 @@ public void execute(CommandSender sender, String[] args) { @Override public void execute(CommandSender sender, String[] args) { if (!plugin.getGui().isChestVoteShopEnabled()) { - sender.sendMessage(StringParser.getInstance().colorize("&cVote shop disabled")); + sender.sendMessage(MessageAPI.colorize("&cVote shop disabled")); return; } @@ -2351,7 +2352,7 @@ public void execute(CommandSender sender, String[] args) { if (sender instanceof Player) { plugin.getVotingPluginUserManager().getVotingPluginUser((Player) sender).sendMessage(msg); } else { - sender.sendMessage(StringParser.getInstance().colorize(msg)); + sender.sendMessage(MessageAPI.colorize(msg)); } } else { sendMessage(sender, StringParser.getInstance() diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandAdminVote.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandAdminVote.java index cc805812d..0712453a7 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandAdminVote.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandAdminVote.java @@ -5,7 +5,7 @@ import org.bukkit.command.CommandSender; import com.bencodez.advancedcore.api.command.CommandHandler; -import com.bencodez.advancedcore.api.messages.StringParser; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; // TODO: Auto-generated Javadoc @@ -36,7 +36,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String } // invalid command - sender.sendMessage(StringParser.getInstance().colorize(plugin.getConfigFile().getFormatInvalidCommandAdminVote())); + sender.sendMessage(MessageAPI.colorize(plugin.getConfigFile().getFormatInvalidCommandAdminVote())); return true; } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandAliases.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandAliases.java index a571face5..f2ff5a85c 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandAliases.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandAliases.java @@ -7,8 +7,8 @@ import org.bukkit.command.CommandSender; import com.bencodez.advancedcore.api.command.CommandHandler; -import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.misc.ArrayUtils; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; // TODO: Auto-generated Javadoc @@ -92,10 +92,10 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String // invalid command if (adminCommand) { sender.sendMessage( - StringParser.getInstance().colorize(plugin.getConfigFile().getFormatInvalidCommandAdminVote())); + MessageAPI.colorize(plugin.getConfigFile().getFormatInvalidCommandAdminVote())); } else { sender.sendMessage( - StringParser.getInstance().colorize(plugin.getConfigFile().getFormatInvalidCommandVote())); + MessageAPI.colorize(plugin.getConfigFile().getFormatInvalidCommandVote())); } return true; } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandVote.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandVote.java index 961102bc9..c78e317fd 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandVote.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/executers/CommandVote.java @@ -5,7 +5,7 @@ import org.bukkit.command.CommandSender; import com.bencodez.advancedcore.api.command.CommandHandler; -import com.bencodez.advancedcore.api.messages.StringParser; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; // TODO: Auto-generated Javadoc @@ -61,7 +61,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String } // invalid command - sender.sendMessage(StringParser.getInstance().colorize(plugin.getConfigFile().getFormatInvalidCommandVote())); + sender.sendMessage(MessageAPI.colorize(plugin.getConfigFile().getFormatInvalidCommandVote())); return true; } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/AdminGUI.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/AdminGUI.java index 7e1f28442..5d7562203 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/AdminGUI.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/AdminGUI.java @@ -20,13 +20,13 @@ import com.bencodez.advancedcore.api.inventory.editgui.valuetypes.EditGUIValueString; import com.bencodez.advancedcore.api.item.ItemBuilder; import com.bencodez.advancedcore.api.misc.ArrayUtils; -import com.bencodez.advancedcore.api.misc.PlayerUtils; import com.bencodez.advancedcore.api.valuerequest.InputMethod; import com.bencodez.advancedcore.api.valuerequest.ValueRequest; import com.bencodez.advancedcore.api.valuerequest.ValueRequestBuilder; import com.bencodez.advancedcore.api.valuerequest.listeners.StringListener; import com.bencodez.advancedcore.api.yml.editor.ConfigEditor; import com.bencodez.advancedcore.command.gui.RewardEditGUI; +import com.bencodez.simpleapi.player.PlayerUtils; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.commands.gui.admin.AdminVoteVoteParty; import com.bencodez.votingplugin.commands.gui.admin.cumulative.AdminVoteCumulative; @@ -289,7 +289,7 @@ public void onClick(ClickEvent event) { @Override public void onInput(Player player, String value) { - Object ob = PlayerUtils.getInstance().getPlayerMeta(player, "VoteSite"); + Object ob = PlayerUtils.getPlayerMeta(plugin, player, "VoteSite"); if (ob != null) { VoteSite site = (VoteSite) ob; PlayerVoteEvent voteEvent = new PlayerVoteEvent(site, value, site.getServiceSite(), false); diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/AdminVoteHelp.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/AdminVoteHelp.java index 046223ce5..5b0bbef6d 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/AdminVoteHelp.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/AdminVoteHelp.java @@ -10,7 +10,7 @@ import com.bencodez.advancedcore.api.command.CommandHandler; import com.bencodez.advancedcore.api.gui.GUIHandler; import com.bencodez.advancedcore.api.gui.GUIMethod; -import com.bencodez.advancedcore.api.messages.StringParser; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import net.md_5.bungee.api.chat.TextComponent; @@ -43,9 +43,9 @@ public ArrayList adminHelp(CommandSender sender, int page) { maxPage++; } - msg.add(StringParser.getInstance().stringToComp("&6&lVotingPlugin Admin Help " + (page) + "/" + maxPage)); - msg.add(StringParser.getInstance().stringToComp("&6&l() = Needed")); - msg.add(StringParser.getInstance().stringToComp("&6&lAliases: adminvote, av")); + msg.add(MessageAPI.stringToComp("&6&lVotingPlugin Admin Help " + (page) + "/" + maxPage)); + msg.add(MessageAPI.stringToComp("&6&l() = Needed")); + msg.add(MessageAPI.stringToComp("&6&lAliases: adminvote, av")); for (int i = pagesize * (page - 1); (i < text.size()) && (i < ((page) * pagesize)); i++) { msg.add(text.get(i)); diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/cumulative/AdminVoteCumulative.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/cumulative/AdminVoteCumulative.java index f6234117a..bb5bbde1b 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/cumulative/AdminVoteCumulative.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/cumulative/AdminVoteCumulative.java @@ -12,12 +12,12 @@ import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent; import com.bencodez.advancedcore.api.inventory.BInventoryButton; import com.bencodez.advancedcore.api.item.ItemBuilder; -import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.valuerequest.InputMethod; import com.bencodez.advancedcore.api.valuerequest.ValueRequest; import com.bencodez.advancedcore.api.valuerequest.ValueRequestBuilder; import com.bencodez.advancedcore.api.valuerequest.listeners.NumberListener; import com.bencodez.advancedcore.command.gui.RewardEditGUI; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; public class AdminVoteCumulative extends GUIHandler { @@ -54,7 +54,7 @@ public void onChest(Player player) { public void onClick(ClickEvent clickEvent) { ArrayList nums = new ArrayList(); for (String num : plugin.getSpecialRewardsConfig().getCumulativeVotes()) { - if (StringParser.getInstance().isInt(num)) { + if (MessageAPI.isInt(num)) { nums.add(Integer.parseInt(num)); } } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/milestones/AdminVoteMilestones.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/milestones/AdminVoteMilestones.java index c71b3eeff..ade977d85 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/milestones/AdminVoteMilestones.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/admin/milestones/AdminVoteMilestones.java @@ -12,12 +12,12 @@ import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent; import com.bencodez.advancedcore.api.inventory.BInventoryButton; import com.bencodez.advancedcore.api.item.ItemBuilder; -import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.valuerequest.InputMethod; import com.bencodez.advancedcore.api.valuerequest.ValueRequest; import com.bencodez.advancedcore.api.valuerequest.ValueRequestBuilder; import com.bencodez.advancedcore.api.valuerequest.listeners.NumberListener; import com.bencodez.advancedcore.command.gui.RewardEditGUI; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; public class AdminVoteMilestones extends GUIHandler { @@ -54,7 +54,7 @@ public void onChest(Player player) { public void onClick(ClickEvent clickEvent) { ArrayList nums = new ArrayList(); for (String num : plugin.getSpecialRewardsConfig().getMilestoneVotes()) { - if (StringParser.getInstance().isInt(num)) { + if (MessageAPI.isInt(num)) { nums.add(Integer.parseInt(num)); } } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteGUI.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteGUI.java index f805df9a1..93d17a8f9 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteGUI.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteGUI.java @@ -12,10 +12,10 @@ import com.bencodez.advancedcore.api.inventory.BInventoryButton; import com.bencodez.advancedcore.api.inventory.UpdatingBInventoryButton; import com.bencodez.advancedcore.api.item.ItemBuilder; -import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.misc.ArrayUtils; import com.bencodez.advancedcore.api.rewards.RewardBuilder; import com.bencodez.advancedcore.api.rewards.RewardOptions; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.user.VotingPluginUser; @@ -43,15 +43,15 @@ private ItemBuilder getItemSlot(String slot, Player player) { String str = plugin.getConfigFile().getVoteTopDefault(); if (lore.length == 0) { - if (StringParser.getInstance().startsWithIgnoreCase(slot, "url")) { + if (MessageAPI.startsWithIgnoreCase(slot, "url")) { lore = new String[] { "&aClick me" }; - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "next")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "next")) { lore = ArrayUtils.getInstance().convert(new VoteNext(plugin, player, user).getChat(player)); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "last")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "last")) { lore = ArrayUtils.getInstance().convert(new VoteLast(plugin, player, user).getChat(player)); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "total")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "total")) { lore = ArrayUtils.getInstance().convert(new VoteTotal(plugin, player, user).getChat(player)); - } else if (StringParser.getInstance().startsWithIgnoreCase(slot, "top")) { + } else if (MessageAPI.startsWithIgnoreCase(slot, "top")) { if (str.equalsIgnoreCase("monthly")) { lore = plugin.getTopVoterHandler().topVoterMonthly(1); diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteHelp.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteHelp.java index 747917423..bb0f8c67e 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteHelp.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteHelp.java @@ -10,7 +10,7 @@ import com.bencodez.advancedcore.api.command.CommandHandler; import com.bencodez.advancedcore.api.gui.GUIHandler; import com.bencodez.advancedcore.api.gui.GUIMethod; -import com.bencodez.advancedcore.api.messages.StringParser; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.simpleapi.nms.NMSManager; import com.bencodez.votingplugin.VotingPluginMain; @@ -121,7 +121,7 @@ public ArrayList voteHelpText(CommandSender sender) { maxPage++; } - msg.add(StringParser.getInstance() + msg.add(MessageAPI .stringToComp(plugin.getConfigFile().getFormatCommandsVoteHelpTitle() + " " + page + "/" + maxPage)); for (int i = pagesize * (page - 1); (i < text.size()) && (i < ((page) * pagesize)); i++) { diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteNext.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteNext.java index dbeefb10f..f8f94d659 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteNext.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteNext.java @@ -11,12 +11,13 @@ import com.bencodez.advancedcore.api.gui.GUIHandler; import com.bencodez.advancedcore.api.gui.GUIMethod; import com.bencodez.advancedcore.api.inventory.BInventory; -import com.bencodez.advancedcore.api.inventory.BInventoryButton; import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent; +import com.bencodez.advancedcore.api.inventory.BInventoryButton; import com.bencodez.advancedcore.api.inventory.UpdatingBInventoryButton; import com.bencodez.advancedcore.api.item.ItemBuilder; import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.rewards.RewardBuilder; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.objects.VoteSite; import com.bencodez.votingplugin.user.VotingPluginUser; @@ -40,7 +41,7 @@ public ArrayList getChat(CommandSender sender) { String playerName = user.getPlayerName(); - msg.add(StringParser.getInstance().colorize(StringParser.getInstance() + msg.add(MessageAPI.colorize(StringParser.getInstance() .replaceIgnoreCase(plugin.getConfigFile().getFormatCommandsVoteNextTitle(), "%player%", playerName))); for (VoteSite voteSite : plugin.getVoteSitesEnabled()) { @@ -52,7 +53,7 @@ public ArrayList getChat(CommandSender sender) { msgLine = StringParser.getInstance().replaceIgnoreCase(msgLine, "%SiteName%", voteSite.getDisplayName()); - msg.add(StringParser.getInstance().colorize(msgLine)); + msg.add(MessageAPI.colorize(msgLine)); } } return msg; diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteShop.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteShop.java index 34a106288..9b2c73583 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteShop.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteShop.java @@ -15,6 +15,7 @@ import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.rewards.RewardBuilder; import com.bencodez.advancedcore.api.rewards.RewardOptions; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.user.VotingPluginUser; @@ -46,7 +47,7 @@ public void onChat(CommandSender sender) { @Override public void onChest(Player player) { if (!plugin.getGui().isChestVoteShopEnabled()) { - player.sendMessage(StringParser.getInstance().colorize(plugin.getGui().getChestVoteShopDisabled())); + player.sendMessage(MessageAPI.colorize(plugin.getGui().getChestVoteShopDisabled())); return; } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteShopConfirm.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteShopConfirm.java index 7bf48f1b7..966dbce35 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteShopConfirm.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/gui/player/VoteShopConfirm.java @@ -13,8 +13,8 @@ import com.bencodez.advancedcore.api.inventory.BInventoryButton; import com.bencodez.advancedcore.api.item.ItemBuilder; import com.bencodez.advancedcore.api.messages.StringParser; -import com.bencodez.advancedcore.api.misc.PlayerUtils; import com.bencodez.advancedcore.api.rewards.RewardOptions; +import com.bencodez.simpleapi.player.PlayerUtils; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.user.VotingPluginUser; @@ -46,7 +46,7 @@ public void onChat(CommandSender sender) { @Override public void onChest(Player player) { - PlayerUtils.getInstance().setPlayerMeta(player, "ident", identifier); + PlayerUtils.setPlayerMeta(plugin, player, "ident", identifier); BInventory inv = new BInventory(plugin.getGui().getChestShopConfirmPurchaseTitle()); inv.dontClose(); inv.addButton(new BInventoryButton(new ItemBuilder(plugin.getGui().getChestShopConfirmPurchaseYesItem())) { diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/AdminVoteTabCompleter.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/AdminVoteTabCompleter.java index c1b1e1ee1..3ba694f25 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/AdminVoteTabCompleter.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/AdminVoteTabCompleter.java @@ -11,7 +11,7 @@ import org.bukkit.command.TabCompleter; import com.bencodez.advancedcore.api.command.TabCompleteHandler; -import com.bencodez.advancedcore.api.messages.StringParser; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; /** @@ -40,7 +40,7 @@ public List onTabComplete(CommandSender sender, Command cmd, String alia args.length - 1)); for (String str : cmds) { - if (StringParser.getInstance().startsWithIgnoreCase(str, args[args.length - 1])) { + if (MessageAPI.startsWithIgnoreCase(str, args[args.length - 1])) { tab.add(str); } } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/AliasesTabCompleter.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/AliasesTabCompleter.java index 1caa147c2..0a99bffff 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/AliasesTabCompleter.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/AliasesTabCompleter.java @@ -13,8 +13,8 @@ import com.bencodez.advancedcore.api.command.CommandHandler; import com.bencodez.advancedcore.api.command.TabCompleteHandler; -import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.misc.ArrayUtils; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; /** @@ -88,7 +88,7 @@ public List onTabComplete(CommandSender sender, Command cmd, String alia } for (String str : cmds) { - if (StringParser.getInstance().startsWithIgnoreCase(str, args[args.length - 1])) { + if (MessageAPI.startsWithIgnoreCase(str, args[args.length - 1])) { tab.add(str); } } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/VoteTabCompleter.java b/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/VoteTabCompleter.java index 1e8baa6b4..e85d52e4b 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/VoteTabCompleter.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/commands/tabcompleter/VoteTabCompleter.java @@ -11,7 +11,7 @@ import org.bukkit.command.TabCompleter; import com.bencodez.advancedcore.api.command.TabCompleteHandler; -import com.bencodez.advancedcore.api.messages.StringParser; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; // TODO: Auto-generated Javadoc @@ -41,7 +41,7 @@ public List onTabComplete(CommandSender sender, Command cmd, String alia args.length - 1)); for (String str : cmds) { - if (StringParser.getInstance().startsWithIgnoreCase(str, args[args.length - 1])) { + if (MessageAPI.startsWithIgnoreCase(str, args[args.length - 1])) { tab.add(str); } } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/config/ConfigVoteSites.java b/VotingPlugin/src/com/bencodez/votingplugin/config/ConfigVoteSites.java index 9cbef5a01..5b9582ea6 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/config/ConfigVoteSites.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/config/ConfigVoteSites.java @@ -13,10 +13,10 @@ import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; -import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.misc.ArrayUtils; import com.bencodez.advancedcore.api.rewards.DirectlyDefinedReward; import com.bencodez.advancedcore.api.yml.YMLFile; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.objects.VoteSite; @@ -103,7 +103,7 @@ public void setData(String path, Object value) { for (Player p : Bukkit.getOnlinePlayers()) { if (p.hasPermission("VotingPlugin.Admin.GenerateServiceSite") || p.isOp()) { - p.sendMessage(StringParser.getInstance().colorize("&cGenerating votesite for service site " + p.sendMessage(MessageAPI.colorize("&cGenerating votesite for service site " + siteName + ", please check console for details")); } } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerInteract.java b/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerInteract.java index 0227e631f..4461505e4 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerInteract.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerInteract.java @@ -9,7 +9,8 @@ import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; -import com.bencodez.advancedcore.api.misc.PlayerUtils; +import com.bencodez.advancedcore.api.misc.PlayerManager; +import com.bencodez.simpleapi.player.PlayerUtils; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.signs.SignHandler; @@ -55,19 +56,19 @@ public void onPlayerInteract(PlayerInteractEvent event) { .sendMessage(sign.getRightClickMessage()); if (!sign.isSkullSet()) { - if (PlayerUtils.getInstance().hasServerPermission(event.getPlayer().getName(), + if (PlayerManager.getInstance().hasServerPermission(event.getPlayer().getName(), "VotingPlugin.Sign.Create") - || PlayerUtils.getInstance().hasServerPermission(event.getPlayer().getName(), + || PlayerManager.getInstance().hasServerPermission(event.getPlayer().getName(), "VotingPlugin.Admin")) { player.sendMessage("Skull not set, click to set skull"); - PlayerUtils.getInstance().setPlayerMeta(player, "skullset", sign.getSign()); + PlayerUtils.setPlayerMeta(plugin, player, "skullset", sign.getSign()); } } } } } else if (event.getClickedBlock().getState() instanceof Skull) { - Object ob = PlayerUtils.getInstance().getPlayerMeta(player, "skullset"); + Object ob = PlayerUtils.getPlayerMeta(plugin, player, "skullset"); if (ob != null) { String sign1 = (String) ob; for (SignHandler sign : plugin.getSigns().getSigns()) { @@ -78,7 +79,7 @@ public void onPlayerInteract(PlayerInteractEvent event) { player.sendMessage("Skull set"); } } - PlayerUtils.getInstance().setPlayerMeta(player, "skullset", null); + PlayerUtils.setPlayerMeta(plugin, player, "skullset", null); } } } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerVoteListener.java b/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerVoteListener.java index 5f9dd82ba..a51488c1c 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerVoteListener.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerVoteListener.java @@ -11,7 +11,7 @@ import org.bukkit.event.Listener; import com.bencodez.advancedcore.api.misc.ArrayUtils; -import com.bencodez.advancedcore.api.misc.PlayerUtils; +import com.bencodez.advancedcore.api.misc.PlayerManager; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.bungee.BungeeMethod; import com.bencodez.votingplugin.events.PlayerPostVoteEvent; @@ -50,7 +50,7 @@ public void onplayerVote(PlayerVoteEvent event) { } String playerName = event.getPlayer(); plugin.debug("Processing PlayerVoteEvent: " + playerName + "/" + event.getServiceSite()); - if (!PlayerUtils.getInstance().isValidUser(playerName, plugin.getConfigFile().isAllowUnJoinedCheckServer())) { + if (!PlayerManager.getInstance().isValidUser(playerName, plugin.getConfigFile().isAllowUnJoinedCheckServer())) { if (!plugin.getConfigFile().isAllowUnjoined()) { plugin.getLogger().warning("Player " + playerName + " has not joined before, disregarding vote, set AllowUnjoined to true to prevent this"); diff --git a/VotingPlugin/src/com/bencodez/votingplugin/listeners/SignChange.java b/VotingPlugin/src/com/bencodez/votingplugin/listeners/SignChange.java index adfa8c221..41380cc52 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/listeners/SignChange.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/listeners/SignChange.java @@ -4,8 +4,8 @@ import org.bukkit.event.Listener; import org.bukkit.event.block.SignChangeEvent; -import com.bencodez.advancedcore.api.messages.StringParser; -import com.bencodez.advancedcore.api.misc.PlayerUtils; +import com.bencodez.advancedcore.api.misc.PlayerManager; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; // TODO: Auto-generated Javadoc @@ -34,8 +34,8 @@ public SignChange(VotingPluginMain plugin) { @EventHandler(ignoreCancelled = true) public void onSignChange(SignChangeEvent event) { if (event.getLine(0).equalsIgnoreCase("[VotingPlugin]")) { - if (PlayerUtils.getInstance().hasServerPermission(event.getPlayer().getName(), "VotingPlugin.Sign.Create") - || PlayerUtils.getInstance().hasServerPermission(event.getPlayer().getName(), + if (PlayerManager.getInstance().hasServerPermission(event.getPlayer().getName(), "VotingPlugin.Sign.Create") + || PlayerManager.getInstance().hasServerPermission(event.getPlayer().getName(), "VotingPlugin.Admin")) { String data = event.getLine(2); if (!data.equalsIgnoreCase("all") && !data.equalsIgnoreCase("monthly") @@ -45,7 +45,7 @@ public void onSignChange(SignChangeEvent event) { try { plugin.getServerData().addSign(event.getBlock().getLocation(), event.getLine(2), Integer.parseInt(event.getLine(1))); - event.getPlayer().sendMessage(StringParser.getInstance().colorize("&aAdded sign!")); + event.getPlayer().sendMessage(MessageAPI.colorize("&aAdded sign!")); plugin.getBukkitScheduler().runTaskAsynchronously(plugin, new Runnable() { @Override @@ -55,12 +55,11 @@ public void run() { } }); } catch (Exception ex) { - event.getPlayer().sendMessage(StringParser.getInstance().colorize("&cError on sign creation!")); + event.getPlayer().sendMessage(MessageAPI.colorize("&cError on sign creation!")); ex.printStackTrace(); } } else { - event.getPlayer() - .sendMessage(StringParser.getInstance().colorize(plugin.getConfigFile().getFormatNoPerms())); + event.getPlayer().sendMessage(MessageAPI.colorize(plugin.getConfigFile().getFormatNoPerms())); } } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/objects/VoteSite.java b/VotingPlugin/src/com/bencodez/votingplugin/objects/VoteSite.java index 49e4e8765..85ade3724 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/objects/VoteSite.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/objects/VoteSite.java @@ -14,6 +14,7 @@ import com.bencodez.advancedcore.api.misc.ArrayUtils; import com.bencodez.advancedcore.api.misc.MiscUtils; import com.bencodez.advancedcore.api.rewards.RewardBuilder; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.bungee.BungeeMethod; import com.bencodez.votingplugin.user.VotingPluginUser; @@ -126,7 +127,7 @@ public void broadcastVote(VotingPluginUser user, boolean checkBungee) { } } else { - String bc = StringParser.getInstance().colorize(plugin.getConfigFile().getFormatBroadCastMsg()); + String bc = MessageAPI.colorize(plugin.getConfigFile().getFormatBroadCastMsg()); HashMap placeholders = new HashMap(); placeholders.put("player", playerName); placeholders.put("nickname", @@ -185,8 +186,8 @@ public String getVoteURL(boolean json) { } public String getVoteURLJsonStrip() { - String url = ChatColor.stripColor(StringParser.getInstance() - .colorize(StringParser.getInstance().parseJson(getVoteURL(false)).toPlainText())); + String url = ChatColor + .stripColor(MessageAPI.colorize(StringParser.getInstance().parseJson(getVoteURL(false)).toPlainText())); if (!url.startsWith("http")) { if (!url.startsWith("www.")) { url = "https://www." + url; diff --git a/VotingPlugin/src/com/bencodez/votingplugin/placeholders/PlaceHolders.java b/VotingPlugin/src/com/bencodez/votingplugin/placeholders/PlaceHolders.java index 2c0548ed8..8a596194a 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/placeholders/PlaceHolders.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/placeholders/PlaceHolders.java @@ -25,6 +25,7 @@ import com.bencodez.advancedcore.api.placeholder.PlaceHolder; import com.bencodez.advancedcore.api.user.AdvancedCoreUser; import com.bencodez.advancedcore.api.user.UserDataChanged; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.objects.VoteSite; import com.bencodez.votingplugin.topvoter.TopVoter; @@ -312,7 +313,7 @@ public String placeholderRequest(VotingPluginUser user, String identifier) { Set mVotes = plugin.getSpecialRewardsConfig().getMilestoneVotes(); for (String vote : mVotes) { - if (StringParser.getInstance().isInt(vote)) { + if (MessageAPI.isInt(vote)) { final int num = Integer.parseInt(vote); if (plugin.getSpecialRewardsConfig().getMilestoneRewardEnabled(num)) { @@ -600,7 +601,7 @@ public String placeholderRequest(String identifier) { @Override public String placeholderRequest(String identifier) { - if (!StringParser.getInstance().isInt(identifier.split("_")[2])) { + if (!MessageAPI.isInt(identifier.split("_")[2])) { return null; } int num = 1; @@ -651,7 +652,7 @@ public String placeholderRequest(VotingPluginUser user, String identifier) { @Override public String placeholderRequest(String identifier) { - if (!StringParser.getInstance().isInt(identifier.split("_")[2])) { + if (!MessageAPI.isInt(identifier.split("_")[2])) { return null; } int num = 1; @@ -688,7 +689,7 @@ public String placeholderRequest(String identifier) { @Override public String placeholderRequest(String identifier) { - if (!StringParser.getInstance().isInt(identifier.split("_")[2])) { + if (!MessageAPI.isInt(identifier.split("_")[2])) { return null; } int num = 1; @@ -739,7 +740,7 @@ public String placeholderRequest(VotingPluginUser user, String identifier) { @Override public String placeholderRequest(String identifier) { - if (!StringParser.getInstance().isInt(identifier.split("_")[2])) { + if (!MessageAPI.isInt(identifier.split("_")[2])) { return null; } int num = 1; @@ -790,7 +791,7 @@ public String placeholderRequest(VotingPluginUser user, String identifier) { @Override public String placeholderRequest(String identifier) { - if (!StringParser.getInstance().isInt(identifier.split("_")[2])) { + if (!MessageAPI.isInt(identifier.split("_")[2])) { return null; } int num = 1; diff --git a/VotingPlugin/src/com/bencodez/votingplugin/specialrewards/SpecialRewards.java b/VotingPlugin/src/com/bencodez/votingplugin/specialrewards/SpecialRewards.java index 2f8ee906a..1c2871f76 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/specialrewards/SpecialRewards.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/specialrewards/SpecialRewards.java @@ -7,9 +7,9 @@ import org.bukkit.Bukkit; -import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.rewards.RewardBuilder; import com.bencodez.advancedcore.api.rewards.RewardOptions; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.bungee.BungeeMessageData; import com.bencodez.votingplugin.events.PlayerSpecialRewardEvent; @@ -88,7 +88,7 @@ public boolean checkCumualativeVotes(VotingPluginUser user, BungeeMessageData bu boolean gotCumulativeAny = false; Set votes = plugin.getSpecialRewardsConfig().getCumulativeVotes(); for (String vote : votes) { - if (StringParser.getInstance().isInt(vote)) { + if (MessageAPI.isInt(vote)) { int votesRequired = Integer.parseInt(vote); if (votesRequired != 0) { if (plugin.getSpecialRewardsConfig().getCumulativeRewardEnabled(votesRequired) @@ -228,7 +228,7 @@ public boolean checkMilestone(VotingPluginUser user, BungeeMessageData bungeeMes boolean gotMilestone = false; Set votes = plugin.getSpecialRewardsConfig().getMilestoneVotes(); for (String vote : votes) { - if (StringParser.getInstance().isInt(vote)) { + if (MessageAPI.isInt(vote)) { int votesRequired = Integer.parseInt(vote); if (votesRequired != 0) { if (plugin.getSpecialRewardsConfig().getMilestoneRewardEnabled(votesRequired) @@ -266,7 +266,7 @@ public boolean checkVoteStreak(VotingPluginUser user, String type, boolean force } plugin.debug("Streak: " + streak + " multiple: " + multiple); - if (StringParser.getInstance().isInt(s)) { + if (MessageAPI.isInt(s)) { int streakRequired = Integer.parseInt(s); if (streakRequired != 0) { if (plugin.getSpecialRewardsConfig().getVoteStreakRewardEnabled(type, streak) diff --git a/VotingPlugin/src/com/bencodez/votingplugin/topvoter/TopVoterHandler.java b/VotingPlugin/src/com/bencodez/votingplugin/topvoter/TopVoterHandler.java index a362ab8e5..f1adbb5ea 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/topvoter/TopVoterHandler.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/topvoter/TopVoterHandler.java @@ -17,7 +17,6 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import com.bencodez.advancedcore.api.messages.StringParser; import com.bencodez.advancedcore.api.misc.ArrayUtils; import com.bencodez.advancedcore.api.time.TimeType; import com.bencodez.advancedcore.api.time.events.DateChangedEvent; @@ -29,6 +28,7 @@ import com.bencodez.advancedcore.api.user.userstorage.Column; import com.bencodez.advancedcore.api.user.userstorage.DataType; import com.bencodez.advancedcore.api.yml.YMLFileHandler; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.user.VotingPluginUser; @@ -597,7 +597,7 @@ public String[] topVoterAllTime(int page) { title = title.replace("%page%", "" + page); title = title.replace("%maxpages%", "" + pageSize); title = title.replace("%Top%", plugin.getConfigFile().getFormatTopVoterAllTime()); - msg.add(StringParser.getInstance().colorize(title)); + msg.add(MessageAPI.colorize(title)); for (int i = (page - 1) * pagesize; (i < topVoters.size()) && (i < (((page - 1) * pagesize) + 10)); i++) { msg.add(topVoters.get(i)); @@ -636,7 +636,7 @@ public String[] topVoterDaily(int page) { title = title.replace("%page%", "" + page); title = title.replace("%maxpages%", "" + pageSize); title = title.replace("%Top%", plugin.getConfigFile().getFormatTopVoterDaily()); - msg.add(StringParser.getInstance().colorize(title)); + msg.add(MessageAPI.colorize(title)); for (int i = (page - 1) * pagesize; (i < topVoters.size()) && (i < (((page - 1) * pagesize) + 10)); i++) { msg.add(topVoters.get(i)); @@ -675,7 +675,7 @@ public String[] topVoterMonthly(int page) { title = title.replace("%page%", "" + page); title = title.replace("%maxpages%", "" + pageSize); title = title.replace("%Top%", plugin.getConfigFile().getFormatTopVoterMonthly()); - msg.add(StringParser.getInstance().colorize(title)); + msg.add(MessageAPI.colorize(title)); for (int i = (page - 1) * pagesize; (i < topVoters.size()) && (i < (((page - 1) * pagesize) + 10)); i++) { msg.add(topVoters.get(i)); @@ -795,7 +795,7 @@ public String[] topVoterWeekly(int page) { title = title.replace("%page%", "" + page); title = title.replace("%maxpages%", "" + pageSize); title = title.replace("%Top%", plugin.getConfigFile().getFormatTopVoterWeekly()); - msg.add(StringParser.getInstance().colorize(title)); + msg.add(MessageAPI.colorize(title)); for (int i = (page - 1) * pagesize; (i < topVoters.size()) && (i < (((page - 1) * pagesize) + 10)); i++) { msg.add(topVoters.get(i)); diff --git a/VotingPlugin/src/com/bencodez/votingplugin/topvoter/TopVoterPlayer.java b/VotingPlugin/src/com/bencodez/votingplugin/topvoter/TopVoterPlayer.java index 487b2679e..15d6f2d31 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/topvoter/TopVoterPlayer.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/topvoter/TopVoterPlayer.java @@ -4,7 +4,7 @@ import org.bukkit.inventory.ItemStack; -import com.bencodez.advancedcore.api.misc.PlayerUtils; +import com.bencodez.advancedcore.api.misc.PlayerManager; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.user.VotingPluginUser; @@ -30,7 +30,7 @@ public TopVoterPlayer(UUID uuid, String playerName, Long lastVoteTime) { } public ItemStack getPlayerHead() { - return PlayerUtils.getInstance().getPlayerSkull(getPlayerName(), false); + return PlayerManager.getInstance().getPlayerSkull(getPlayerName(), false); } public VotingPluginUser getUser() { diff --git a/VotingPlugin/src/com/bencodez/votingplugin/user/VotingPluginUser.java b/VotingPlugin/src/com/bencodez/votingplugin/user/VotingPluginUser.java index c8bcef8ef..4446ea2b3 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/user/VotingPluginUser.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/user/VotingPluginUser.java @@ -26,6 +26,7 @@ import com.bencodez.advancedcore.api.user.AdvancedCoreUser; import com.bencodez.advancedcore.api.user.usercache.value.DataValue; import com.bencodez.advancedcore.api.user.usercache.value.DataValueInt; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.bungee.BungeeMessageData; import com.bencodez.votingplugin.bungee.BungeeMethod; @@ -796,7 +797,7 @@ public void offlineBroadcast(VotingPluginUser user, boolean checkBungee, int num } } else { - String bc = StringParser.getInstance().colorize(plugin.getConfigFile().getFormatOfflineBroadcast()); + String bc = MessageAPI.colorize(plugin.getConfigFile().getFormatOfflineBroadcast()); HashMap placeholders = new HashMap(); placeholders.put("player", playerName); placeholders.put("nickname", @@ -1040,7 +1041,7 @@ public int getNextAvailableMileStone() { int mileStoneCount = getMilestoneCount(); HashMap gottenMileStones = getHasGottenMilestone(); for (String vote : mVotes) { - if (StringParser.getInstance().isInt(vote)) { + if (MessageAPI.isInt(vote)) { final int num = Integer.parseInt(vote); if (plugin.getSpecialRewardsConfig().getMilestoneRewardEnabled(num)) { if (gottenMileStones.containsKey("" + num)) { diff --git a/VotingPlugin/src/com/bencodez/votingplugin/voteparty/VoteParty.java b/VotingPlugin/src/com/bencodez/votingplugin/voteparty/VoteParty.java index 6ca332271..6e45e067e 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/voteparty/VoteParty.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/voteparty/VoteParty.java @@ -21,6 +21,7 @@ import com.bencodez.advancedcore.api.time.events.MonthChangeEvent; import com.bencodez.advancedcore.api.time.events.WeekChangeEvent; import com.bencodez.advancedcore.api.user.userstorage.DataType; +import com.bencodez.simpleapi.messages.MessageAPI; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.events.VotePartyEvent; import com.bencodez.votingplugin.user.VotingPluginUser; @@ -123,7 +124,7 @@ public void commandVoteParty(CommandSender sender) { sender.sendMessage(ArrayUtils.getInstance().convert(msg)); } } else { - sender.sendMessage(StringParser.getInstance().colorize("&cVoteParty not enabled")); + sender.sendMessage(MessageAPI.colorize("&cVoteParty not enabled")); } } @@ -352,7 +353,7 @@ public void checkVoteReminder(VotingPluginUser user) { int neededVotes = getNeededVotes(); for (String str : plugin.getSpecialRewardsConfig().getVotePartyVoteReminderAtVotes()) { - if (StringParser.getInstance().isInt(str)) { + if (MessageAPI.isInt(str)) { int num = Integer.parseInt(str); if (neededVotes == num) { String broadcastMessage = plugin.getSpecialRewardsConfig().getVotePartyVoteReminderBroadcast();