From 2971761a5e7fb5d118e8b82218a08679ea9302a1 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 9 Jun 2015 22:19:03 +1200 Subject: [PATCH 1/3] Game stop command: Move unregister of game listener after the gamestate has been changed --- .../src/nautilus/game/arcade/command/StopCommand.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StopCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StopCommand.java index 13fa1b5f5..2f09c66bf 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StopCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StopCommand.java @@ -22,8 +22,6 @@ public class StopCommand extends CommandBase if (Plugin.GetGame() == null) return; - HandlerList.unregisterAll(Plugin.GetGame()); - if (Plugin.GetGame().GetState() == GameState.End || Plugin.GetGame().GetState() == GameState.End) { caller.sendMessage("Game is already ending..."); @@ -38,6 +36,7 @@ public class StopCommand extends CommandBase Plugin.GetGame().SetState(GameState.End); } + HandlerList.unregisterAll(Plugin.GetGame()); Plugin.GetGame().Announce(C.cAqua + C.Bold + caller.getName() + " has stopped the game."); } From 37c6593753400db862a3da152af09dc9944d7142 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Wed, 10 Jun 2015 05:27:19 +1200 Subject: [PATCH 2/3] Hub: Fix rulebook --- .../src/mineplex/hub/HubManager.java | 194 +++++++++--------- 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index d48f77298..edf8669f6 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -202,131 +202,131 @@ public class HubManager extends MiniClientPlugin BookMeta meta = (BookMeta)_ruleBook.getItemMeta(); _serverName = getPlugin().getConfig().getString("serverstatus.name"); _serverName = _serverName.substring(0, Math.min(16, _serverName.length())); - - meta.addPage("§m-------------------§r\n" - + "Welcome to §6§lMineplex§r\n" - + "§r§0§l§r§m§0§m-------------------§r§0\n" + + meta.addPage("§m-------------------§r\n" + + "Welcome to §6§lMineplex§r\n" + + "§r§0§l§r§m§0§m-------------------§r§0\n" + "\n" - + "§2Please §0take a moment to read through this book!\n" + + "§2Please §0take a moment to read through this book!\n" + "\n" + "\n" + "Part 1 - Rules\n" + "\n" + "Part 2 - FAQ\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l1.§§§r §4No§r spamming.\n" + + meta.addPage("§m-------------------\n" + + "§r §2§lRules§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§l1.§§§r §4No§r spamming.\n" + "\n" - + "§0This is sending too many messages and/or repeating the same message in a short period of time.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l2.§m§r §4No§0 use of excessive caps.\n" + + "§0This is sending too many messages and/or repeating the same message in a short period of time.\n"); + + meta.addPage("§m-------------------\n" + + "§r §2§lRules§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§l2.§m§r §4No§0 use of excessive caps.\n" + "\n" + "This is sending messages with an excessive amount of capital letters.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l3.§r §4No§0 hacking or use of any unapproved mods.\n" + + meta.addPage("§m-------------------\n" + + "§r §2§lRules§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§l3.§r §4No§0 hacking or use of any unapproved mods.\n" + "\n" + "This means we do not tolerate any sort of hacked client or any unapproved mods, such as fly hacks.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l4.§r §4No§0 advertising non-Mineplex related links.\n" + + meta.addPage("§m-------------------\n" + + "§r §2§lRules§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§l4.§r §4No§0 advertising non-Mineplex related links.\n" + "\n" + "This is when a link is sent in chat which directs others to non-Mineplex related content.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l5.§r §4No§0 trolling or use of any exploits.\n" + + meta.addPage("§m-------------------\n" + + "§r §2§lRules§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§l5.§r §4No§0 trolling or use of any exploits.\n" + "\n" + "This means that abuse of bugs/glitches is not tolerated. You also may not do things such as teamkilling and/or blocking spawns.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§l6.§r §2Be§0 respectful to others, yourself, and the environment around you.\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lRules§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§rPlease report any bugs, exploits, and/or rule breakers on our forums with evidence.\n" - + "§omineplex.com/forums\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lFAQ§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§lWhat is stacker and how do you play it?\n" + + meta.addPage("§m-------------------\n" + + "§r §2§lRules§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§l6.§r §2Be§0 respectful to others, yourself, and the environment around you.\n"); + + meta.addPage("§m-------------------\n" + + "§r §2§lRules§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§rPlease report any bugs, exploits, and/or rule breakers on our forums with evidence.\n" + + "§omineplex.com/forums\n"); + + meta.addPage("§m-------------------\n" + + "§r §2§lFAQ§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§lWhat is stacker and how do you play it?\n" + "\n" - + "§rStacker is a hub game where you can stack & throw players/mobs.\n" + + "§rStacker is a hub game where you can stack & throw players/mobs.\n" + "\n" - + "§9Right-Click: pick up\n" + + "§9Right-Click: pick up\n" + "Left-Click: throw\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lFAQ§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§lHow do I get §bUltra§l, §5Hero§l, or §aLegend§l?\n" + + meta.addPage("§m-------------------\n" + + "§r §2§lFAQ§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§lHow do I get §bUltra§l, §5Hero§l, or §aLegend§l?\n" + "\n" - + "§r§0You are able to purchase these ranks through our shop on our website at:\n" + + "§r§0You are able to purchase these ranks through our shop on our website at:\n" + "\n" - + "§owww.mineplex.com/shop\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lFAQ§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§lWhy hasn't my rank been applied yet?\n" + + "§owww.mineplex.com/shop\n"); + + meta.addPage("§m-------------------\n" + + "§r §2§lFAQ§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§lWhy hasn't my rank been applied yet?\n" + "\n" - + "§m§rYour rank may take a while to be applied. If it has been over 24 hours please contact:\n" + + "§m§rYour rank may take a while to be applied. If it has been over 24 hours please contact:\n" + "\n" - + "§omineplex.com/support\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lFAQ§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§lWhat do I do if I was wrongfully punished?\n" + + "§omineplex.com/support\n"); + + meta.addPage("§m-------------------\n" + + "§r §2§lFAQ§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§lWhat do I do if I was wrongfully punished?\n" + "\n" - + "§0If you believe you were wrongfully punished, please submit an appeal at:\n" + + "§0If you believe you were wrongfully punished, please submit an appeal at:\n" + "\n" - + "§omineplex.com/appeals\n"); - - meta.addPage("§m-------------------\n" - + "§r §2§lFAQ§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "§lHow do I apply for Trainee?\n" + + "§omineplex.com/appeals\n"); + + meta.addPage("§m-------------------\n" + + "§r §2§lFAQ§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "§lHow do I apply for Trainee?\n" + "\n" - + "§rYou may only apply for Helper if you have §bUltra§0, §5Hero§0, or §aLegend§0.\n" + + "§rYou may only apply for Helper if you have §bUltra§0, §5Hero§0, or §aLegend§0.\n" + "Apply at:\n" - + "§omineplex.com/application\n"); - - meta.addPage("§m-------------------\n" - + "§r §6§lThank you for \n" - + " reading!§r§0\n" - + "§m-------------------\n" - + "§r\n" - + "Remember to visit our website §2mineplex.com§0 for important news & updates!\n" + + "§omineplex.com/application\n"); + + meta.addPage("§m-------------------\n" + + "§r §6§lThank you for \n" + + " reading!§r§0\n" + + "§m-------------------\n" + + "§r\n" + + "Remember to visit our website §2mineplex.com§0 for important news & updates!\n" + "\n" + "\n" - + " §c§lH§6§lA§a§lV§9§lE §c§lF§6§lU§a§lN§9§l!\n"); + + "§c§lH§6§lA§a§lV§9§lE §c§lF§6§lU§a§lN§9§l!\n"); // These are needed or 1.8 clients will not show book correctly meta.setTitle("Rule Book"); From 3f9010fb7a5ab061a842d8f0a4eaec1899333457 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 9 Jun 2015 13:21:15 -0500 Subject: [PATCH 3/3] Fix GameScore comparator --- Plugins/.idea/compiler.xml | 6 ++++-- .../src/nautilus/game/arcade/game/games/GameScore.java | 6 ++++-- .../src/nautilus/game/arcade/game/games/draw/Draw.java | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Plugins/.idea/compiler.xml b/Plugins/.idea/compiler.xml index c01fc77f0..ccd5607c1 100644 --- a/Plugins/.idea/compiler.xml +++ b/Plugins/.idea/compiler.xml @@ -2,6 +2,9 @@ - + \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/GameScore.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/GameScore.java index 42fb029ed..29847b966 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/GameScore.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/GameScore.java @@ -1,5 +1,7 @@ package nautilus.game.arcade.game.games; +import java.util.ArrayList; +import java.util.Collections; import java.util.Comparator; import org.bukkit.entity.Player; @@ -20,7 +22,7 @@ public class GameScore return Player; } - public static Comparator SCORE_COMPARATOR = new Comparator() + public static Comparator SCORE_DESC = new Comparator() { @Override public int compare(GameScore o1, GameScore o2) @@ -28,7 +30,7 @@ public class GameScore if (o1.Score == o2.Score) return 0; - return o1.Score > o2.Score ? 1 : -1; + return o1.Score > o2.Score ? -1 : 1; } }; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java index 893a8e566..309cd2b2f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java @@ -651,7 +651,7 @@ public class Draw extends SoloGame private void SortScores() { - Collections.sort(_ranks, GameScore.SCORE_COMPARATOR); + Collections.sort(_ranks, GameScore.SCORE_DESC); } @Override