From 526ca42add4cebae8c10fa3ac3663753125b30aa Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Wed, 27 Aug 2014 12:48:24 -0700 Subject: [PATCH 1/2] Fixed Gem booster problem. FIxed stat problem. --- .../Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java | 2 +- .../src/nautilus/game/arcade/game/Game.java | 1 - .../src/nautilus/game/arcade/stats/StatTracker.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java index 7ce56efee..301278497 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java @@ -66,7 +66,7 @@ public class Menu extends ShopPageBase @Override public void ClickedLeft(Player player) { - if (Shop.getBoosterEnabled()) + if (Shop.getBoosterEnabled() && Plugin.getInventoryManager().Get(Player).getItemCount("Gem Booster") > 0) { ActivateGemBoosterEvent boosterEvent = new ActivateGemBoosterEvent(player); Bukkit.getServer().getPluginManager().callEvent(boosterEvent); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index b79839c7f..f99837be1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -1076,7 +1076,6 @@ public abstract class Game implements Listener Announce(F.elem(player.getName()) + " used a " + F.elem(C.cGreen + "Gem Booster") + " for " + F.elem("+" + (100-(GemBoosters.size()*25)) + "% Gems") + "!"); GemBoosters.add(player.getName()); - Manager.getInventoryManager().addItemToInventory(player, "Utility", "Gem Booster", -1); } public double GetGemBoostAmount() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/StatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/StatTracker.java index 1c7630a6c..35ee8b797 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/StatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/StatTracker.java @@ -27,6 +27,6 @@ public class StatTracker implements Listener public void addStat(Player player, String stat, int value, boolean limitTo1, boolean global) { if (canAddStats()) - addStat(player, stat, value, limitTo1, global); + getGame().AddStat(player, stat, value, limitTo1, global); } } From ec4cb91a1c26151de39865e5bd4feb37b0c6f144 Mon Sep 17 00:00:00 2001 From: Chiss Date: Thu, 28 Aug 2014 11:50:09 +1000 Subject: [PATCH 2/2] Poll changes Achievement output double space fix --- Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java | 2 +- .../Mineplex.Hub/src/mineplex/hub/poll/PollManager.java | 4 ++-- .../src/mineplex/hub/poll/command/PollCommand.java | 4 ++-- .../game/arcade/managers/GameAchievementManager.java | 7 ++++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java index 3742307ab..9b251ecb2 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java @@ -10,7 +10,7 @@ public class HubClient public String PurchaseString = " Purchase Ultra Rank at mineplex.com to unlock all game benefits!"; public int PurchaseIndex = 0; - + public String UltraString = " Thank you for your support!"; public int UltraIndex = 0; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java index e3d47524c..937497aec 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java @@ -119,7 +119,7 @@ public class PollManager extends MiniClientPlugin { String[] answers = poll.getAnswers(); - player.sendMessage(C.cGold + C.Bold + "-----------" + C.cYellow + C.Bold + "POLL" + C.cGold + C.Bold + "-----------"); + player.sendMessage(C.cGold + C.Bold + "--------------" + C.cYellow + C.Bold + "POLL" + C.cGold + C.Bold + "--------------"); player.sendMessage(poll.getQuestion()); player.sendMessage(""); for (int i = 1; i <= answers.length; i++) @@ -151,7 +151,7 @@ public class PollManager extends MiniClientPlugin } player.sendMessage(""); player.sendMessage("Click an answer to receive " + C.cGreen + poll.getCoinReward() + " Gems"); - player.sendMessage(C.cGold + C.Bold + "--------------------------"); + player.sendMessage(C.cGold + C.Bold + "--------------------------------"); player.playSound(player.getEyeLocation(), Sound.ORB_PICKUP, 2f, 0f); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/poll/command/PollCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/poll/command/PollCommand.java index 123c3af16..9d25b9c0f 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/poll/command/PollCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/poll/command/PollCommand.java @@ -102,7 +102,7 @@ public class PollCommand extends CommandBase UtilPlayer.message(caller, "Reward: " + C.cYellow + poll.getCoinReward()); UtilPlayer.message(caller, ""); - DecimalFormat decimalFormat = new DecimalFormat("#.##"); + DecimalFormat decimalFormat = new DecimalFormat("#.#"); double aPercent = stats.getAPercent(); double bPercent = stats.getBPercent(); double cPercent = stats.getCPercent(); @@ -123,7 +123,7 @@ public class PollCommand extends CommandBase percent = dPercent; UtilPlayer.message(caller, answer); - UtilPlayer.message(caller, getProgressBar(percent, 60) + " " + C.cWhite + "(" + C.cYellow + decimalFormat.format(percent) + "%" + C.cWhite + ")"); + UtilPlayer.message(caller, getProgressBar(percent, 60) + " " + C.cWhite + "(" + C.cYellow + decimalFormat.format(100d*percent) + "%" + C.cWhite + ")"); } } UtilPlayer.message(caller, " "); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameAchievementManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameAchievementManager.java index 19b7dd2a1..3ed17593e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameAchievementManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameAchievementManager.java @@ -82,7 +82,7 @@ public class GameAchievementManager implements Listener //Display for (final Achievement type : log.keySet()) { - UtilPlayer.message(player, ""); + AchievementData data = Manager.GetAchievement().get(player, type); @@ -100,6 +100,7 @@ public class GameAchievementManager implements Listener //Finishing for the first time if (!Manager.GetTaskManager().hasCompletedTask(player, type.getName())) { + UtilPlayer.message(player, ""); UtilPlayer.message(player, nameLevel + " " + F.elem(C.cAqua + C.Bold + "Completed!") + " " + F.elem(C.cGreen + C.Bold + "+" + type.getGemReward() + " Gems")); @@ -122,6 +123,7 @@ public class GameAchievementManager implements Listener //Multi-Level Achievements else if (log.get(type).LevelUp) { + UtilPlayer.message(player, ""); UtilPlayer.message(player, nameLevel + " " + progress + " " + F.elem(C.cAqua + C.Bold + "LEVEL UP!")); @@ -132,6 +134,7 @@ public class GameAchievementManager implements Listener //Single Level if (type.getMaxLevel() == 1) { + UtilPlayer.message(player, ""); UtilPlayer.message(player, nameLevel + " " + progress + " " + F.elem(ChatColor.YELLOW + "" + (data.getExpNextLevel() - data.getExpRemainder()) + " to Complete")); } @@ -140,12 +143,14 @@ public class GameAchievementManager implements Listener //Multi Level - Almost Finished if (data.getLevel() == type.getMaxLevel() - 1) { + UtilPlayer.message(player, ""); UtilPlayer.message(player, nameLevel + " " + progress + " " + F.elem(ChatColor.YELLOW + "" + (data.getExpNextLevel() - data.getExpRemainder()) + " to Complete")); } //Multi Level - Many levels to go else { + UtilPlayer.message(player, ""); UtilPlayer.message(player, nameLevel + " " + progress + " " + F.elem(ChatColor.YELLOW + "" + (data.getExpNextLevel() - data.getExpRemainder()) + " to Next Level")); }