From b63843930f4d5394ff5312c22931114c6c450faf Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:08:42 -0400 Subject: [PATCH 1/9] Fixed bug https://trello.com/c/ZYS3Ddxw/134-hub-emerald-twirl-particles-are-called-green-ring-in-the-gui --- .../src/mineplex/core/gadget/gadgets/ParticleGreen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java index 9a370fad1..0489005a2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java @@ -21,7 +21,7 @@ public class ParticleGreen extends ParticleGadget public ParticleGreen(GadgetManager manager) { - super(manager, "Green Ring", new String[] + super(manager, "Emerald Twirl", new String[] { C.cWhite + "With these sparkles, you", C.cWhite + "can now sparkle while you", From 32a257fa55ce97d9b9f98fceb70fc78a0dafb05f Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:11:57 -0400 Subject: [PATCH 2/9] Fix bug https://trello.com/c/Jf7bht6V/138-general-tp-before-game-starts --- .../src/nautilus/game/arcade/managers/GameFlagManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index 97ebf6af2..34c55e670 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -947,7 +947,7 @@ public class GameFlagManager implements Listener Game game = Manager.GetGame(); if (game == null) return; - if (!game.IsLive()) + if (!(game.IsLive() || game.GetState() == GameState.Prepare)) return; if (!game.TeleportsDisqualify) From 24fed013ae9920a84e6a899ea144ec9998169d9b Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:39:04 -0400 Subject: [PATCH 3/9] Fixed previous ownership not being transferred --- .../src/mineplex/core/gadget/gadgets/ParticleGreen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java index 0489005a2..9a370fad1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java @@ -21,7 +21,7 @@ public class ParticleGreen extends ParticleGadget public ParticleGreen(GadgetManager manager) { - super(manager, "Emerald Twirl", new String[] + super(manager, "Green Ring", new String[] { C.cWhite + "With these sparkles, you", C.cWhite + "can now sparkle while you", From 5322e9d018189c9ea1ac7315c27f1379086b39b2 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:48:25 -0400 Subject: [PATCH 4/9] Marked the Bunny Morph to reflect its no longer available status --- .../src/mineplex/core/gadget/gadgets/MorphBunny.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java index 7d84e2457..78e502bc5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java @@ -59,8 +59,7 @@ public class MorphBunny extends MorphGadget " ", C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Hide Easter Egg uses 500 Coins" , " ", - C.cPurple + "Special Limited Time Morph", - C.cPurple + "Purchase at www.mineplex.com/shop", + C.cPurple + "No longer available", }, -1, Material.MONSTER_EGG, (byte)98); From cbb0d4521cb4d12dafca9a4cae901bb3838e5182 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:49:31 -0400 Subject: [PATCH 5/9] Made Legend cosmetics follow the same rules as all other premium rank cosmetics, as many staff were previously legend and lacked access to features they had paid for. --- .../src/mineplex/core/gadget/gadgets/MorphWither.java | 5 +---- Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java index da9d82ebd..7bd891dcb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java @@ -177,10 +177,7 @@ public class MorphWither extends MorphGadget @EventHandler public void legendOwner(PlayerJoinEvent event) { - if (Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.LEGEND || - Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.ADMIN || - Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.DEVELOPER || - Manager.getClientManager().Get(event.getPlayer()).GetRank() == Rank.OWNER) + if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.LEGEND)) { Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName()); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java index a95bcb150..0e70a0a22 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java @@ -146,7 +146,7 @@ public class PetManager extends MiniClientPlugin { Player p = event.getPlayer(); Rank rank = _clientManager.Get(p).GetRank(); - if (rank == Rank.LEGEND || rank == Rank.ADMIN || rank == Rank.DEVELOPER || rank == Rank.OWNER) + if (rank.has(Rank.LEGEND)) { _donationManager.Get(p.getName()).AddUnknownSalesPackagesOwned("Widder"); } From fe4586852c7537adb4fb5cf1ca7da3c460c4f2e9 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 15:59:53 -0400 Subject: [PATCH 6/9] Made rank unlock lore colored based on rank required for item (QA Requested) --- .../src/mineplex/core/cosmetic/ui/page/PetPage.java | 2 +- .../src/mineplex/core/gadget/gadgets/MorphPig.java | 2 +- .../src/mineplex/core/gadget/gadgets/MorphWither.java | 2 +- .../src/mineplex/core/gadget/gadgets/ParticleLegend.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java index 47d45cfa3..c9a544b93 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java @@ -75,7 +75,7 @@ public class PetPage extends ShopPageBase if (pet.GetPetType() == EntityType.WITHER) { itemLore.add(C.cBlack); - itemLore.add(ChatColor.RESET + C.cYellow + "Unlocked with Legend Rank"); + itemLore.add(ChatColor.RESET + C.cGreen + "Unlocked with Legend Rank"); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPig.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPig.java index f132e9e7a..44662f5a1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPig.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPig.java @@ -38,7 +38,7 @@ public class MorphPig extends MorphGadget C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Oink", C.cYellow + "Collide" + C.cGray + " to use " + C.cGreen + "Pig Bounce", " ", - C.cPurple + "Unlocked with Ultra Rank", + C.cAqua + "Unlocked with Ultra Rank", }, -1, Material.PORK, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java index 7bd891dcb..d7e4ba8dc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java @@ -47,7 +47,7 @@ public class MorphWither extends MorphGadget " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Wither Skull", " ", - C.cPurple + "Unlocked with Legend Rank", + C.cGreen + "Unlocked with Legend Rank", }, -1, Material.SKULL_ITEM, (byte)1); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java index 094c1ff39..7be1a9609 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java @@ -22,7 +22,7 @@ public class ParticleLegend extends ParticleGadget C.cWhite + "These mystic particle attach to", C.cWhite + "only the most legendary of players!", " ", - C.cPurple + "Unlocked with Legend Rank", + C.cGreen + "Unlocked with Legend Rank", }, -2, Material.ENDER_PORTAL, (byte)0); From 8a94602aefc1e4ea3490da434f14205f99ba1d8e Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Mon, 31 Aug 2015 16:03:27 -0400 Subject: [PATCH 7/9] Fixed bug https://trello.com/c/KBhgw0zK/115-hg-mismatching-achievement-text --- .../src/mineplex/core/achievement/Achievement.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index ab821003d..01925be94 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -56,7 +56,7 @@ public enum Achievement //Survival Games SURVIVAL_GAMES_WINS("Katniss Everdeen", 600, new String[]{"Survival Games.Wins"}, - new String[]{"Win 20 games of Survival Games"}, + new String[]{"Win 30 games of Survival Games"}, new int[]{30}, AchievementCategory.SURVIVAL_GAMES), From 8a9cc9ff14485d365857d60ac0a27c2f7633abe5 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Mon, 28 Sep 2015 20:42:14 -0400 Subject: [PATCH 8/9] Food Dupe Fix --- .../artifacts/Nautilus_Game_Arcade_jar.xml | 1 + .../mineplex/core/common/util/UtilItem.java | 20 +++++++++++++ .../src/mineplex/core/FoodDupeFix.java | 29 +++++++++++++++++++ .../src/nautilus/game/arcade/Arcade.java | 3 ++ 4 files changed, 53 insertions(+) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/FoodDupeFix.java diff --git a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml index ca2ed67aa..619cdf3df 100644 --- a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml +++ b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml @@ -19,6 +19,7 @@ + \ No newline at end of file diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilItem.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilItem.java index 1c874c58b..625edf4d1 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilItem.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilItem.java @@ -12,6 +12,10 @@ import org.bukkit.inventory.ItemStack; public class UtilItem { + private static final Material[] FOOD_LIST = { Material.APPLE, Material.BAKED_POTATO, Material.BREAD, Material.CARROT, Material.CARROT_ITEM, Material.COOKED_CHICKEN, + Material.COOKED_FISH, Material.GRILLED_PORK, Material.COOKIE, Material.GOLDEN_APPLE, Material.GOLDEN_CARROT, Material.MELON, Material.MUSHROOM_SOUP, Material.POISONOUS_POTATO, + Material.PUMPKIN_PIE, Material.RAW_BEEF, Material.RAW_CHICKEN, Material.RAW_FISH, Material.PORK, Material.ROTTEN_FLESH, Material.SPIDER_EYE, Material.COOKED_BEEF}; + public static LinkedList matchItem(Player caller, String items, boolean inform) { LinkedList matchList = new LinkedList(); @@ -136,4 +140,20 @@ public class UtilItem return item.getType() + ":" + item.getAmount() + ":" + item.getDurability() + ":" + data; } + + public static boolean isFood(ItemStack item) + { + return item == null ? false : isFood(item.getType()); + } + + public static boolean isFood(Material material) + { + for (Material food : FOOD_LIST) + { + if (food.equals(material)) + return true; + } + + return false; + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/FoodDupeFix.java b/Plugins/Mineplex.Core/src/mineplex/core/FoodDupeFix.java new file mode 100644 index 000000000..b17e76e8e --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/FoodDupeFix.java @@ -0,0 +1,29 @@ +package mineplex.core; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.player.PlayerItemConsumeEvent; +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.common.util.UtilItem; + +public class FoodDupeFix extends MiniPlugin +{ + public FoodDupeFix(JavaPlugin plugin) + { + super("Food Dupe Fix", plugin); + } + + // Use Highest priority so event.getItem isn't changed + @EventHandler(priority = EventPriority.HIGHEST) + public void fixFoodDupe(PlayerItemConsumeEvent event) + { + if (UtilItem.isFood(event.getItem())) + { + if (!event.getItem().equals(event.getPlayer().getItemInHand())) + { + event.setCancelled(true); + } + } + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java index d38023f34..71fa876f8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java @@ -4,6 +4,8 @@ import java.io.File; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.FoodDupeFix; import org.omg.CORBA._PolicyStub; import net.minecraft.server.v1_7_R4.BiomeBase; @@ -154,6 +156,7 @@ public class Arcade extends JavaPlugin new MemoryFix(this); new CustomTagFix(this, packetHandler); new TablistFix(this); + new FoodDupeFix(this); //Updates getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1); From 437e62c7db033aaba566932e3578ab71928c8fae Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Mon, 28 Sep 2015 20:44:57 -0400 Subject: [PATCH 9/9] Fix priority for dupe fix --- Plugins/Mineplex.Core/src/mineplex/core/FoodDupeFix.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/FoodDupeFix.java b/Plugins/Mineplex.Core/src/mineplex/core/FoodDupeFix.java index b17e76e8e..3b6aafa7c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/FoodDupeFix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/FoodDupeFix.java @@ -14,8 +14,8 @@ public class FoodDupeFix extends MiniPlugin super("Food Dupe Fix", plugin); } - // Use Highest priority so event.getItem isn't changed - @EventHandler(priority = EventPriority.HIGHEST) + // Use Lowest priority so we get called first event.getItem isn't changed + @EventHandler(priority = EventPriority.LOWEST) public void fixFoodDupe(PlayerItemConsumeEvent event) { if (UtilItem.isFood(event.getItem()))