From 2e016de9e5d8270542da9fab4a9f1b75998a6925 Mon Sep 17 00:00:00 2001 From: fooify Date: Mon, 24 Aug 2015 14:07:21 -0700 Subject: [PATCH 01/41] Fixed ignore command, now works --- .../Mineplex.Core/src/mineplex/core/ignore/command/Ignore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/ignore/command/Ignore.java b/Plugins/Mineplex.Core/src/mineplex/core/ignore/command/Ignore.java index 40c975cc6..48bf63e65 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/ignore/command/Ignore.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/ignore/command/Ignore.java @@ -17,7 +17,7 @@ public class Ignore extends CommandBase @Override public void Execute(final Player caller, final String[] args) { - if (args == null) + if (args == null || args.length < 1) { Plugin.showIgnores(caller); } From 1952ee7824191e38b194bbdcc95700be33a85d9d Mon Sep 17 00:00:00 2001 From: fooify Date: Tue, 25 Aug 2015 08:19:09 -0700 Subject: [PATCH 02/41] fix some strings mentioning "admin" in MPS --- .../game/arcade/gui/privateServer/page/GiveAdminPage.java | 6 +++--- .../game/arcade/gui/privateServer/page/RemoveAdminPage.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/GiveAdminPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/GiveAdminPage.java index 46dda25d4..251fb34fb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/GiveAdminPage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/GiveAdminPage.java @@ -11,7 +11,7 @@ public class GiveAdminPage extends PlayerPage { public GiveAdminPage(ArcadeManager plugin, PrivateServerShop shop, Player player) { - super(plugin, shop, "Give Admin", player); + super(plugin, shop, "Give Co-host", player); buildPage(); } @@ -26,12 +26,12 @@ public class GiveAdminPage extends PlayerPage { removeButton(slot); _manager.giveAdmin(player); - UtilPlayer.message(getPlayer(), F.main("Server", "You gave " + F.name(player.getName()) + " admin power.")); + UtilPlayer.message(getPlayer(), F.main("Server", "You gave " + F.name(player.getName()) + " Co-Host power.")); } @Override public String getDisplayString(Player player) { - return "Click to Make Admin"; + return "Click to Make Co-Host"; } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/RemoveAdminPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/RemoveAdminPage.java index f96f4198c..34730259e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/RemoveAdminPage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/RemoveAdminPage.java @@ -19,7 +19,7 @@ public class RemoveAdminPage extends BasePage { public RemoveAdminPage(ArcadeManager plugin, PrivateServerShop shop, Player player) { - super(plugin, shop, "Remove Admin", player); + super(plugin, shop, "Remove Co-Host", player); buildPage(); } @@ -36,7 +36,7 @@ public class RemoveAdminPage extends BasePage while (iterator.hasNext()) { String name = iterator.next(); - ItemStack head = getPlayerHead(name, C.cGreen + C.Bold + name, new String[] {ChatColor.RESET + C.cGray + "Click to Remove Admin"}); + ItemStack head = getPlayerHead(name, C.cGreen + C.Bold + name, new String[] {ChatColor.RESET + C.cGray + "Click to Remove Co-Host"}); addButton(slot, head, getRemoveAdminButton(slot, name)); slot++; @@ -52,7 +52,7 @@ public class RemoveAdminPage extends BasePage { _manager.removeAdmin(playerName); removeButton(slot); - UtilPlayer.message(getPlayer(), F.main("Server", "You removed admin power from " + F.name(playerName) + ".")); + UtilPlayer.message(getPlayer(), F.main("Server", "You removed Co-Host power from " + F.name(playerName) + ".")); } }; } From e9bc0d3a5f34080e7a82c466ac9e4499ffe6e44b Mon Sep 17 00:00:00 2001 From: fooify Date: Tue, 25 Aug 2015 08:23:22 -0700 Subject: [PATCH 03/41] capitalize h --- .../game/arcade/gui/privateServer/page/GiveAdminPage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/GiveAdminPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/GiveAdminPage.java index 251fb34fb..75e6cbfb2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/GiveAdminPage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/GiveAdminPage.java @@ -11,7 +11,7 @@ public class GiveAdminPage extends PlayerPage { public GiveAdminPage(ArcadeManager plugin, PrivateServerShop shop, Player player) { - super(plugin, shop, "Give Co-host", player); + super(plugin, shop, "Give Co-Host", player); buildPage(); } From f0e4416644b93b043ba4ea4edfd3d42c406762d0 Mon Sep 17 00:00:00 2001 From: fooify Date: Sun, 25 Oct 2015 10:52:56 -0700 Subject: [PATCH 04/41] Fixed tnt bug (SG) --- .../game/arcade/game/games/survivalgames/SurvivalGames.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java index a7699db24..edb48709e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java @@ -1911,6 +1911,9 @@ public abstract class SurvivalGames extends Game if (!UtilInv.IsItem(player.getItemInHand(), Material.TNT, (byte) 0)) return; + + if(!IsAlive(player)) + return; event.setCancelled(true); From 7024084ce398de2cffc4d3d30a945163073c0a83 Mon Sep 17 00:00:00 2001 From: fooify Date: Sun, 25 Oct 2015 11:29:06 -0700 Subject: [PATCH 05/41] Update achievement kit reference text --- .../src/mineplex/core/achievement/AchievementCategory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java index 6ce3d8025..85ed3540b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java @@ -105,7 +105,7 @@ public enum AchievementCategory ONE_IN_THE_QUIVER("One in the Quiver", null, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, - Material.BOW, 0, GameCategory.ARCADE, "Slam Shooter Kit"), + Material.BOW, 0, GameCategory.ARCADE, "Ninja Kit"), SUPER_PAINTBALL("Super Paintball", null, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, From cbe147d7057abdb7839e97c80195a23fccceae5d Mon Sep 17 00:00:00 2001 From: fooify Date: Sun, 25 Oct 2015 12:32:27 -0700 Subject: [PATCH 06/41] typo fix in legendary aura description --- .../src/mineplex/core/gadget/gadgets/ParticleLegend.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ac5c3aaa8..af5d32cfc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java @@ -21,7 +21,7 @@ public class ParticleLegend extends ParticleGadget { super(manager, "Legendary Aura", new String[] { - C.cWhite + "These mystic particle attach to", + C.cWhite + "This mystic particle attaches to", C.cWhite + "only the most legendary of players!", " ", C.cGreen + "Unlocked with Legend Rank", From ac4a276affc8ca2fea39c3efa90da42a332fc528 Mon Sep 17 00:00:00 2001 From: fooify Date: Wed, 11 Nov 2015 20:38:36 -0800 Subject: [PATCH 07/41] fixed bridge bug "Death Bomber counts suicides as well" --- .../nautilus/game/arcade/stats/DeathBomberStatTracker.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/DeathBomberStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/DeathBomberStatTracker.java index 9d4ac4865..90316be6e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/DeathBomberStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/DeathBomberStatTracker.java @@ -46,6 +46,11 @@ public class DeathBomberStatTracker extends StatTracker if (!event.GetLog().GetPlayer().IsPlayer()) return; + + Player killed = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName()); + + if(killer.equals(killed)) + return; if (event.GetLog().GetKiller() != null && event.GetLog().GetKiller().GetReason().contains("Throwing TNT")) { From a0c0f6b8911855db14e09f26e8492b4ad472a956 Mon Sep 17 00:00:00 2001 From: fooify Date: Thu, 12 Nov 2015 16:19:33 -0800 Subject: [PATCH 08/41] Slightly bumped Monster Maze jump time value --- .../game/games/monstermaze/MonsterMaze.java | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index 550c5a669..f5d9011b6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -225,7 +225,7 @@ public class MonsterMaze extends SoloGame p.playSound(p.getLocation(), Sound.CHICKEN_EGG_POP, 1.0f, 1.0f); - Recharge.Instance.useForce(p, "MM Player Jump", 750); + Recharge.Instance.useForce(p, "MM Player Jump", 900); //Find blocks below a player for (int i = 0 ; i < 3 ; i++) @@ -358,27 +358,6 @@ public class MonsterMaze extends SoloGame } } - private boolean _announced = false; - @EventHandler - public void sendF5Message(UpdateEvent event) - { - if (event.getType() != UpdateType.FASTEST) - return; - - if (GetState() != GameState.Prepare) - return; - - if (_announced) - return; - - if (!UtilTime.elapsed(GetStateTime(), 4000)) - return; - - _announced = true; - UtilTextMiddle.display(C.cYellow + C.Bold + "Press F5", C.cAqua + C.Bold + "Monster Maze is best in 3rd person!"); - Announce(C.cYellow + C.Scramble + "@@" + C.cAqua + C.Bold + " Monster Maze is best played in 3rd Person! (Push F5) " + C.cYellow + C.Scramble + "@@"); - } - @Override @EventHandler public void ScoreboardUpdate(UpdateEvent event) From f9f4c2addc50785f9cec94ba0436d0c2a6835c59 Mon Sep 17 00:00:00 2001 From: fooify Date: Fri, 13 Nov 2015 17:28:25 -0800 Subject: [PATCH 09/41] fixed several smash bugs and one global issue --- .../game/arcade/game/games/monstermaze/MonsterMaze.java | 2 +- .../nautilus/game/arcade/game/games/smash/kits/KitCreeper.java | 2 +- .../src/nautilus/game/arcade/kit/perks/PerkDoubleJump.java | 2 +- .../src/nautilus/game/arcade/kit/perks/PerkWitchPotion.java | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index f5d9011b6..1a7128081 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -225,7 +225,7 @@ public class MonsterMaze extends SoloGame p.playSound(p.getLocation(), Sound.CHICKEN_EGG_POP, 1.0f, 1.0f); - Recharge.Instance.useForce(p, "MM Player Jump", 900); + Recharge.Instance.useForce(p, "MM Player Jump", 750); //Find blocks below a player for (int i = 0 ; i < 3 ; i++) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitCreeper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitCreeper.java index b73d68ad3..444b0aaeb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitCreeper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitCreeper.java @@ -61,7 +61,7 @@ public class KitCreeper extends SmashKit })); player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE, (byte)0, 1, - C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Explosive Leap", + C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Explode", new String[] { ChatColor.RESET + "You freeze in location and charge up", diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDoubleJump.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDoubleJump.java index 018522154..a308fa524 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDoubleJump.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDoubleJump.java @@ -120,7 +120,7 @@ public class PerkDoubleJump extends Perk if (_recharge > 0 && !Recharge.Instance.usable(player, GetName())) continue; - if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN))) + if (player.isOnGround() || (UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)) && UtilBlock.solid(player.getLocation().getBlock()))) player.setAllowFlight(true); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitchPotion.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitchPotion.java index d6d70875b..7baa5eb0a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitchPotion.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitchPotion.java @@ -109,6 +109,8 @@ public class PerkWitchPotion extends SmashPerk Manager.GetDamage().NewDamageEvent(player, thrower, null, DamageCause.CUSTOM, 5, true, true, false, UtilEnt.getName((LivingEntity)event.getEntity().getShooter()), GetName()); + + Manager.GetCondition().Factory().Slow("Witch Potion", player, null, 3, 1, true, false, false, false); } //Super Effect else @@ -121,6 +123,7 @@ public class PerkWitchPotion extends SmashPerk DamageCause.CUSTOM, 5 + bonus, true, true, false, UtilEnt.getName((LivingEntity)event.getEntity().getShooter()), GetName()); + Manager.GetCondition().Factory().Slow("Witch Potion", player, null, 7, 2, true, false, false, false); //Manager.GetCondition().Factory().Confuse(reason, ent, source, duration, mult, extend, showIndicator, ambient) } } From 5767d4e2db2acd2d2bcff133ebf4e79bcc5cd207 Mon Sep 17 00:00:00 2001 From: fooify Date: Sat, 14 Nov 2015 16:08:14 -0800 Subject: [PATCH 10/41] SSM bug fix: magma cube flame dash doesn't make player invisible --- .../src/nautilus/game/arcade/kit/perks/PerkFlameDash.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameDash.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameDash.java index 041bae71c..94b7376bd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameDash.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameDash.java @@ -93,7 +93,8 @@ public class PerkFlameDash extends Perk _data.add(new FireflyData(player)); - Manager.GetCondition().Factory().Invisible(GetName(), player, player, 2.5, 0, false, false, true); + Manager.GetCondition().Factory().Cloak(GetName(), player, player, 2.5, false, false); + //Manager.GetCondition().Factory().Invisible(GetName(), player, player, 2.5, 0, false, false, true); UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + ".")); } From 4198e73120d0e694876ab19c6d50e35147ab75b8 Mon Sep 17 00:00:00 2001 From: fooify Date: Tue, 17 Nov 2015 16:05:49 -0800 Subject: [PATCH 11/41] Fixed SG Barbarian bug --- .../src/nautilus/game/arcade/kit/perks/PerkBladeVortex.java | 4 ++++ .../src/nautilus/game/arcade/kit/perks/PerkCleave.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBladeVortex.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBladeVortex.java index 66292d9d7..f07e50acb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBladeVortex.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBladeVortex.java @@ -53,6 +53,10 @@ public class PerkBladeVortex extends Perk if (!UtilGear.isWeapon(event.getPlayer().getItemInHand())) return; + + //Dont allow usage in early game + if (!UtilTime.elapsed(Manager.GetGame().GetStateTime(), 30000)) + return; final Player player = event.getPlayer(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCleave.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCleave.java index 0b38a3a0b..f64a380d8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCleave.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCleave.java @@ -40,7 +40,7 @@ public class PerkCleave extends Perk return; //Dont allow usage in early game - if (UtilTime.elapsed(Manager.GetGame().GetStateTime(), 30000)) + if (!UtilTime.elapsed(Manager.GetGame().GetStateTime(), 30000)) return; //Damager From 6d0879a175a01e4db56b6b4df85634e4f21832a3 Mon Sep 17 00:00:00 2001 From: fooify Date: Wed, 18 Nov 2015 17:31:28 -0800 Subject: [PATCH 12/41] Re-fixed Barbarian bug --- .../src/nautilus/game/arcade/kit/perks/PerkCleave.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCleave.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCleave.java index f64a380d8..0b38a3a0b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCleave.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCleave.java @@ -40,7 +40,7 @@ public class PerkCleave extends Perk return; //Dont allow usage in early game - if (!UtilTime.elapsed(Manager.GetGame().GetStateTime(), 30000)) + if (UtilTime.elapsed(Manager.GetGame().GetStateTime(), 30000)) return; //Damager From 205643028ed7316255b749b43a470e3b23876e28 Mon Sep 17 00:00:00 2001 From: fooify Date: Sat, 21 Nov 2015 11:00:51 -0800 Subject: [PATCH 13/41] fixed slab issue with Assassin's Flash --- .../classcombat/Skill/Assassin/Flash.java | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Flash.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Flash.java index dbad68ca0..6223c6b33 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Flash.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Flash.java @@ -125,9 +125,30 @@ public class Flash extends SkillActive while (curRange <= maxRange) { Location newTarget = player.getLocation().add(new Vector(0,0.2,0)).add(player.getLocation().getDirection().multiply(curRange)); - - if (!UtilBlock.airFoliage(newTarget.getBlock()) || - !UtilBlock.airFoliage(newTarget.getBlock().getRelative(BlockFace.UP))) + Location aboveTarget = newTarget.getBlock().getRelative(BlockFace.UP).getLocation(); + + // half-slab + boolean newTargetIsSlab = newTarget.getBlock().getType() == Material.STEP || newTarget.getBlock().getType() == Material.WOOD_STEP; + boolean aboveTargetIsSlab = aboveTarget.getBlock().getType() == Material.STEP || aboveTarget.getBlock().getType() == Material.WOOD_STEP; + + boolean newTargetSlabIsBottom = false; + boolean aboveTargetSlabIsBottom = false; + + if(newTargetIsSlab && curRange < 0.5) + { + int newTargetData = (int) newTarget.getBlock().getData(); + + if(newTargetData <= 7) newTargetSlabIsBottom = true; + } + + if(aboveTargetIsSlab && curRange < 0.25) + { + int aboveTargetData = (int) aboveTarget.getBlock().getData(); + + if(aboveTargetData <= 7) aboveTargetSlabIsBottom = true; + } + + if ((!newTargetSlabIsBottom && UtilBlock.fullSolid(newTarget.getBlock())) || (!aboveTargetSlabIsBottom && UtilBlock.fullSolid(aboveTarget.getBlock()))) break; //Progress Forwards From f8401e0eeb37abfa2aedb27f3039be7d2baf36b5 Mon Sep 17 00:00:00 2001 From: fooify Date: Mon, 23 Nov 2015 17:08:24 -0800 Subject: [PATCH 14/41] fixed shield smash and fissure affecting spectators --- .../game/classcombat/Skill/Knight/ShieldSmash.java | 3 +++ .../game/classcombat/Skill/Mage/FissureData.java | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/ShieldSmash.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/ShieldSmash.java index 74c32eca4..8a2a4875b 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/ShieldSmash.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/ShieldSmash.java @@ -84,6 +84,9 @@ public class ShieldSmash extends SkillActive if (cur.equals(player)) continue; + + if (UtilPlayer.isSpectator(cur)) + continue; if (UtilMath.offset(loc, cur.getLocation()) > 2.5) continue; diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FissureData.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FissureData.java index 6f4353598..6f3ac3d64 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FissureData.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FissureData.java @@ -94,13 +94,16 @@ public class FissureData _loc.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId()); //Slow - for (Player cur : block.getWorld().getPlayers()) + for (Player cur : block.getWorld().getPlayers()) { + if(UtilPlayer.isSpectator(cur)) continue; + if (!cur.equals(_player)) if (UtilMath.offset(block.getLocation().add(0.5, 0.5, 0.5), cur.getLocation()) < 1.5) { //Condition Host.Factory.Condition().Factory().Slow("Fissure", cur, _player, 1 + _level, 1, false, true, true, true); } + } } } @@ -142,7 +145,10 @@ public class FissureData up.getWorld().playEffect(up.getLocation(), Effect.STEP_SOUND, block.getTypeId()); //Damage - for (Player cur : up.getWorld().getPlayers()) + for (Player cur : up.getWorld().getPlayers()) { + if (UtilPlayer.isSpectator(cur)) + continue; + if (!cur.equals(_player)) { //Teleport @@ -168,7 +174,7 @@ public class FissureData UtilPlayer.message(cur, F.main(Host.GetClassType().name(), F.name(_player.getName()) +" hit you with " + F.skill(Host.GetName(_level)) + ".")); } } - + } //Next Column if (_height >= Math.min(3, _handled/2 + 1)) { From 0dff0ffe1d27574fbab9703bbae857b663a48ec4 Mon Sep 17 00:00:00 2001 From: fooify Date: Sat, 28 Nov 2015 09:31:57 -0800 Subject: [PATCH 15/41] fixed bacon blast exloding blocks fixed sg compass pointing to teammates --- .../game/arcade/game/games/survivalgames/SurvivalGames.java | 4 ++-- .../src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java index 536983bca..89564c4e7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java @@ -941,7 +941,7 @@ public abstract class SurvivalGames extends Game for (Player alive : GetPlayers(true)) { - if (alive != player) + if (alive != player && getArcadeManager().canHurt(player, alive)) { double distance = alive.getLocation().distance( player.getLocation()); @@ -1546,7 +1546,7 @@ public abstract class SurvivalGames extends Game // Misc _baseLoot.addLoot(new RandomItem(Material.EXP_BOTTLE, 30, 1, 2)); - _baseLoot.addLoot(new RandomItem(Material.COMPASS, 20)); + _baseLoot.addLoot(new RandomItem(Material.COMPASS, 1000));//20 _baseLoot.addLoot(new RandomItem(Material.STICK, 30, 1, 2)); _baseLoot.addLoot(new RandomItem(Material.BOAT, 15)); _baseLoot.addLoot(new RandomItem(Material.FLINT, 30, 1, 2)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java index d69147917..c190beadc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java @@ -1,5 +1,6 @@ package nautilus.game.arcade.kit.perks; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; @@ -109,7 +110,9 @@ public class PerkBaconBlast extends Perk implements IThrown public void Explode(ProjectileUser data) { - data.GetThrown().getWorld().createExplosion(data.GetThrown().getLocation(), 0.5f); + // for whatever reason, you can't put a location in createExplosion if you don't want it to break blocks >.> + Location loc = data.GetThrown().getLocation(); + data.GetThrown().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 0.5f, false, false); data.GetThrown().remove(); } } From ed96c8e3b34810fbd63a2e38b89333ca44b70aa7 Mon Sep 17 00:00:00 2001 From: fooify Date: Mon, 30 Nov 2015 19:27:34 -0800 Subject: [PATCH 16/41] fixed ssm enderman always facing south on teleport --- .../game/games/smash/perks/PerkEndermanTeleport.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkEndermanTeleport.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkEndermanTeleport.java index c55aa293f..7a0bf6059 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkEndermanTeleport.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkEndermanTeleport.java @@ -13,10 +13,10 @@ import org.bukkit.event.player.PlayerQuitEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -37,10 +37,13 @@ public class PerkEndermanTeleport extends SmashPerk @EventHandler public void update(UpdateEvent event) - { + { if (event.getType() != UpdateType.TICK) return; + if(!Manager.GetGame().IsLive()) + return; + for (Player player : UtilServer.getPlayers()) { if (!Kit.HasKit(player)) @@ -88,7 +91,7 @@ public class PerkEndermanTeleport extends SmashPerk } player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 0.5f); - player.teleport(block.getLocation().add(0.5, 1, 0.5)); + player.teleport(block.getLocation().add(0.5, 1, 0.5).setDirection(player.getLocation().getDirection())); player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 0.5f); UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0.1f, 100, ViewDist.LONG, UtilServer.getPlayers()); From 06ef9640008b23dbe7c52eea9564e108567ed442 Mon Sep 17 00:00:00 2001 From: fooify Date: Mon, 30 Nov 2015 19:33:03 -0800 Subject: [PATCH 17/41] removed important debug thing --- .../game/arcade/game/games/survivalgames/SurvivalGames.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java index 89564c4e7..b0c034a8f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java @@ -1546,7 +1546,7 @@ public abstract class SurvivalGames extends Game // Misc _baseLoot.addLoot(new RandomItem(Material.EXP_BOTTLE, 30, 1, 2)); - _baseLoot.addLoot(new RandomItem(Material.COMPASS, 1000));//20 + _baseLoot.addLoot(new RandomItem(Material.COMPASS, 20)); _baseLoot.addLoot(new RandomItem(Material.STICK, 30, 1, 2)); _baseLoot.addLoot(new RandomItem(Material.BOAT, 15)); _baseLoot.addLoot(new RandomItem(Material.FLINT, 30, 1, 2)); From 48ae23ebffa9b9cc0d4160dbf1d4af59ab5709f1 Mon Sep 17 00:00:00 2001 From: fooify Date: Mon, 30 Nov 2015 19:58:41 -0800 Subject: [PATCH 18/41] changed reference to premium ranks --- .../Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java index 8208dcba5..83940a3bb 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java @@ -108,7 +108,7 @@ public class ServerNpcPage extends ShopPageInventory Date: Tue, 1 Dec 2015 16:23:07 -0800 Subject: [PATCH 19/41] fixed naming pets non-alphanumeric characters --- .../mineplex/core/cosmetic/ui/page/PetTagPage.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java index 84da7d074..2846f791e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java @@ -64,7 +64,16 @@ public class PetTagPage extends ShopPageBase { _tagName = ChatColor.stripColor(_tagName); _tagName = _tagName.replaceAll("[^A-Za-z0-9]", ""); - + System.out.println("Pet name: " + _tagName + "."); + if (_tagName.length() == 0) + { + UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Supplied pet name contains invalid characters.")); + playDenySound(getPlayer()); + + getShop().openPageForPlayer(getPlayer(), new PetPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Pets", getPlayer())); + return; + } + if (_tagName.length() > 16) { UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Pet name cannot be longer than 16 characters.")); From b04f139883e84633c381fe163f76033f3593eb4c Mon Sep 17 00:00:00 2001 From: fooify Date: Tue, 1 Dec 2015 19:26:52 -0800 Subject: [PATCH 20/41] Fixed advertisement being able to be bypassed by spec and instant join --- .../mineplex/hub/server/ui/ServerNpcPage.java | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java index 83940a3bb..5bc9aa8fa 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java @@ -15,7 +15,9 @@ import org.bukkit.inventory.meta.SkullMeta; import mineplex.core.account.CoreClientManager; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTime; import mineplex.core.donation.DonationManager; import mineplex.core.game.GameDisplay; @@ -78,17 +80,8 @@ public class ServerNpcPage extends ShopPageInventory 64 ? 64 : yellowCount, false), new IButton() - { - @Override - public void onClick(Player player, ClickType clickType) + if(showGreen) { + addButton(40, new ShopItem(Material.GOLD_BLOCK, C.cAqua + yellowCount + " Game" + (yellowCount == 1 ? "" : "s") + " In Progress", new String[]{MESSAGE_SPECTATE}, yellowCount > 64 ? 64 : yellowCount, false), new IButton() { - _onMainPage = false; - } - }); - + @Override + public void onClick(Player player, ClickType clickType) + { + _onMainPage = false; + } + }); + + addButton(4, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BLOCK, (byte) 0, 1, C.cGreen + "Click to join instantly!"), new IButton() { + + @Override + public void onClick(Player player, ClickType clickType) { + getPlugin().selectServer(player, _serverGroupName); + } + }); + } + // Clear empty slots if (showGreen) { From 91aaf5f2fbe9c7918202df386c6a2d2dab68860c Mon Sep 17 00:00:00 2001 From: fooify Date: Thu, 3 Dec 2015 16:45:30 -0800 Subject: [PATCH 21/41] world's smallest bugfix - admin->co-host --- .../src/nautilus/game/arcade/managers/GameHostManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java index e5be1cdbc..50a838155 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java @@ -396,7 +396,7 @@ public class GameHostManager implements Listener if (!isAdmin(event.getPlayer(), true)) { - event.getPlayer().sendMessage(F.main("Broadcast", "Only MPS admins can use this command.")); + event.getPlayer().sendMessage(F.main("Broadcast", "Only Co-Hosts can use this command.")); event.setCancelled(true); return; } From b1bd2ff5ac824594d724e449c88eaf0a052cd02c Mon Sep 17 00:00:00 2001 From: fooify Date: Thu, 3 Dec 2015 16:50:27 -0800 Subject: [PATCH 22/41] Gravity's icon changed to ENDER_PORTAL_FRAME --- Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java index c1603431f..c2cb60272 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java @@ -22,7 +22,7 @@ public enum GameDisplay DragonsTeams("Dragons Teams", Material.ENDER_STONE, (byte)0, GameCategory.TEAM_VARIANT, 14), Draw("Draw My Thing", Material.BOOK_AND_QUILL, (byte)0, GameCategory.CLASSICS, 15), Evolution("Evolution", Material.EMERALD, (byte)0, GameCategory.ARCADE, 16), - Gravity("Gravity", Material.ENDER_PORTAL, (byte)0, GameCategory.EXTRA, 18), + Gravity("Gravity", Material.ENDER_PORTAL_FRAME, (byte)0, GameCategory.EXTRA, 18), Halloween("Halloween Horror", Material.PUMPKIN, (byte)0, GameCategory.CLASSICS, 19), HideSeek("Block Hunt", Material.GRASS, (byte)0, GameCategory.CLASSICS, 20), HoleInTheWall("Hole in the Wall", Material.STAINED_GLASS, (byte) 2, GameCategory.ARCADE, 52), From d7497ec09881047d7461630fac2c3b51bf37a06c Mon Sep 17 00:00:00 2001 From: fooify Date: Fri, 4 Dec 2015 15:56:48 -0800 Subject: [PATCH 23/41] Fixed Micro Battle icon not appearing in stats menu --- .../src/mineplex/core/achievement/AchievementCategory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java index fa8e6c577..8805b3b91 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java @@ -137,7 +137,7 @@ public enum AchievementCategory MICRO_BATTLE("Micro Battle", null, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, - Material.LAVA, 0, GameCategory.ARCADE, null), + Material.LAVA_BUCKET, 0, GameCategory.ARCADE, null), BOMB_LOBBERS("Bomb Lobbers", null, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, From 1dcbf5f7fd0a137b062c5adde0f1596d20c4008f Mon Sep 17 00:00:00 2001 From: William Burns Date: Fri, 11 Dec 2015 16:34:04 +0000 Subject: [PATCH 24/41] Couple of fixes --- .../game/games/gladiators/Gladiators.java | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java index 9fa85f642..c6f39d388 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java @@ -1,5 +1,6 @@ package nautilus.game.arcade.game.games.gladiators; +import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -659,7 +660,7 @@ public class Gladiators extends SoloGame if (closest != _playerArenas.get(p)) { - if (closest.getColour().furtherOut(_playerArenas.get(p).getColour())) + if (closest.getColour().furtherOut(_playerArenas.get(p).getColour()) || (!_playerArenas.get(p).isOpenDoor())) { // No going backwards. Bounce baby bounce. if (Recharge.Instance.use(p, "Arena Bounce", 500, false, false)) @@ -674,6 +675,9 @@ public class Gladiators extends SoloGame //p.sendMessage("ARENA MOVE CHECK METHOD!"); Manager.getPluginManager().callEvent(new PlayerChangeArenaEvent(e.getPlayer(), closest, _playerArenas.get(p))); _playerArenas.put(p, closest); + + // Push player a little + UtilAction.velocity(p, UtilAlg.getTrajectory2d(p.getLocation(), closest.getMid()), 1.7, false, 0.2, 0, 3, false); } } @@ -892,8 +896,8 @@ public class Gladiators extends SoloGame if (e.getEntity() instanceof Player) { - ((Player)e.getEntity()).getInventory().addItem(new ItemStack(Material.ARROW, 1)); // Arrow fix. - ((Player)e.getEntity()).updateInventory(); +// ((Player)e.getEntity()).getInventory().addItem(new ItemStack(Material.ARROW, 1)); // Arrow fix. +// ((Player)e.getEntity()).updateInventory(); } } @@ -1007,6 +1011,9 @@ public class Gladiators extends SoloGame { if (_playerArenas.containsKey(e.getPlayer())) { + if (_playerArenas.get(e.getPlayer()).getState() != ArenaState.FIGHTING) + return; + for (Player p : _playerArenas.get(e.getPlayer()).getPastPlayers()) { if (p.equals(e.getPlayer())) @@ -1019,4 +1026,17 @@ public class Gladiators extends SoloGame } } } + + @EventHandler + public void deathHealth(CombatDeathEvent e) + { + if (!(e.GetEvent().getEntity() instanceof Player)) + return; + + if (e.GetLog().GetKiller().IsPlayer()) + { + Player killer = UtilPlayer.searchExact(e.GetLog().GetKiller().GetName()); + ((Player)e.GetEvent().getEntity()).sendMessage(F.main("Game", "Your killer had " + C.cRed + new DecimalFormat("#").format(killer.getHealth()) + "❤" + C.cGray + " left.")); + } + } } From 6456d7bd66f4aab4ce81e2efd3f46131818c8b98 Mon Sep 17 00:00:00 2001 From: William Burns Date: Fri, 11 Dec 2015 16:55:15 +0000 Subject: [PATCH 25/41] Scoreboard change and breaking blocks. --- .../game/games/gladiators/Gladiators.java | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java index c6f39d388..b6080c5ad 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java @@ -4,6 +4,7 @@ import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.Map; @@ -24,7 +25,6 @@ import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerQuitEvent; -import org.bukkit.inventory.ItemStack; import net.minecraft.server.v1_8_R3.PacketPlayOutAnimation; @@ -108,6 +108,10 @@ public class Gladiators extends SoloGame DontAllowOverfill = true; EnableTutorials = false; + BlockBreakAllow.add(Material.SUGAR_CANE_BLOCK.getId()); + BlockBreakAllow.add(Material.GRASS.getId()); + BlockBreakAllow.add(Material.LONG_GRASS.getId()); + registerStatTrackers( new BrawlerTracker(this), //new UntouchableTracker(this), @@ -1039,4 +1043,26 @@ public class Gladiators extends SoloGame ((Player)e.GetEvent().getEntity()).sendMessage(F.main("Game", "Your killer had " + C.cRed + new DecimalFormat("#").format(killer.getHealth()) + "❤" + C.cGray + " left.")); } } + + @EventHandler + public void scoreboardEnd(GameStateChangeEvent e) + { + if (e.GetState() != GameState.End) + return; + + Scoreboard.Reset(); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cGreen + C.Bold + "Status"); + Scoreboard.Write(C.cWhite + "Ended"); + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cAqua + C.Bold + "Matches Left"); + Scoreboard.Write(C.cWhite + "0"); + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Players"); + if (getWinners() != null && !getWinners().isEmpty()) + Scoreboard.Write(C.cWhite + getWinners().get(0).getName()); + + Scoreboard.Draw(); + } } From 0d4bd91b573ca251d15471b6454452bd4ebca195 Mon Sep 17 00:00:00 2001 From: William Burns Date: Fri, 11 Dec 2015 22:47:07 +0000 Subject: [PATCH 26/41] lag detection thing --- .../arcade/game/games/gladiators/Arena.java | 19 +++++++++++++++++-- .../game/games/gladiators/Gladiators.java | 10 +++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Arena.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Arena.java index a4dca2dcc..ec26ae9e9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Arena.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Arena.java @@ -258,8 +258,23 @@ public class Arena public void closeDoor() { - for (Location loc : _doorBlocks) - loc.getBlock().setType(Material.OBSIDIAN); + _host.Manager.getScheduler().scheduleSyncDelayedTask(_host.Manager.getPlugin(), new Runnable() + { + @Override + public void run() + { + for (Location loc : _doorBlocks) + loc.getBlock().setType(Material.OBSIDIAN); + + // Lag exploit check + for (Player p : getPastPlayers()) + { + Arena closest = _host.getArenaByMid(UtilAlg.findClosest(p.getLocation(), _host.getAllArenaMids())); + if (closest != _host.getPlayerArenas().get(p)) + p.teleport(UtilAlg.findClosest(p.getLocation(), getSpawns())); + } + } + }, 5L); } public boolean isOpenDoor() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java index b6080c5ad..b03240656 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java @@ -469,6 +469,11 @@ public class Gladiators extends SoloGame return mids; } + public HashMap getPlayerArenas() + { + return _playerArenas; + } + public ArrayList getAllArenaMids() { ArrayList mids = new ArrayList<>(); @@ -664,7 +669,7 @@ public class Gladiators extends SoloGame if (closest != _playerArenas.get(p)) { - if (closest.getColour().furtherOut(_playerArenas.get(p).getColour()) || (!_playerArenas.get(p).isOpenDoor())) + if (closest.getColour().furtherOut(_playerArenas.get(p).getColour())) { // No going backwards. Bounce baby bounce. if (Recharge.Instance.use(p, "Arena Bounce", 500, false, false)) @@ -676,6 +681,9 @@ public class Gladiators extends SoloGame return; } + if (!_playerArenas.get(p).isOpenDoor()) + return; + //p.sendMessage("ARENA MOVE CHECK METHOD!"); Manager.getPluginManager().callEvent(new PlayerChangeArenaEvent(e.getPlayer(), closest, _playerArenas.get(p))); _playerArenas.put(p, closest); From 905842848492083df0f11b39e1ce47a7f00f68ec Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 13 Dec 2015 16:40:46 +1300 Subject: [PATCH 27/41] Change ItemBuilder to have ItemFlag, change hub icons to not display weapon damage --- .../mineplex/core/itemstack/ItemBuilder.java | 151 ++-- .../hub/profile/buttons/ButtonPrefs.java | 29 +- .../hub/server/ui/ServerGameMenu.java | 788 +++++++++--------- .../hub/server/ui/ServerTypePage.java | 51 +- 4 files changed, 530 insertions(+), 489 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemBuilder.java b/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemBuilder.java index c1d486795..8ea88cc70 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemBuilder.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemBuilder.java @@ -2,7 +2,9 @@ package mineplex.core.itemstack; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; @@ -12,6 +14,7 @@ import org.bukkit.Color; import org.bukkit.FireworkEffect; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.FireworkEffectMeta; import org.bukkit.inventory.meta.ItemMeta; @@ -19,6 +22,8 @@ import org.bukkit.inventory.meta.LeatherArmorMeta; import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.potion.Potion; +import mineplex.core.common.util.C; + public class ItemBuilder { @@ -48,20 +53,17 @@ public class ItemBuilder private final HashMap _enchants = new HashMap(); private final List _lore = new ArrayList(); private Material _mat; - // private Potion potion; private String _title = null; private boolean _unbreakable; private String _playerHeadName = null; + private HashSet _itemFlags = new HashSet(); public ItemBuilder(ItemStack item) { this(item.getType(), item.getDurability()); _amount = item.getAmount(); _enchants.putAll(item.getEnchantments()); - if (item.getType() == Material.POTION) - { - // setPotion(Potion.fromItemStack(item)); - } + if (item.hasItemMeta()) { ItemMeta meta = item.getItemMeta(); @@ -81,6 +83,8 @@ public class ItemBuilder setColor(((LeatherArmorMeta) meta).getColor()); } + _itemFlags.addAll(meta.getItemFlags()); + _unbreakable = meta.spigot().isUnbreakable(); } } @@ -107,13 +111,60 @@ public class ItemBuilder this(mat, 1, data); } + public HashSet getItemFlags() + { + return _itemFlags; + } + + public ItemBuilder addItemFlags(ItemFlag... flags) + { + getItemFlags().addAll(Arrays.asList(flags)); + + return this; + } + + public ItemBuilder setItemFlags(ItemFlag... flags) + { + getItemFlags().clear(); + addItemFlags(flags); + + return this; + } + + public ItemBuilder setItemFlags(Collection flags) + { + getItemFlags().clear(); + addItemFlags(flags.toArray(new ItemFlag[0])); + + return this; + } + + public ItemBuilder setHideInfo(boolean hideInfo) + { + if (hideInfo) + { + for (ItemFlag flag : ItemFlag.values()) + { + getItemFlags().add(flag); + } + } + else + { + getItemFlags().clear(); + } + + return this; + } + public ItemBuilder addEnchantment(Enchantment enchant, int level) { if (_enchants.containsKey(enchant)) { _enchants.remove(enchant); } + _enchants.put(enchant, level); + return this; } @@ -121,20 +172,31 @@ public class ItemBuilder { for (String lore : lores) { - _lore.add(ChatColor.GRAY + lore); + _lore.add(C.cGray + lore); } + + return this; + } + + public ItemBuilder setLore(String... lores) + { + _lore.clear(); + _lore.addAll(Arrays.asList(lores)); + return this; } public ItemBuilder addLore(String lore, int maxLength) { _lore.addAll(split(lore, maxLength)); + return this; } public ItemBuilder addLores(List lores) { _lore.addAll(lores); + return this; } @@ -144,6 +206,7 @@ public class ItemBuilder { addLore(lore, maxLength); } + return this; } @@ -155,6 +218,7 @@ public class ItemBuilder public ItemStack build() { Material mat = _mat; + if (mat == null) { mat = Material.AIR; @@ -164,8 +228,10 @@ public class ItemBuilder { Bukkit.getLogger().warning("Air material!"); } + ItemStack item = new ItemStack(mat, _amount, _data); ItemMeta meta = item.getItemMeta(); + if (meta != null) { if (_title != null) @@ -189,14 +255,13 @@ public class ItemBuilder ((FireworkEffectMeta) meta).setEffect(FireworkEffect.builder().withColor(_color).build()); } + meta.addItemFlags(getItemFlags().toArray(new ItemFlag[0])); meta.spigot().setUnbreakable(isUnbreakable()); item.setItemMeta(meta); } item.addUnsafeEnchantments(_enchants); - // if (potion != null) { - // potion.apply(item); - // } + return item; } @@ -263,52 +328,6 @@ public class ItemBuilder return _enchants.containsKey(enchant); } - public boolean isItem(ItemStack item) - { - ItemMeta meta = item.getItemMeta(); - - if (item.getType() != getType()) - { - return false; - } - - if (!meta.hasDisplayName() && getTitle() != null) - { - return false; - } - - if (!meta.getDisplayName().equals(getTitle())) - { - return false; - } - - if (!meta.hasLore() && !getLore().isEmpty()) - { - return false; - } - - if (meta.hasLore()) - { - for (String lore : meta.getLore()) - { - if (!getLore().contains(lore)) - { - return false; - } - } - } - - for (Enchantment enchant : item.getEnchantments().keySet()) - { - if (!hasEnchantment(enchant)) - { - return false; - } - } - - return true; - } - public boolean isUnbreakable() { return _unbreakable; @@ -317,17 +336,14 @@ public class ItemBuilder public ItemBuilder setAmount(int amount) { _amount = amount; + return this; } public ItemBuilder setColor(Color color) { - /* (!_mat.name().contains("LEATHER_")) - { - throw new IllegalArgumentException("Can only dye leather armor!"); - }*/ - _color = color; + return this; } @@ -338,19 +354,10 @@ public class ItemBuilder return this; } - public ItemBuilder setPotion(Potion potion) - { - if (_mat != Material.POTION) - { - _mat = Material.POTION; - } - - return this; - } - public ItemBuilder setRawTitle(String title) { _title = title; + return this; } @@ -378,24 +385,28 @@ public class ItemBuilder } setTitle(title); + return this; } public ItemBuilder setType(Material mat) { _mat = mat; + return this; } public ItemBuilder setUnbreakable(boolean setUnbreakable) { _unbreakable = setUnbreakable; + return this; } public ItemBuilder setPlayerHead(String playerName) { _playerHeadName = playerName; + return this; } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/profile/buttons/ButtonPrefs.java b/Plugins/Mineplex.Hub/src/mineplex/hub/profile/buttons/ButtonPrefs.java index 38652a7c7..1b9c38395 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/profile/buttons/ButtonPrefs.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/profile/buttons/ButtonPrefs.java @@ -2,6 +2,7 @@ package mineplex.hub.profile.buttons; import mineplex.core.common.util.C; import mineplex.core.gui.GuiItem; +import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemStackFactory; import mineplex.hub.profile.gui.GUIProfile; @@ -17,7 +18,7 @@ public class ButtonPrefs implements GuiItem private GUIProfile _profile; private Player _player; - + public ButtonPrefs(GUIProfile profile, Player player) { _profile = profile; @@ -33,29 +34,27 @@ public class ButtonPrefs implements GuiItem @Override public ItemStack getObject() { - return ItemStackFactory.Instance.CreateStack(Material.REDSTONE_COMPARATOR.getId(), (byte)0, 1, - ChatColor.RESET + C.cYellow + "Preferences", - new String[] - { - "", - C.cWhite + "Set your preferences to your liking", - C.cWhite + "so you can enjoy the game more!", - - "", - C.cWhite + "Type " + C.cGreen + "/prefs" + C.cWhite + " to access this anywhere!" - }); + return new ItemBuilder(Material.REDSTONE_COMPARATOR).setTitle(C.Reset + C.cYellow + "Preferences").addLore(new String[] + { + "", + C.cWhite + "Set your preferences to your liking", + C.cWhite + "so you can enjoy the game more!", + + "", + C.cWhite + "Type " + C.cGreen + "/prefs" + C.cWhite + " to access this anywhere!" + }).build(); } @Override - public void setup() + public void setup() { - + } @Override public void close() { - + } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 4e3bc8320..1eb43415a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -3,7 +3,6 @@ package mineplex.hub.server.ui; import java.util.ArrayList; import java.util.List; -import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; @@ -11,7 +10,7 @@ import org.bukkit.inventory.ItemStack; import mineplex.core.account.CoreClientManager; import mineplex.core.common.util.C; import mineplex.core.donation.DonationManager; -import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.itemstack.ItemBuilder; import mineplex.core.shop.page.ShopPageBase; import mineplex.hub.server.ServerManager; import mineplex.hub.server.ui.button.SelectBHButton; @@ -34,17 +33,18 @@ public class ServerGameMenu extends ShopPageBase { private List _superSmashCycle = new ArrayList(); private List _minigameCycle = new ArrayList(); - + private int _ssmIndex; private int _minigameIndex; - - public ServerGameMenu(ServerManager plugin, QuickShop quickShop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player) + + public ServerGameMenu(ServerManager plugin, QuickShop quickShop, CoreClientManager clientManager, + DonationManager donationManager, String name, Player player) { super(plugin, quickShop, clientManager, donationManager, name, player, 47); - + createSuperSmashCycle(); createMinigameCycle(); - + buildPage(); } @@ -52,148 +52,165 @@ public class ServerGameMenu extends ShopPageBase @Override protected void buildPage() { - setItem(0, ItemStackFactory.Instance.CreateStack(Material.IRON_PICKAXE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "The Bridges " + C.cGray + "4 Team Survival", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "4 Teams get 10 minutes to prepare.", - ChatColor.RESET + "Then the bridges drop, and all hell", - ChatColor.RESET + "breaks loose as you battle to the", - ChatColor.RESET + "death with the other teams.", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BR") + ChatColor.RESET + " other players!", - })); - - setItem(2, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Solo/Team Survival", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "Search for chests to find loot and ", - ChatColor.RESET + "fight others to be the last man standing. ", - ChatColor.RESET + "Stay away from the borders!", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("HG") + getPlugin().getGroupTagPlayerCount("SG2")) + ChatColor.RESET + " other players!", - })); + setItem(0, new ItemBuilder(Material.IRON_PICKAXE) + .setTitle(C.Reset + C.Bold + C.cYellow + "The Bridges " + C.cGray + "4 Team Survival").addLore(new String[] + { + C.Reset + "", + C.Reset + "4 Teams get 10 minutes to prepare.", + C.Reset + "Then the bridges drop, and all hell", + C.Reset + "breaks loose as you battle to the", + C.Reset + "death with the other teams.", + C.Reset + "", + C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BR") + C.Reset + " other players!" + }).setHideInfo(true).build()); - setItem(4, ItemStackFactory.Instance.CreateStack(Material.FEATHER.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Skywars " + C.cGray + "Solo/Team Survival", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "16 contenders fight for the right to rule the skies!", - ChatColor.RESET + "Spawn on a sky island and build your path!", - ChatColor.RESET + "Find weapons to take your enemies down!", - ChatColor.RESET + "Way up there, death ever looming if you fall..", - ChatColor.RESET + "Can you fight? Can you live? Can you win Skywars?", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("SKY") + getPlugin().getGroupTagPlayerCount("SKY2")) + ChatColor.RESET + " other players!", - })); + setItem(2, new ItemBuilder(Material.DIAMOND_SWORD) + .setTitle(C.Reset + C.Bold + C.cYellow + "Survival Games " + C.cGray + "Solo/Team Survival").addLore(new String[] + { + C.Reset + "", + C.Reset + "Search for chests to find loot and ", + C.Reset + "fight others to be the last man standing. ", + C.Reset + "Stay away from the borders!", + C.Reset + "", + C.Reset + "Join " + C.cGreen + + (getPlugin().getGroupTagPlayerCount("HG") + getPlugin().getGroupTagPlayerCount("SG2")) + C.Reset + + " other players!" + }).setHideInfo(true).build()); - setItem(6, ItemStackFactory.Instance.CreateStack(Material.GOLDEN_APPLE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "UHC " + C.cGray + "Ultra Hardcore Mode", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "Extremely hard team-based survival ", - ChatColor.RESET + "Gather materials and fight your way", - ChatColor.RESET + "to become the last team standing!", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("UHC") + ChatColor.RESET + " other players!", - })); + setItem(4, new ItemBuilder(Material.FEATHER) + .setTitle(C.Reset + C.Bold + C.cYellow + "Skywars " + C.cGray + "Solo/Team Survival").addLore(new String[] + { + C.Reset + "", + C.Reset + "16 contenders fight to rule the skies!", + C.Reset + "Spawn on a sky island and build your path!", + C.Reset + "Find weapons to take your enemies down!", + C.Reset + "Up in the skies, death looming if you fall..", + C.Reset + "Win! Fight! Send enemies flying in Skywars!", + C.Reset + "", + C.Reset + "Join " + C.cGreen + + (getPlugin().getGroupTagPlayerCount("SKY") + getPlugin().getGroupTagPlayerCount("SKY2")) + C.Reset + + " other players!", + }).setHideInfo(true).build()); - setItem(8, ItemStackFactory.Instance.CreateStack(Material.BLAZE_ROD.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Wizards " + C.cGray + "Last Man Standing", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "Wield powerful spells to fight", - ChatColor.RESET + "against other players in this", - ChatColor.RESET + "exciting free-for-all brawl!", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("WIZ") + ChatColor.RESET + " other players!", - })); + setItem(6, new ItemBuilder(Material.GOLDEN_APPLE) + .setTitle(C.Reset + C.Bold + C.cYellow + "UHC " + C.cGray + "Ultra Hardcore Mode").addLore(new String[] + { + C.Reset + "", + C.Reset + "Extremely hard team-based survival ", + C.Reset + "Gather materials and fight your way", + C.Reset + "to become the last team standing!", + C.Reset + "", + C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("UHC") + C.Reset + " other players!", + }).setHideInfo(true).build()); - setItem(18, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_CHESTPLATE, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Castle Siege " + C.cGray + "Team Game", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "Defenders must protect King Sparklez", - ChatColor.RESET + "from the endless waves of Undead", - ChatColor.RESET + "until the sun rises!", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("CS") + ChatColor.RESET + " other players!", - })); + setItem(8, new ItemBuilder(Material.BLAZE_ROD) + .setTitle(C.Reset + C.Bold + C.cYellow + "Wizards " + C.cGray + "Last Man Standing").addLore(new String[] + { + C.Reset + "", + C.Reset + "Wield powerful spells to fight", + C.Reset + "against other players in this", + C.Reset + "exciting free-for-all brawl!", + C.Reset + "", + C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("WIZ") + C.Reset + " other players!", + }).setHideInfo(true).build()); - setItem(20, ItemStackFactory.Instance.CreateStack(Material.GRASS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Block Hunt " + C.cGray + "Cat and Mouse", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "Hide as blocks/animals, upgrade your ", - ChatColor.RESET + "weapon and fight to survive against", - ChatColor.RESET + "the Hunters!", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BH") + ChatColor.RESET + " other players!", - })); + setItem(18, new ItemBuilder(Material.DIAMOND_CHESTPLATE) + .setTitle(C.Reset + C.Bold + C.cYellow + "Castle Siege " + C.cGray + "Team Game").addLore(new String[] + { + C.Reset + "", + C.Reset + "Defenders must protect King Sparklez", + C.Reset + "from the endless waves of Undead", + C.Reset + "until the sun rises!", + C.Reset + "", + C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("CS") + C.Reset + " other players!", + }).setHideInfo(true).build()); + + setItem(20, new ItemBuilder(Material.GRASS) + .setTitle(C.Reset + C.Bold + C.cYellow + "Block Hunt " + C.cGray + "Cat and Mouse").addLore(new String[] + { + C.Reset + "", + C.Reset + "Hide as blocks/animals, upgrade your ", + C.Reset + "weapon and fight to survive against", + C.Reset + "the Hunters!", + C.Reset + "", + C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BH") + C.Reset + " other players!", + }).setHideInfo(true).build()); setItem(22, _superSmashCycle.get(_ssmIndex)); - setItem(24, ItemStackFactory.Instance.CreateStack(Material.TNT.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Mine-Strike " + C.cGray + "Team Survival", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "One team must defend two bomb sites from", - ChatColor.RESET + "the other team, who are trying to plant a bomb", - ChatColor.RESET + "and blow them up!", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("MS") + ChatColor.RESET + " other players!", - })); - - setItem(26, ItemStackFactory.Instance.CreateStack(Material.BOOK_AND_QUILL.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Draw My Thing " + C.cGray + "Pictionary!", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "Players take turns at drawing a random", - ChatColor.RESET + "word. Whoever guesses it within the time", - ChatColor.RESET + "limit gets some points!", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("DMT") + ChatColor.RESET + " other players!", - })); - - setItem(36, ItemStackFactory.Instance.CreateStack(Material.BEACON.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Dominate " + C.cGray + "Team Game", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "Customize one of five exciting champions", - ChatColor.RESET + "and battle with the opposing team for the", - ChatColor.RESET + "control points on the map.", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("DOM") + ChatColor.RESET + " other players!", - })); - - setItem(38, ItemStackFactory.Instance.CreateStack(Material.GOLD_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Team Deathmatch " + C.cGray + "Team Game", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "Customize one of five exciting champions", - ChatColor.RESET + "and battle with the opposing team to the", - ChatColor.RESET + "last man standing.", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("TDM") + ChatColor.RESET + " other players!", - })); - - setItem(40, ItemStackFactory.Instance.CreateStack(Material.WOOD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Master Builders " + C.cGray + "Creative Build", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "Players are given a Build Theme and ", - ChatColor.RESET + "must use blocks, monsters and more", - ChatColor.RESET + "to create a masterpiece!", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BLD") + ChatColor.RESET + " other players!", - })); - + setItem(24, new ItemBuilder(Material.TNT) + .setTitle(C.Reset + C.Bold + C.cYellow + "Mine-Strike " + C.cGray + "Team Survival").addLore(new String[] + { + C.Reset + "", + C.Reset + "One team must defend two bomb sites from", + C.Reset + "the other team, who are trying to plant a bomb", + C.Reset + "and blow them up!", + C.Reset + "", + C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("MS") + C.Reset + " other players!", + }).setHideInfo(true).build()); + + setItem(26, new ItemBuilder(Material.BOOK_AND_QUILL) + .setTitle(C.Reset + C.Bold + C.cYellow + "Draw My Thing " + C.cGray + "Pictionary!").addLore(new String[] + { + C.Reset + "", + C.Reset + "Players take turns at drawing a random", + C.Reset + "word. Whoever guesses it within the time", + C.Reset + "limit gets some points!", + C.Reset + "", + C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("DMT") + C.Reset + " other players!", + }).setHideInfo(true).build()); + + setItem(36, new ItemBuilder(Material.BEACON).setTitle(C.Reset + C.Bold + C.cYellow + "Dominate " + C.cGray + "Team Game") + .addLore(new String[] + { + C.Reset + "", + C.Reset + "Customize one of five exciting champions", + C.Reset + "and battle with the opposing team for the", + C.Reset + "control points on the map.", + C.Reset + "", + C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("DOM") + C.Reset + " other players!", + }).setHideInfo(true).build()); + + setItem(38, new ItemBuilder(Material.GOLD_SWORD) + .setTitle(C.Reset + C.Bold + C.cYellow + "Team Deathmatch " + C.cGray + "Team Game").addLore(new String[] + { + C.Reset + "", + C.Reset + "Customize one of five exciting champions", + C.Reset + "and battle with the opposing team to the", + C.Reset + "last man standing.", + C.Reset + "", + C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("TDM") + C.Reset + " other players!", + }).setHideInfo(true).build()); + + setItem(40, new ItemBuilder(Material.WOOD) + .setTitle(C.Reset + C.Bold + C.cYellow + "Master Builders " + C.cGray + "Creative Build").addLore(new String[] + { + C.Reset + "", + C.Reset + "Players are given a Build Theme and ", + C.Reset + "must use blocks, monsters and more", + C.Reset + "to create a masterpiece!", + C.Reset + "", + C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BLD") + C.Reset + " other players!", + }).setHideInfo(true).build()); + setItem(42, _minigameCycle.get(_minigameIndex)); - setItem(44, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte) 3, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Player Servers " + C.cGray + "Player Hosted Games", new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "Join your friends in their own ", - ChatColor.RESET + "Mineplex Player Server. You can play", - ChatColor.RESET + "the games you want, when you want.", - ChatColor.RESET + "", - })); + setItem(44, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3) + .addLore(C.Reset + C.Bold + C.cYellow + "Player Servers " + C.cGray + "Player Hosted Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Join your friends in their own ", + C.Reset + "Mineplex Player Server. You can play", + C.Reset + "the games you want, when you want.", + C.Reset + "", + }).setHideInfo(true).build()); getButtonMap().put(0, new SelectBRButton(this)); getButtonMap().put(2, new SelectSGButton(this)); getButtonMap().put(4, new SelectSKYButton(this)); getButtonMap().put(6, new SelectUHCButton(this)); getButtonMap().put(8, new SelectWIZButton(this)); - + getButtonMap().put(18, new SelectCSButton(this)); getButtonMap().put(20, new SelectBHButton(this)); getButtonMap().put(22, new SelectSSMButton(this)); @@ -204,271 +221,280 @@ public class ServerGameMenu extends ShopPageBase getButtonMap().put(40, new SelectBLDButton(this)); getButtonMap().put(42, new SelectMINButton(this)); getButtonMap().put(44, new SelectPLAYERButton(this)); -// getButtonMap().put(44, new SelectBETAButton(this)); + // getButtonMap().put(44, new SelectBETAButton(this)); } @SuppressWarnings("deprecation") private void createMinigameCycle() { - int playerCount = getPlugin().getGroupTagPlayerCount("MIN") + - getPlugin().getGroupTagPlayerCount("DR") + - getPlugin().getGroupTagPlayerCount("DE") + - getPlugin().getGroupTagPlayerCount("PB") + - getPlugin().getGroupTagPlayerCount("TF") + - getPlugin().getGroupTagPlayerCount("RUN") + - getPlugin().getGroupTagPlayerCount("SN") + - getPlugin().getGroupTagPlayerCount("DT") + - getPlugin().getGroupTagPlayerCount("SQ") + - getPlugin().getGroupTagPlayerCount("SA") + - getPlugin().getGroupTagPlayerCount("SS") + - getPlugin().getGroupTagPlayerCount("OITQ"); - _minigameCycle.add(ItemStackFactory.Instance.CreateStack(98, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] - { - ChatColor.RESET + "", - ChatColor.RESET + "Play all of these fun minigames:", - ChatColor.RESET + "", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "Super Spleef", - ChatColor.RESET + "Runner", - ChatColor.RESET + "Dragons", - ChatColor.RESET + "One in the Quiver", - ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Sneaky Assassins", - ChatColor.RESET + "Micro Battle", - ChatColor.RESET + "Super Paintball", - ChatColor.RESET + "Turf Wars", - ChatColor.RESET + "Death Tag", - ChatColor.RESET + "Bacon Brawl", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!", - })); - - _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.GOLD_BOOTS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] - { - ChatColor.RESET + "", - ChatColor.RESET + "Play all of these fun minigames:", - ChatColor.RESET + "", - ChatColor.RESET + "Super Spleef", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "Runner", - ChatColor.RESET + "Dragons", - ChatColor.RESET + "One in the Quiver", - ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Sneaky Assassins", - ChatColor.RESET + "Micro Battle", - ChatColor.RESET + "Super Paintball", - ChatColor.RESET + "Turf Wars", - ChatColor.RESET + "Death Tag", - ChatColor.RESET + "Bacon Brawl", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!", - })); - - _minigameCycle.add(ItemStackFactory.Instance.CreateStack(122, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] - { - ChatColor.RESET + "", - ChatColor.RESET + "Play all of these fun minigames:", - ChatColor.RESET + "", - ChatColor.RESET + "Super Spleef", - ChatColor.RESET + "Runner", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragons", - ChatColor.RESET + "One in the Quiver", - ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Sneaky Assassins", - ChatColor.RESET + "Micro Battle", - ChatColor.RESET + "Super Paintball", - ChatColor.RESET + "Turf Wars", - ChatColor.RESET + "Death Tag", - ChatColor.RESET + "Bacon Brawl", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!", - })); - - _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] - { - ChatColor.RESET + "", - ChatColor.RESET + "Play all of these fun minigames:", - ChatColor.RESET + "", - ChatColor.RESET + "Super Spleef", - ChatColor.RESET + "Runner", - ChatColor.RESET + "Dragons", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "One in the Quiver", - ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Sneaky Assassins", - ChatColor.RESET + "Micro Battle", - ChatColor.RESET + "Super Paintball", - ChatColor.RESET + "Turf Wars", - ChatColor.RESET + "Death Tag", - ChatColor.RESET + "Bacon Brawl", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!", - })); - - _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.LEATHER_BOOTS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] - { - ChatColor.RESET + "", - ChatColor.RESET + "Play all of these fun minigames:", - ChatColor.RESET + "", - ChatColor.RESET + "Super Spleef", - ChatColor.RESET + "Runner", - ChatColor.RESET + "Dragons", - ChatColor.RESET + "One in the Quiver", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragon Escape", - ChatColor.RESET + "Sneaky Assassins", - ChatColor.RESET + "Micro Battle", - ChatColor.RESET + "Super Paintball", - ChatColor.RESET + "Turf Wars", - ChatColor.RESET + "Death Tag", - ChatColor.RESET + "Bacon Brawl", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!", - })); - - _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.MILK_BUCKET.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] - { - ChatColor.RESET + "", - ChatColor.RESET + "Play all of these fun minigames:", - ChatColor.RESET + "", - ChatColor.RESET + "Super Spleef", - ChatColor.RESET + "Runner", - ChatColor.RESET + "Dragons", - ChatColor.RESET + "One in the Quiver", - ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "Sneaky Assassins", - ChatColor.RESET + "Micro Battle", - ChatColor.RESET + "Super Paintball", - ChatColor.RESET + "Turf Wars", - ChatColor.RESET + "Death Tag", - ChatColor.RESET + "Bacon Brawl", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!", - })); - - _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.MILK_BUCKET.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] - { - ChatColor.RESET + "", - ChatColor.RESET + "Play all of these fun minigames:", - ChatColor.RESET + "", - ChatColor.RESET + "Super Spleef", - ChatColor.RESET + "Runner", - ChatColor.RESET + "Dragons", - ChatColor.RESET + "One in the Quiver", - ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Sneaky Assassins", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "Micro Battle", - ChatColor.RESET + "Super Paintball", - ChatColor.RESET + "Turf Wars", - ChatColor.RESET + "Death Tag", - ChatColor.RESET + "Bacon Brawl", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!", - })); - - _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BARDING.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] - { - ChatColor.RESET + "", - ChatColor.RESET + "Play all of these fun minigames:", - ChatColor.RESET + "", - ChatColor.RESET + "Super Spleef", - ChatColor.RESET + "Runner", - ChatColor.RESET + "Dragons", - ChatColor.RESET + "One in the Quiver", - ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Sneaky Assassins", - ChatColor.RESET + "Micro Battle", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "Super Paintball", - ChatColor.RESET + "Turf Wars", - ChatColor.RESET + "Death Tag", - ChatColor.RESET + "Bacon Brawl", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!", - })); - - _minigameCycle.add(ItemStackFactory.Instance.CreateStack(159, (byte)14, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] - { - ChatColor.RESET + "", - ChatColor.RESET + "Play all of these fun minigames:", - ChatColor.RESET + "", - ChatColor.RESET + "Super Spleef", - ChatColor.RESET + "Runner", - ChatColor.RESET + "Dragons", - ChatColor.RESET + "One in the Quiver", - ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Sneaky Assassins", - ChatColor.RESET + "Micro Battle", - ChatColor.RESET + "Super Paintball", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "Turf Wars", - ChatColor.RESET + "Death Tag", - ChatColor.RESET + "Bacon Brawl", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!", - })); - - _minigameCycle.add(ItemStackFactory.Instance.CreateStack(309, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] - { - ChatColor.RESET + "", - ChatColor.RESET + "Play all of these fun minigames:", - ChatColor.RESET + "", - ChatColor.RESET + "Super Spleef", - ChatColor.RESET + "Runner", - ChatColor.RESET + "Dragons", - ChatColor.RESET + "One in the Quiver", - ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Sneaky Assassins", - ChatColor.RESET + "Micro Battle", - ChatColor.RESET + "Super Paintball", - ChatColor.RESET + "Turf Wars", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "Death Tag", - ChatColor.RESET + "Bacon Brawl", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!", - })); - - _minigameCycle.add(ItemStackFactory.Instance.CreateStack(319, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] - { - ChatColor.RESET + "", - ChatColor.RESET + "Play all of these fun minigames:", - ChatColor.RESET + "", - ChatColor.RESET + "Super Spleef", - ChatColor.RESET + "Runner", - ChatColor.RESET + "Dragons", - ChatColor.RESET + "One in the Quiver", - ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Sneaky Assassins", - ChatColor.RESET + "Micro Battle", - ChatColor.RESET + "Super Paintball", - ChatColor.RESET + "Turf Wars", - ChatColor.RESET + "Death Tag", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "Bacon Brawl", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!", - })); + int playerCount = getPlugin().getGroupTagPlayerCount("MIN") + getPlugin().getGroupTagPlayerCount("DR") + + getPlugin().getGroupTagPlayerCount("DE") + getPlugin().getGroupTagPlayerCount("PB") + + getPlugin().getGroupTagPlayerCount("TF") + getPlugin().getGroupTagPlayerCount("RUN") + + getPlugin().getGroupTagPlayerCount("SN") + getPlugin().getGroupTagPlayerCount("DT") + + getPlugin().getGroupTagPlayerCount("SQ") + getPlugin().getGroupTagPlayerCount("SA") + + getPlugin().getGroupTagPlayerCount("SS") + getPlugin().getGroupTagPlayerCount("OITQ"); + _minigameCycle.add(new ItemBuilder(Material.SMOOTH_BRICK) + .setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Play all of these fun minigames:", + C.Reset + "", + C.Reset + C.Bold + C.cGreen + "Super Spleef", + C.Reset + "Runner", + C.Reset + "Dragons", + C.Reset + "One in the Quiver", + C.Reset + "Dragon Escape", + C.Reset + "Sneaky Assassins", + C.Reset + "Micro Battle", + C.Reset + "Super Paintball", + C.Reset + "Turf Wars", + C.Reset + "Death Tag", + C.Reset + "Bacon Brawl", + C.Reset + "", + C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!", + }).setHideInfo(true).build()); + + _minigameCycle.add(new ItemBuilder(Material.GOLD_BOOTS) + .setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Play all of these fun minigames:", + C.Reset + "", + C.Reset + "Super Spleef", + C.Reset + C.Bold + C.cGreen + "Runner", + C.Reset + "Dragons", + C.Reset + "One in the Quiver", + C.Reset + "Dragon Escape", + C.Reset + "Sneaky Assassins", + C.Reset + "Micro Battle", + C.Reset + "Super Paintball", + C.Reset + "Turf Wars", + C.Reset + "Death Tag", + C.Reset + "Bacon Brawl", + C.Reset + "", + C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!", + }).setHideInfo(true).build()); + + _minigameCycle.add(new ItemBuilder(Material.DRAGON_EGG) + .setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Play all of these fun minigames:", + C.Reset + "", + C.Reset + "Super Spleef", + C.Reset + "Runner", + C.Reset + C.Bold + C.cGreen + "Dragons", + C.Reset + "One in the Quiver", + C.Reset + "Dragon Escape", + C.Reset + "Sneaky Assassins", + C.Reset + "Micro Battle", + C.Reset + "Super Paintball", + C.Reset + "Turf Wars", + C.Reset + "Death Tag", + C.Reset + "Bacon Brawl", + C.Reset + "", + C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!", + }).setHideInfo(true).build()); + + _minigameCycle.add(new ItemBuilder(Material.BOW) + .setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Play all of these fun minigames:", + C.Reset + "", + C.Reset + "Super Spleef", + C.Reset + "Runner", + C.Reset + "Dragons", + C.Reset + C.Bold + C.cGreen + "One in the Quiver", + C.Reset + "Dragon Escape", + C.Reset + "Sneaky Assassins", + C.Reset + "Micro Battle", + C.Reset + "Super Paintball", + C.Reset + "Turf Wars", + C.Reset + "Death Tag", + C.Reset + "Bacon Brawl", + C.Reset + "", + C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!", + }).setHideInfo(true).build()); + + _minigameCycle.add(new ItemBuilder(Material.LEATHER_BOOTS) + .setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Play all of these fun minigames:", + C.Reset + "", + C.Reset + "Super Spleef", + C.Reset + "Runner", + C.Reset + "Dragons", + C.Reset + "One in the Quiver", + C.Reset + C.Bold + C.cGreen + "Dragon Escape", + C.Reset + "Sneaky Assassins", + C.Reset + "Micro Battle", + C.Reset + "Super Paintball", + C.Reset + "Turf Wars", + C.Reset + "Death Tag", + C.Reset + "Bacon Brawl", + C.Reset + "", + C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!", + }).setHideInfo(true).build()); + + _minigameCycle.add(new ItemBuilder(Material.MILK_BUCKET) + .setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Play all of these fun minigames:", + C.Reset + "", + C.Reset + "Super Spleef", + C.Reset + "Runner", + C.Reset + "Dragons", + C.Reset + "One in the Quiver", + C.Reset + "Dragon Escape", + C.Reset + C.Bold + C.cGreen + "Sneaky Assassins", + C.Reset + "Micro Battle", + C.Reset + "Super Paintball", + C.Reset + "Turf Wars", + C.Reset + "Death Tag", + C.Reset + "Bacon Brawl", + C.Reset + "", + C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!", + }).setHideInfo(true).build()); + + _minigameCycle.add(new ItemBuilder(Material.MILK_BUCKET) + .setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Play all of these fun minigames:", + C.Reset + "", + C.Reset + "Super Spleef", + C.Reset + "Runner", + C.Reset + "Dragons", + C.Reset + "One in the Quiver", + C.Reset + "Dragon Escape", + C.Reset + "Sneaky Assassins", + C.Reset + C.Bold + C.cGreen + "Micro Battle", + C.Reset + "Super Paintball", + C.Reset + "Turf Wars", + C.Reset + "Death Tag", + C.Reset + "Bacon Brawl", + C.Reset + "", + C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!", + }).setHideInfo(true).build()); + + _minigameCycle.add(new ItemBuilder(Material.DIAMOND_BARDING) + .setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Play all of these fun minigames:", + C.Reset + "", + C.Reset + "Super Spleef", + C.Reset + "Runner", + C.Reset + "Dragons", + C.Reset + "One in the Quiver", + C.Reset + "Dragon Escape", + C.Reset + "Sneaky Assassins", + C.Reset + "Micro Battle", + C.Reset + C.Bold + C.cGreen + "Super Paintball", + C.Reset + "Turf Wars", + C.Reset + "Death Tag", + C.Reset + "Bacon Brawl", + C.Reset + "", + C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!", + }).setHideInfo(true).build()); + + _minigameCycle.add(new ItemBuilder(Material.STAINED_CLAY, 1, (byte) 14) + .setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Play all of these fun minigames:", + C.Reset + "", + C.Reset + "Super Spleef", + C.Reset + "Runner", + C.Reset + "Dragons", + C.Reset + "One in the Quiver", + C.Reset + "Dragon Escape", + C.Reset + "Sneaky Assassins", + C.Reset + "Micro Battle", + C.Reset + "Super Paintball", + C.Reset + C.Bold + C.cGreen + "Turf Wars", + C.Reset + "Death Tag", + C.Reset + "Bacon Brawl", + C.Reset + "", + C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!", + }).setHideInfo(true).build()); + + _minigameCycle.add(new ItemBuilder(Material.IRON_BOOTS) + .setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Play all of these fun minigames:", + C.Reset + "", + C.Reset + "Super Spleef", + C.Reset + "Runner", + C.Reset + "Dragons", + C.Reset + "One in the Quiver", + C.Reset + "Dragon Escape", + C.Reset + "Sneaky Assassins", + C.Reset + "Micro Battle", + C.Reset + "Super Paintball", + C.Reset + "Turf Wars", + C.Reset + C.Bold + C.cGreen + "Death Tag", + C.Reset + "Bacon Brawl", + C.Reset + "", + C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!", + }).setHideInfo(true).build()); + + _minigameCycle.add(new ItemBuilder(Material.PORK) + .setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[] + { + C.Reset + "", + C.Reset + "Play all of these fun minigames:", + C.Reset + "", + C.Reset + "Super Spleef", + C.Reset + "Runner", + C.Reset + "Dragons", + C.Reset + "One in the Quiver", + C.Reset + "Dragon Escape", + C.Reset + "Sneaky Assassins", + C.Reset + "Micro Battle", + C.Reset + "Super Paintball", + C.Reset + "Turf Wars", + C.Reset + "Death Tag", + C.Reset + C.Bold + C.cGreen + "Bacon Brawl", + C.Reset + "", + C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!", + }).setHideInfo(true).build()); } private void createSuperSmashCycle() { - String[] desc = new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + "Pick from a selection of monsters,", - ChatColor.RESET + "then battle other players to the ", - ChatColor.RESET + "death with your monsters skills!", - ChatColor.RESET + "", - ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("SSM") + getPlugin().getGroupTagPlayerCount("SSM2")) + ChatColor.RESET + " other players!", - }; - - _superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)4, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch", desc)); + String[] desc = new String[] + { + C.Reset + "", + C.Reset + "Pick from a selection of monsters,", + C.Reset + "then battle other players to the ", + C.Reset + "death with your monsters skills!", + C.Reset + "", + C.Reset + "Join " + C.cGreen + + (getPlugin().getGroupTagPlayerCount("SSM") + getPlugin().getGroupTagPlayerCount("SSM2")) + C.Reset + + " other players!", + }; + + _superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 4) + .setTitle(C.Reset + C.Bold + C.cYellow + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc) + .setHideInfo(true).build()); } public void Update() { _ssmIndex++; _minigameIndex++; - + if (_ssmIndex >= _superSmashCycle.size()) _ssmIndex = 0; - + if (_minigameIndex >= _minigameCycle.size()) _minigameIndex = 0; - + buildPage(); } @@ -491,12 +517,12 @@ public class ServerGameMenu extends ShopPageBase { getPlugin().getCastleSiegeShop().attemptShopOpen(player); } - + public void OpenBR(Player player) { getPlugin().getBridgesShop().attemptShopOpen(player); } - + public void OpenBH(Player player) { getPlugin().getBlockHuntShop().attemptShopOpen(player); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerTypePage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerTypePage.java index 3c909f545..2f05cb7ad 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerTypePage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerTypePage.java @@ -18,6 +18,7 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.UtilTime; import mineplex.core.donation.DonationManager; import mineplex.core.game.GameDisplay; +import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.shop.item.IButton; import mineplex.core.shop.item.ShopItem; @@ -35,11 +36,11 @@ public class ServerTypePage extends ShopPageBase private ServerGroup _serverGroup; - public ServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager, - Player player, ServerGroup serverGroup) + public ServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, + DonationManager donationManager, Player player, ServerGroup serverGroup) { super(plugin, shop, clientManager, donationManager, serverGroup.getServerNpcName(), player, 27); - + _serverGroup = serverGroup; buildPage(); @@ -49,23 +50,25 @@ public class ServerTypePage extends ShopPageBase protected void buildPage() { String friendlyName = _serverGroup.getServerNpcName(); - - setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 1, ChatColor.RESET + C.cYellow + "Solo " + friendlyName, new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + C.cRed + C.Bold + "WARNING: " + ChatColor.RESET + "Teaming in Solo Mode is bannable!", - ChatColor.RESET + "", - ChatColor.RESET + C.cGreen + "Click to Play", - })); - - setItem(14, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 2, ChatColor.RESET + C.cYellow + "Team " + friendlyName, new String[] - { - ChatColor.RESET + "", - ChatColor.RESET + C.cGray + "2 Player Teams", - ChatColor.RESET + "", - ChatColor.RESET + C.cGreen + "Click to Play" - })); - + + setItem(12, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setTitle(C.Reset + C.cYellow + "Solo " + friendlyName) + .addLore(new String[] + { + C.Reset + "", + C.Reset + C.cRed + C.Bold + "WARNING: " + C.Reset + "Teaming in Solo Mode is bannable!", + C.Reset + "", + C.Reset + C.cGreen + "Click to Play", + }).build()); + + setItem(14, new ItemBuilder(Material.SKULL_ITEM, 2, (byte) 3).setTitle(C.Reset + C.cYellow + "Team " + friendlyName) + .addLore(new String[] + { + C.Reset + "", + C.Reset + C.cGray + "2 Player Teams", + C.Reset + "", + C.Reset + C.cGreen + "Click to Play" + }).build()); + getButtonMap().put(12, new SelectTypeButton(this, false)); getButtonMap().put(14, new SelectTypeButton(this, true)); } @@ -77,14 +80,16 @@ public class ServerTypePage extends ShopPageBase } public void selectServer(Player player, boolean team) - { + { if (team) { - getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), _serverGroup.getServerNpcName() + " Teams", player, _serverGroup.getTeamServerKey())); + getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), + getDonationManager(), _serverGroup.getServerNpcName() + " Teams", player, _serverGroup.getTeamServerKey())); } else { - getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), _serverGroup.getServerNpcName() + " Solo", player, _serverGroup.getPrefix())); + getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), + getDonationManager(), _serverGroup.getServerNpcName() + " Solo", player, _serverGroup.getPrefix())); } } } From e7213fdb7e212986226022ecdd676df75e78da38 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 13 Dec 2015 16:41:37 +1300 Subject: [PATCH 28/41] Remove project specific settings --- .../.settings/org.eclipse.jdt.core.prefs | 11 ----------- .../.settings/org.eclipse.jdt.core.prefs | 11 ----------- .../.settings/org.eclipse.jdt.core.prefs | 11 ----------- .../.settings/org.eclipse.jdt.core.prefs | 12 ------------ .../.settings/org.eclipse.jdt.core.prefs | 11 ----------- .../.settings/org.eclipse.jdt.core.prefs | 11 ----------- .../.settings/org.eclipse.jdt.core.prefs | 11 ----------- .../.settings/org.eclipse.jdt.core.prefs | 11 ----------- .../.settings/org.eclipse.jdt.core.prefs | 11 ----------- .../.settings/org.eclipse.jdt.core.prefs | 11 ----------- .../.settings/org.eclipse.jdt.core.prefs | 11 ----------- .../.settings/org.eclipse.jdt.core.prefs | 11 ----------- .../.settings/org.eclipse.jdt.core.prefs | 15 --------------- 13 files changed, 148 deletions(-) delete mode 100644 Plugins/Mineplex.Bungee.Mineplexer/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Mineplex.BungeeRotator/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Mineplex.Core.Common/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Mineplex.DDoSProtectionSwitcher/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Mineplex.EnjinTranslator/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Mineplex.Game.Clans/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Mineplex.Hub/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Mineplex.MapParser/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Mineplex.Minecraft.Game.ClassCombat/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Mineplex.Minecraft.Game.Core/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Mineplex.PlayerCache/.settings/org.eclipse.jdt.core.prefs delete mode 100644 Plugins/Nautilus.Game.Arcade/.settings/org.eclipse.jdt.core.prefs diff --git a/Plugins/Mineplex.Bungee.Mineplexer/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.Bungee.Mineplexer/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7341ab168..000000000 --- a/Plugins/Mineplex.Bungee.Mineplexer/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.BungeeRotator/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.BungeeRotator/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7341ab168..000000000 --- a/Plugins/Mineplex.BungeeRotator/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.Core.Common/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.Core.Common/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7341ab168..000000000 --- a/Plugins/Mineplex.Core.Common/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index d17b6724d..000000000 --- a/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.DDoSProtectionSwitcher/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.DDoSProtectionSwitcher/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7341ab168..000000000 --- a/Plugins/Mineplex.DDoSProtectionSwitcher/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.EnjinTranslator/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.EnjinTranslator/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7341ab168..000000000 --- a/Plugins/Mineplex.EnjinTranslator/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.Game.Clans/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.Game.Clans/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7341ab168..000000000 --- a/Plugins/Mineplex.Game.Clans/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.Hub/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.Hub/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7341ab168..000000000 --- a/Plugins/Mineplex.Hub/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.MapParser/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.MapParser/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7341ab168..000000000 --- a/Plugins/Mineplex.MapParser/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.Minecraft.Game.ClassCombat/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7341ab168..000000000 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.Minecraft.Game.Core/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.Minecraft.Game.Core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7341ab168..000000000 --- a/Plugins/Mineplex.Minecraft.Game.Core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Mineplex.PlayerCache/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.PlayerCache/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7341ab168..000000000 --- a/Plugins/Mineplex.PlayerCache/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/Plugins/Nautilus.Game.Arcade/.settings/org.eclipse.jdt.core.prefs b/Plugins/Nautilus.Game.Arcade/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index bfbbfb4d1..000000000 --- a/Plugins/Nautilus.Game.Arcade/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,15 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert From 011a194dc641a5ae67d76b07c39bf428df0d60a2 Mon Sep 17 00:00:00 2001 From: Cheese Date: Sun, 13 Dec 2015 21:14:57 +1100 Subject: [PATCH 29/41] fixed exploit --- .../src/nautilus/game/arcade/managers/HolidayManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java index ba2c0d8cd..2328f93dc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java @@ -304,14 +304,16 @@ public class HolidayManager implements Listener if (Manager.GetGame() != null && !Manager.GetGame().IsAlive(event.getPlayer())) return; - if (!_active.contains(event.getClickedBlock())) - return; - specialBlockBreak(event.getPlayer(), event.getClickedBlock()); } private void specialBlockBreak(Player player, final Block block) { + if (!_active.contains(block)) + return; + + _active.remove(block); + block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, type.getBlockType()); block.setType(Material.AIR); From 35ab40727bee2035cc21a71f7494b54126d8abd1 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 18:55:21 -0500 Subject: [PATCH 30/41] XMAS UPDATE OMG :O --- Plugins/Mineplex.Core/.classpath | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 6 +- .../mineplex/hub/server/ServerManager.java | 2 +- .../hub/server/ui/ServerGameMenu.java | 4 +- .../src/nautilus/game/arcade/game/Game.java | 39 ++- .../nautilus/game/arcade/game/SoloGame.java | 12 +- .../game/games/christmas/Christmas.java | 140 +++++++++-- .../arcade/game/games/christmas/Sleigh.java | 235 +++++++++++------- .../game/games/christmas/SleighHorse.java | 34 +-- .../game/games/christmas/SleighPart.java | 93 ++++--- .../games/christmas/content/BossFloor.java | 24 +- .../game/games/christmas/content/IceMaze.java | 27 +- .../games/christmas/content/SnowmanBoss.java | 16 +- .../games/christmas/content/SnowmanMaze.java | 109 +++++--- .../christmas/content/SnowmanWaypoint.java | 6 + .../game/games/christmas/kits/KitPlayer.java | 19 +- .../game/games/christmas/parts/Part.java | 147 +++++++---- .../game/games/christmas/parts/Part1.java | 36 ++- .../game/games/christmas/parts/Part4.java | 43 ++-- .../game/games/christmas/parts/Part5.java | 37 ++- 20 files changed, 682 insertions(+), 349 deletions(-) diff --git a/Plugins/Mineplex.Core/.classpath b/Plugins/Mineplex.Core/.classpath index ea3a54132..067e728d7 100644 --- a/Plugins/Mineplex.Core/.classpath +++ b/Plugins/Mineplex.Core/.classpath @@ -1,7 +1,7 @@ - + diff --git a/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs index d17b6724d..a698e5967 100644 --- a/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs +++ b/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs @@ -1,12 +1,12 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index 10f889fce..83962381a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -862,7 +862,7 @@ public class ServerManager extends MiniPlugin public ShopBase getMinestrikeShop() { - return _serverNpcShopMap.get("Mine-Strike"); + return _serverNpcShopMap.get("MineStrike"); } public ShopBase getWizardShop() diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 4e3bc8320..f33ab68fe 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -4,8 +4,8 @@ import java.util.ArrayList; import java.util.List; import org.bukkit.ChatColor; -import org.bukkit.entity.Player; import org.bukkit.Material; +import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import mineplex.core.account.CoreClientManager; @@ -127,7 +127,7 @@ public class ServerGameMenu extends ShopPageBase setItem(22, _superSmashCycle.get(_ssmIndex)); - setItem(24, ItemStackFactory.Instance.CreateStack(Material.TNT.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Mine-Strike " + C.cGray + "Team Survival", new String[] + setItem(24, ItemStackFactory.Instance.CreateStack(Material.TNT.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "MineStrike" + C.cGray + "Team Survival", new String[] { ChatColor.RESET + "", ChatColor.RESET + "One team must defend two bomb sites from", 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 832053604..1d6947f06 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 @@ -1,6 +1,5 @@ package nautilus.game.arcade.game; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -36,7 +35,6 @@ import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.hanging.HangingBreakEvent; import org.bukkit.event.hanging.HangingPlaceEvent; -import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.world.WorldLoadEvent; @@ -54,8 +52,8 @@ import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTabTitle; -import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTextMiddle; +import mineplex.core.common.util.UtilTime; import mineplex.core.disguise.disguises.DisguisePlayer; import mineplex.core.itemstack.ItemBuilder; import mineplex.core.packethandler.IPacketHandler; @@ -72,18 +70,24 @@ import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.PlayerGameRespawnEvent; import nautilus.game.arcade.events.PlayerStateChangeEvent; import nautilus.game.arcade.game.GameTeam.PlayerState; -import nautilus.game.arcade.gametutorial.GameTutorial; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.managers.GameLobbyManager; import nautilus.game.arcade.scoreboard.GameScoreboard; -import nautilus.game.arcade.stats.*; +import nautilus.game.arcade.stats.AssistsStatTracker; +import nautilus.game.arcade.stats.DamageDealtStatTracker; +import nautilus.game.arcade.stats.DamageTakenStatTracker; +import nautilus.game.arcade.stats.DeathsStatTracker; +import nautilus.game.arcade.stats.ExperienceStatTracker; +import nautilus.game.arcade.stats.GamesPlayedStatTracker; +import nautilus.game.arcade.stats.KillsStatTracker; +import nautilus.game.arcade.stats.LoseStatTracker; +import nautilus.game.arcade.stats.StatTracker; +import nautilus.game.arcade.stats.WinStatTracker; import nautilus.game.arcade.world.WorldData; import net.minecraft.server.v1_8_R3.EntityItem; import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity; -import net.minecraft.server.v1_8_R3.PacketPlayOutScoreboardTeam; -import net.minecraft.server.v1_8_R3.ScoreboardTeam; import net.minecraft.server.v1_8_R3.WorldServer; public abstract class Game implements Listener @@ -124,6 +128,7 @@ public abstract class Game implements Listener private boolean _countdownForce = false; private String _customWinLine = ""; + private NautHashMap _customWinMessages = new NautHashMap(); // Kits private Kit[] _kits; @@ -492,6 +497,11 @@ public abstract class Game implements Listener { _customWinLine = line; } + + public void SetCustomWinMessage(Player player, String message) + { + _customWinMessages.put(player, message); + } public GameScoreboard GetScoreboard() { @@ -1156,7 +1166,20 @@ public abstract class Game implements Listener UtilPlayer.message(player, "Nobody won the game!"); } - UtilPlayer.message(player, _customWinLine); + if (_customWinMessages.containsKey(player)) + { + if (!_customWinLine.trim().equalsIgnoreCase("")) + { + UtilPlayer.message(player, _customWinLine); + } + + UtilPlayer.message(player, _customWinMessages.get(player)); + } + else + { + UtilPlayer.message(player, _customWinLine); + } + UtilPlayer.message(player, ""); UtilPlayer.message(player, "§aMap - §f§l" + WorldData.MapName + C.cGray + " created by " + "§f§l" + WorldData.MapAuthor); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java index 7384a3cc6..3d5ca5cf0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java @@ -1,8 +1,9 @@ package nautilus.game.arcade.game; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; -import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -13,8 +14,6 @@ import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.events.PlayerStateChangeEvent; -import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.kit.Kit; public abstract class SoloGame extends Game @@ -36,6 +35,11 @@ public abstract class SoloGame extends Game _players.SetColor(ChatColor.YELLOW); _players.SetName("Players"); } + + public GameTeam getPlayersTeam() + { + return _players; + } @Override public void EndCheck() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java index a508ff1cd..ebe29c61b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java @@ -1,6 +1,5 @@ package nautilus.game.arcade.game.games.christmas; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; @@ -8,9 +7,8 @@ import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_8_R3.CraftServer; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; -import org.bukkit.entity.EntityType; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftHorse; import org.bukkit.entity.Player; import org.bukkit.entity.Villager; import org.bukkit.event.EventHandler; @@ -18,13 +16,16 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.HandlerList; import org.bukkit.event.block.BlockFadeEvent; import org.bukkit.event.entity.EntityCombustEvent; -import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerInteractAtEntityEvent; import org.bukkit.util.Vector; import mineplex.core.common.util.C; +import mineplex.core.common.util.Callback; +import mineplex.core.common.util.F; import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilMath; @@ -34,7 +35,6 @@ import mineplex.core.common.util.UtilTime; import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.PacketInfo; import mineplex.core.recharge.Recharge; -import mineplex.core.reward.rewards.PetReward; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; @@ -45,14 +45,22 @@ import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.christmas.kits.KitPlayer; -import nautilus.game.arcade.game.games.christmas.parts.*; +import nautilus.game.arcade.game.games.christmas.parts.Part; +import nautilus.game.arcade.game.games.christmas.parts.Part1; +import nautilus.game.arcade.game.games.christmas.parts.Part2; +import nautilus.game.arcade.game.games.christmas.parts.Part3; +import nautilus.game.arcade.game.games.christmas.parts.Part4; +import nautilus.game.arcade.game.games.christmas.parts.Part5; import nautilus.game.arcade.kit.Kit; +import net.minecraft.server.v1_8_R3.PacketPlayOutAttachEntity; import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy; import net.minecraft.server.v1_8_R3.PacketPlayOutNamedSoundEffect; import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving; public class Christmas extends SoloGame { + private GameTeam _badGuys; + private Sleigh _sleigh; private Location _sleighSpawn; @@ -201,7 +209,7 @@ public class Christmas extends SoloGame for (Location loc : WorldData.GetCustomLocs("129")) { _barrier.add(loc.getBlock().getLocation()); - MapUtil.QuickChangeBlockAt(loc, 65, (byte)3); + MapUtil.QuickChangeBlockAt(loc, 166, (byte)0); } //Parts @@ -250,7 +258,8 @@ public class Christmas extends SoloGame if (event.GetState() != GameState.Live) return; - GetTeamList().add(new GameTeam(this, "Christmas Thieves", ChatColor.RED, WorldData.GetDataLocs("RED"))); + _badGuys = new GameTeam(this, "Christmas Thieves", ChatColor.RED, WorldData.GetDataLocs("RED")); + AddTeam(_badGuys); } @EventHandler @@ -366,7 +375,7 @@ public class Christmas extends SoloGame for (Location loc : _barrier) { - if (UtilMath.offset(GetSleigh().GetLocation(), loc) > 15) + if (UtilMath.offset(GetSleigh().GetLocation(), loc) > 20) continue; breakAt = loc; @@ -458,14 +467,39 @@ public class Christmas extends SoloGame for (Player player : GetPlayers(false)) { - Manager.rewardPet(player, "Christmas Elf", EntityType.VILLAGER); + if (Manager.IsRewardItems()) + { + if (Manager.GetTaskManager().hasCompletedTask(player, "CC Reward 2015")) + { + SetCustomWinMessage(player, "You already earned your reward"); + } + else + { + SetCustomWinMessage(player, "You earned " + C.cYellow + "Winter Chest x2"); + + Manager.GetTaskManager().completedTask(new Callback() + { + @Override + public void run(Boolean data) + { + if (data) + { + Manager.getInventoryManager().addItemToInventory(player, "Winter Chest", 2); + } + else + { + UtilPlayer.message(player, F.main("Inventory", "An error occured while giving you " + C.cRed + "Winter Chest x2" + C.cGray + ".")); + } + } + }, player, "CC Reward 2015"); + } + } Manager.GetGame().AddGems(player, 30, "Slaying the Pumpkin King", false, false); Manager.GetGame().AddGems(player, 10, "Participation", false, false); } - SetCustomWinLine("You earned Christmas Elf Pet!"); - AnnounceEnd(this.GetTeamList().get(0)); + AnnounceEnd(getPlayersTeam()); SetState(GameState.End); } else if (GetPlayers(true).size() == 0) @@ -476,7 +510,7 @@ public class Christmas extends SoloGame } SetCustomWinLine("You all died..."); - AnnounceEnd(this.GetTeamList().get(1)); + AnnounceEnd(_badGuys); SetState(GameState.End); } else if (UtilTime.elapsed(GetStateTime(), _gameTime)) @@ -487,7 +521,7 @@ public class Christmas extends SoloGame } SetCustomWinLine("You did not save Christmas in time."); - AnnounceEnd(this.GetTeamList().get(1)); + AnnounceEnd(_badGuys); SetState(GameState.End); } @@ -504,7 +538,7 @@ public class Christmas extends SoloGame } SetCustomWinLine("Santa Claus was killed by the Giant!"); - AnnounceEnd(this.GetTeamList().get(1)); + AnnounceEnd(_badGuys); SetState(GameState.End); } @@ -572,30 +606,55 @@ public class Christmas extends SoloGame return; if (!IsLive()) + { + Scoreboard.Reset(); + + String line = ""; + for (int i = 0 ; i < 10 ; i++) + line += ((i % 2 == 0 ? C.cRed : C.cDGreen) + "█"); + + Scoreboard.WriteBlank(); + Scoreboard.Write(line); + + Scoreboard.WriteBlank(); + + Scoreboard.Write(C.cWhiteB + "May your winter"); + Scoreboard.Write(C.cWhiteB + "be filled with " + C.cYellowB + "joy" + C.cWhiteB + " and " + C.cYellowB + "cheer" + C.cWhiteB + "."); + + Scoreboard.WriteBlank(); + + Scoreboard.Write(C.cWhite + "Happy Holidays!"); + Scoreboard.Write(C.cWhiteB + "- Your friends at " + C.cGoldB + "MINEPLEX"); + + Scoreboard.WriteBlank(); + Scoreboard.Write(line); + + Scoreboard.Draw(); return; + } //Wipe Last Scoreboard.Reset(); //Rounds Scoreboard.WriteBlank(); - Scoreboard.Write(C.cWhite + "Challenge:"); - Scoreboard.Write(C.cYellow + (5 - _parts.size()) + " of " + 5); + Scoreboard.Write(C.cGoldB + "Challenge"); + Scoreboard.Write(C.cWhite + (5 - _parts.size()) + " of " + 5); //Presents Scoreboard.WriteBlank(); - Scoreboard.Write(C.cWhite + "Presents:"); - Scoreboard.Write(C.cYellow + GetSleigh().GetPresents().size() + " of " + 10); + Scoreboard.Write(C.cGreenB + "Presents"); + Scoreboard.Write(C.cWhite + GetSleigh().GetPresents().size() + " of " + 10); //Players Scoreboard.WriteBlank(); - Scoreboard.Write(C.cWhite + "Players:"); - Scoreboard.Write(C.cYellow + GetPlayers(true).size()); + Scoreboard.Write(C.cYellowB + "Players"); + Scoreboard.Write(C.cWhite + GetPlayers(true).size()); //Time Scoreboard.WriteBlank(); - Scoreboard.Write(C.cWhite + "Time Left:"); - Scoreboard.Write(C.cYellow + UtilTime.MakeStr(_gameTime - (System.currentTimeMillis() - GetStateTime()))); + Scoreboard.Write(C.cYellowB + "Time Left"); + Scoreboard.Write(C.cWhite + UtilTime.MakeStr(_gameTime - (System.currentTimeMillis() - GetStateTime()))); Scoreboard.Draw(); } @@ -679,4 +738,37 @@ public class Christmas extends SoloGame UtilPlayer.sendPacket(player, packet); } } + + @EventHandler + public void updateReigns(UpdateEvent event) + { + if (!InProgress()) + return; + + if (event.getType() != UpdateType.FASTER) + return; + + if (_sleigh == null) + return; + + if (_sleigh.getSanta() == null) + return; + + for (SleighHorse horse : _sleigh.getHorses()) + { + if (horse.Ent == null || !horse.Ent.isValid()) + continue; + + PacketPlayOutAttachEntity packet = new PacketPlayOutAttachEntity(1, ((CraftHorse) horse.Ent).getHandle(), (((CraftEntity) _sleigh.getSanta()).getHandle())); + + for (Player player : UtilServer.getPlayers()) + UtilPlayer.sendPacket(player, packet); + } + } + + @EventHandler + public void preventStand(PlayerInteractAtEntityEvent event) + { + event.setCancelled(true); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java index c4c5e0950..a41031b6c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java @@ -2,30 +2,28 @@ package nautilus.game.arcade.game.games.christmas; import java.util.ArrayList; +import org.bukkit.ChatColor; +import org.bukkit.Color; +import org.bukkit.Effect; +import org.bukkit.FireworkEffect; +import org.bukkit.FireworkEffect.Type; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Chicken; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.util.Vector; + import mineplex.core.common.util.C; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilFirework; -import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.recharge.Recharge; import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.game.games.christmas.parts.Part; - -import org.bukkit.ChatColor; -import org.bukkit.Color; -import org.bukkit.Effect; -import org.bukkit.FireworkEffect; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.FireworkEffect.Type; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.Chicken; -import org.bukkit.entity.Entity; -import org.bukkit.entity.FallingBlock; -import org.bukkit.entity.Player; -import org.bukkit.util.Vector; public class Sleigh { @@ -41,6 +39,8 @@ public class Sleigh private ArrayList PresentsCollected = new ArrayList();; private Location Target; + + private Entity Santa; public void setupSleigh(Christmas host, Location loc) { @@ -52,24 +52,25 @@ public class Sleigh CentralEntity = loc.getWorld().spawn(loc, Chicken.class); UtilEnt.Vegetate(CentralEntity, true); - UtilEnt.ghost(CentralEntity, true, true); + UtilEnt.ghost(CentralEntity, true, false); + Host.Manager.GetCondition().Factory().Invisible("Sleigh", (LivingEntity) CentralEntity, null, Double.MAX_VALUE, 3, false, false, true); //Presents PresentSlots = new ArrayList(); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), -1, -2)); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 0, -2)); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 1, -2)); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), -1, -1)); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 0, -1)); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 1, -1)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), -1, -2)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 0, -2)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 1, -2)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), -1, -1)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 0, -1)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 1, -1)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), -1, -2)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 0, -2)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 1, -2)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), -1, -1)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 0, -1)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 1, -1)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), -1, -2)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 0, -2)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 1, -2)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), -1, -1)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 0, -1)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 1, -1)); //Sleigh SleighEnts = new ArrayList(); @@ -77,65 +78,71 @@ public class Sleigh for (SleighPart part : PresentSlots) SleighEnts.add(part); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 0, -3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -1, -3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, -3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 1, -3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, -3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 0, -3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -1, -3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, -3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 1, -3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, -3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, -2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, -2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 0, -2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, -2)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, -2)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, -2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, -2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 0, -2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, -2)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, -2)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, -1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, -1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 0, -1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, -1)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, -1)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, -1)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, -1)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 0, -1)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, -1)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, -1)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, 0)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -1, 0)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 0, 0)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 1, 0)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, 0)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, 0)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -1, 0)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 0, 0)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 1, 0)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, 0)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, 1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, 1)); - SleighEnts.add(new SleighPart(0, 159, 15, loc.clone(), 0, 1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, 1)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, 1)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, 1)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, 1)); + SleighEnts.add(new SleighPart(this, 0, 159, 15, loc.clone(), 0, 1)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, 1)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, 1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -2, 2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, 2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 0, 2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, 2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 2, 2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -2, 2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, 2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 0, 2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, 2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 2, 2)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, 3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -1, 3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 0, 3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 1, 3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, 3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, 3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -1, 3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 0, 3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 1, 3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, 3)); //Santa - SleighPart santa = new SleighPart(3, 0, 0, loc.clone(), 0, 1); - santa.AddSanta(); + SleighPart santa = new SleighPart(this, 3, 0, 0, loc.clone(), 0, 1); + Santa = santa.AddSanta(); SleighEnts.add(santa); - SleighHorses.add(new SleighHorse(loc.clone(), -1.5, 8)); - SleighHorses.add(new SleighHorse(loc.clone(), 1.5, 8)); + SleighHorses.add(new SleighHorse(loc.clone(), "Dasher", -1.5, 8)); + SleighHorses.add(new SleighHorse(loc.clone(), "Dancer", 1.5, 8)); + + SleighHorses.add(new SleighHorse(loc.clone(), "Prancer", -1.5, 11)); + SleighHorses.add(new SleighHorse(loc.clone(), "Vixen", 1.5, 11)); + + SleighHorses.add(new SleighHorse(loc.clone(), "Comet", -1.5, 14)); + SleighHorses.add(new SleighHorse(loc.clone(), "Cupid", 1.5, 14)); - SleighHorses.add(new SleighHorse(loc.clone(), -1.5, 11)); - SleighHorses.add(new SleighHorse(loc.clone(), 1.5, 11)); + SleighHorses.add(new SleighHorse(loc.clone(), "Donner", -1.5, 17)); + SleighHorses.add(new SleighHorse(loc.clone(), "Blitzen", 1.5, 17)); for (SleighHorse horse : SleighHorses) horse.spawnHorse(); - for (SleighHorse horse : SleighHorses) - UtilEnt.Leash(horse.Ent, santa.GetTop(), false, false); +// for (SleighHorse horse : SleighHorses) +// UtilEnt.Leash(horse.Ent, santa.GetTop(), true, false); } public Location GetLocation() @@ -157,6 +164,8 @@ public class Sleigh Move(CentralEntity, Target, 1); + Santa.setTicksLived(1); + //Move Sleigh for (SleighPart part : SleighEnts) { @@ -184,24 +193,6 @@ public class Sleigh { for (Player player : Host.GetPlayers(true)) { - if (!Recharge.Instance.usable(player, "Sleigh Bump")) - continue; - - for (SleighPart part : SleighEnts) - if (UtilMath.offset(player, part.Ent) < 1) - { - UtilAction.velocity(player, UtilAlg.getTrajectory2d(CentralEntity, player), 0.4, true, 0.2, 0, 0, true); - Recharge.Instance.useForce(player, "Sleigh Bump", 400); - } - - - for (SleighHorse part : SleighHorses) - if (UtilMath.offset(player, part.Ent) < 1) - { - UtilAction.velocity(player, UtilAlg.getTrajectory2d(CentralEntity, player), 0.4, true, 0.2, 0, 0, true); - Recharge.Instance.useForce(player, "Sleigh Bump", 400); - } - if (player.getLocation().getZ() < CentralEntity.getLocation().getZ() - 24) { player.damage(1); @@ -211,6 +202,64 @@ public class Sleigh Recharge.Instance.useForce(player, "Sleigh Bump", 400); } } + + for (SleighPart part : SleighEnts) + { + for (Entity ent : UtilEnt.getInRadius(part.Ent.getLocation(), 1).keySet()) + { + boolean matches = false; + for (SleighPart cur : SleighEnts) + { + if (ent instanceof LivingEntity && cur.HasEntity((LivingEntity) ent)) + { + matches = true; + break; + } + } + + if (matches) + continue; + + if (ent instanceof Player) + { + if (!Recharge.Instance.usable((Player) ent, "Sleigh Bump")) + continue; + + Recharge.Instance.useForce((Player) ent, "Sleigh Bump", 400); + } + + UtilAction.velocity(ent, UtilAlg.getTrajectory2d(CentralEntity, ent), 0.4, true, 0.2, 0, 0, true); + } + } + + for (SleighHorse part : SleighHorses) + { + for (Entity ent : UtilEnt.getInRadius(part.Ent.getLocation(), 1).keySet()) + { + boolean matches = false; + for (SleighPart cur : SleighEnts) + { + if (ent instanceof LivingEntity && cur.HasEntity((LivingEntity) ent)) + { + matches = true; + break; + } + } + + if (matches) + continue; + + if (ent instanceof Player) + { + if (!Recharge.Instance.usable((Player) ent, "Sleigh Bump")) + continue; + + Recharge.Instance.useForce((Player) ent, "Sleigh Bump", 400); + } + + UtilAction.velocity(ent, UtilAlg.getTrajectory2d(CentralEntity, ent), 0.4, true, 0.2, 0, 0, true); + } + } } public boolean HasPresent(Location loc) @@ -222,6 +271,7 @@ public class Sleigh { PresentsCollected.add(loc); loc.getBlock().setType(Material.AIR); + loc.getBlock().getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN).setType(Material.IRON_BLOCK); loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.GLASS); UtilFirework.launchFirework(loc.clone().add(0.5, 0.5, 0.5), FireworkEffect.builder().flicker(false).withColor(Color.YELLOW).with(Type.BALL).trail(true).build(), new Vector(0,1,0), 0); @@ -267,4 +317,9 @@ public class Sleigh { return SleighHorses; } + + public Entity getSanta() + { + return Santa; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighHorse.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighHorse.java index 10a772184..0f0e5ed2f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighHorse.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighHorse.java @@ -2,6 +2,19 @@ package nautilus.game.arcade.game.games.christmas; import java.util.HashSet; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; +import org.bukkit.entity.Horse; +import org.bukkit.entity.Horse.Color; +import org.bukkit.entity.Horse.Style; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.C; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilPlayer; import net.minecraft.server.v1_8_R3.DataWatcher; @@ -14,19 +27,6 @@ import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport; import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving; import net.minecraft.server.v1_8_R3.Vector3f; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; -import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; -import org.bukkit.entity.Horse; -import org.bukkit.entity.Player; -import org.bukkit.entity.Horse.Color; -import org.bukkit.entity.Horse.Style; -import org.bukkit.entity.LivingEntity; -import org.bukkit.inventory.ItemStack; -import org.bukkit.util.Vector; - public class SleighHorse { private Location _lastFacing; @@ -40,9 +40,11 @@ public class SleighHorse public int horseId; public double OffsetX; public double OffsetZ; + public String Name; - public SleighHorse(Location loc, double x, double z) + public SleighHorse(Location loc, String name, double x, double z) { + Name = name; OffsetX = x; OffsetZ = z; _lastFacing = loc.add(x, 0.5, z); @@ -182,6 +184,10 @@ public class SleighHorse Ent = _lastFacing.getWorld().spawn(_lastFacing.subtract(0, 0.5, 0), Horse.class); UtilEnt.Vegetate(Ent); UtilEnt.ghost(Ent, true, false); + Ent.setRemoveWhenFarAway(false); + + Ent.setCustomName(C.cWhiteB + Name); + Ent.setCustomNameVisible(true); Ent.setStyle(Style.BLACK_DOTS); Ent.setColor(Color.BROWN); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java index 2c0406f27..877d36049 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java @@ -1,9 +1,5 @@ package nautilus.game.arcade.game.games.christmas; -import mineplex.core.common.util.C; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; - import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Material; @@ -16,6 +12,10 @@ import org.bukkit.entity.Skeleton; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.LeatherArmorMeta; +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; + public class SleighPart { public Chicken Ent; @@ -23,38 +23,32 @@ public class SleighPart public double OffsetX; public double OffsetZ; - public SleighPart(int rise, int id, int data, Location loc, double x, double z) + public int Rise; + public int Id; + public int Data; + public Location Location; + + public SleighPart(Sleigh sleigh, int rise, int id, int data, Location loc, double x, double z) { //Base Ent = loc.getWorld().spawn(loc.add(x, 0, z), Chicken.class); Ent.setBaby(); Ent.setAgeLock(true); + Ent.setRemoveWhenFarAway(false); + UtilEnt.Vegetate(Ent, true); - UtilEnt.ghost(Ent, true, true); - + UtilEnt.ghost(Ent, true, false); + sleigh.Host.Manager.GetCondition().Factory().Invisible("Sleigh", Ent, null, Double.MAX_VALUE, 3, false, false, true); + //Height - Chicken top = Ent; - for (int i=0 ; i _heightComparator = new Comparator() + { + @Override + public int compare(Block o1, Block o2) + { + if (o1.getLocation().getBlockY() == o2.getLocation().getBlockY()) + return 0; + + return o1.getLocation().getBlockY() > o2.getLocation().getBlockY() ? 1 : -1; + } + }; + public IceMaze(Christmas host, ArrayList mazeCorners, ArrayList mazeExits, Location[] presents) { Host = host; @@ -71,6 +84,8 @@ public class IceMaze if (_blocks.isEmpty()) return; + Collections.sort(_blocks, _heightComparator); + for (int i=0 ; i<20 ; i++) { if (_blocks.isEmpty()) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java index cae20e196..b97da2215 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java @@ -1,17 +1,15 @@ package nautilus.game.arcade.game.games.christmas.content; import java.util.ArrayList; +import java.util.List; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; -import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; import org.bukkit.entity.IronGolem; import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.IronGolem; import org.bukkit.entity.Player; -import org.bukkit.entity.Slime; import org.bukkit.entity.Snowball; import org.bukkit.entity.Snowman; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; @@ -147,7 +145,17 @@ public class SnowmanBoss else { if ((minion.Target == null || !minion.Target.isValid() || !Host.IsAlive(minion.Target)) && !Host.GetPlayers(true).isEmpty()) - minion.Target = UtilAlg.Random(Host.GetPlayers(true)); + { + List valid = new ArrayList(); + for (Player player : Host.GetPlayers(true)) + if (UtilMath.offset(player, minion.Ent) <= 25 && player.getLocation().getBlockY() >= minion.Ent.getLocation().getBlockY()) + valid.add(player); + + minion.Target = UtilAlg.Random(valid); + } + + if (minion.Target == null) + continue; //Move UtilEnt.CreatureMoveFast(minion.Ent, minion.Target.getLocation(), 1.6f); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java index 5aeecaa3b..140bcb805 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java @@ -6,17 +6,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Map.Entry; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilWorld; -import mineplex.core.recharge.Recharge; -import nautilus.game.arcade.game.games.christmas.Christmas; - import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; @@ -28,6 +17,16 @@ import org.bukkit.entity.Snowman; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.util.Vector; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.recharge.Recharge; +import nautilus.game.arcade.game.games.christmas.Christmas; +import nautilus.game.arcade.game.games.christmas.content.SnowmanWaypoint.CardinalDirection; + public class SnowmanMaze { private Christmas Host; @@ -163,48 +162,90 @@ public class SnowmanMaze if (south != null) nextBlock.add(south); if (east != null) nextBlock.add(east); if (west != null) nextBlock.add(west); - - //Random Direction - if (!nextBlock.isEmpty()) + + if(nextBlock.isEmpty()) { - data.getValue().Target = UtilAlg.Random(nextBlock).getLocation().add(0.5, 0, 0.5); - UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); + entIterator.remove(); + data.getKey().remove(); + continue; + } + + if(nextBlock.size() > 1 && data.getValue().Direction != CardinalDirection.NULL) // they can do a uturn if they're stuck + { + if(data.getValue().Direction == CardinalDirection.NORTH) + { + nextBlock.remove(south); + } + else if(data.getValue().Direction == CardinalDirection.SOUTH) + { + nextBlock.remove(north); + } + else if(data.getValue().Direction == CardinalDirection.WEST) + { + nextBlock.remove(east); + } + else if(data.getValue().Direction == CardinalDirection.EAST) + { + nextBlock.remove(west); + } + } + + if (nextBlock.isEmpty()) + { + entIterator.remove(); + data.getKey().remove(); + continue; + } + + //Random Direction + Location nextLoc = UtilAlg.Random(nextBlock).getLocation(); + data.getValue().Target = nextLoc.clone().add(0.5, 0, 0.5); + if(north != null && nextLoc.equals(north.getLocation())) + { + data.getValue().Direction = CardinalDirection.NORTH; + } + else if(south != null && nextLoc.equals(south.getLocation())) + { + data.getValue().Direction = CardinalDirection.SOUTH; + } + else if(east != null && nextLoc.equals(east.getLocation())) + { + data.getValue().Direction = CardinalDirection.EAST; + } + else if(west != null && nextLoc.equals(west.getLocation())) + { + data.getValue().Direction = CardinalDirection.WEST; } } - - //Timeout Move - if (UtilMath.offset(data.getKey().getLocation(), data.getValue().Last) > 0.1) - data.getValue().Time = System.currentTimeMillis(); - - if (UtilTime.elapsed(data.getValue().Time, 2000)) - UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); + + UtilEnt.CreatureMoveFast(data.getKey(), data.getValue().Target, 1.4f); } } - + private Block getTarget(Block start, Block cur, BlockFace face) { if (cur == null) cur = start; - + while (_waypoints.contains(cur.getRelative(face))) { cur = cur.getRelative(face); - + //Stop at intersection int count = 0; - - if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++; - if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++; - if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST))) count++; - if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST))) count++; - + + if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH)) && !_waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++; + if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH)) && !_waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++; + if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST)) && !_waypoints.contains(cur.getRelative(BlockFace.EAST))) count++; + if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST)) && !_waypoints.contains(cur.getRelative(BlockFace.WEST))) count++; + if (count > 1) break; } - + if (cur.equals(start)) return null; - + return cur; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaypoint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaypoint.java index 78e197277..22c0deabf 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaypoint.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaypoint.java @@ -6,6 +6,7 @@ public class SnowmanWaypoint { public Location Last; public Location Target; + public CardinalDirection Direction = CardinalDirection.NULL; public long Time; public SnowmanWaypoint(Location last) @@ -14,4 +15,9 @@ public class SnowmanWaypoint Target = null; Time = System.currentTimeMillis(); } + + public static enum CardinalDirection + { + NORTH, SOUTH, EAST, WEST, NULL // such order much not care + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/kits/KitPlayer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/kits/KitPlayer.java index 9af09d62b..3c3efcee3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/kits/KitPlayer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/kits/KitPlayer.java @@ -1,12 +1,15 @@ package nautilus.game.arcade.game.games.christmas.kits; +import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.C; +import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemStackFactory; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.kit.Kit; @@ -21,15 +24,23 @@ public class KitPlayer extends Kit new String[] { - "Help Santa retreive the lost presents!" + "Help Santa retrieve the lost presents!" }, new Perk[] { }, - EntityType.ZOMBIE, + EntityType.SKELETON, new ItemStack(Material.IRON_SWORD)); - + } + + @Override + public void SpawnCustom(LivingEntity ent) + { + ent.getEquipment().setHelmet(new ItemBuilder(Material.LEATHER_HELMET).setColor(Color.RED).setUnbreakable(true).build()); + ent.getEquipment().setChestplate(new ItemBuilder(Material.LEATHER_CHESTPLATE).setColor(Color.RED).build()); + ent.getEquipment().setLeggings(new ItemBuilder(Material.LEATHER_LEGGINGS).setColor(Color.RED).build()); + ent.getEquipment().setBoots(new ItemBuilder(Material.LEATHER_BOOTS).setColor(Color.BLACK).build()); } @Override @@ -43,7 +54,7 @@ public class KitPlayer extends Kit item = ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, C.cGreen + C.Bold + "Toy Bow"); item.addEnchantment(Enchantment.ARROW_INFINITE, 1); player.getInventory().setItem(1, item); - player.getInventory().setItem(28, ItemStackFactory.Instance.CreateStack(Material.ARROW)); + player.getInventory().setItem(9, ItemStackFactory.Instance.CreateStack(Material.ARROW)); //Axe item = ItemStackFactory.Instance.CreateStack(Material.STONE_PICKAXE, (byte)0, 1, C.cGreen + C.Bold + "Coal Digger"); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java index 7a96132c4..ea8e171cc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java @@ -1,35 +1,42 @@ package nautilus.game.arcade.game.games.christmas.parts; -import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.BlockFace; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; +import org.bukkit.entity.Ageable; +import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.Creature; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.HandlerList; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.player.PlayerInteractAtEntityEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.SkullMeta; + import mineplex.core.common.util.C; +import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTextTop; +import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.game.games.christmas.Christmas; import nautilus.game.arcade.game.games.christmas.ChristmasAudio; import net.minecraft.server.v1_8_R3.EntityCreature; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.SkullType; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.block.Skull; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; -import org.bukkit.entity.Ageable; -import org.bukkit.entity.Creature; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.HandlerList; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerInteractEvent; - public abstract class Part implements Listener { public Christmas Host; @@ -42,6 +49,7 @@ public abstract class Part implements Listener protected double _objectiveHealth = 1; protected HashMap _creatures = new HashMap(); + protected NautHashMap _spawnedPresents = new NautHashMap(); public Part(Christmas host, Location sleigh, Location[] presents) { @@ -53,38 +61,63 @@ public abstract class Part implements Listener loc.getBlock().setType(Material.AIR); } + @SuppressWarnings("deprecation") public void Prepare() { Activate(); for (Location loc : _presents) - { - Block present = loc.getBlock(); - present.setTypeIdAndData(Material.SKULL.getId(), (byte)1, true); - - Skull skull = (Skull) present.getState(); - skull.setSkullType(SkullType.PLAYER); + { + Location standLoc = loc.clone().add(0, -1.45, 0); + standLoc.setYaw(UtilMath.r(100)); - //Present Type - double r = Math.random(); - if (r > 0.75) skull.setOwner("CruXXx"); - else if (r > 0.5) skull.setOwner("CruXXx"); - else if (r > 0.25) skull.setOwner("CruXXx"); - else skull.setOwner("CruXXx"); + Host.CreatureAllowOverride = true; + ArmorStand stand = loc.getWorld().spawn(standLoc, ArmorStand.class); + Host.CreatureAllowOverride = false; - //Angle - BlockFace face = BlockFace.UP; - while (face == BlockFace.UP || face == BlockFace.DOWN || face == BlockFace.SELF) - face = BlockFace.values()[UtilMath.r(BlockFace.values().length)]; - skull.setRotation(face); - - skull.update(); + stand.setVisible(false); + stand.setGravity(false); + + ItemStack stack = ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM, (byte) 3); + SkullMeta meta = (SkullMeta) stack.getItemMeta(); + meta.setOwner("CruXXx"); + stack.setItemMeta(meta); + + stand.setHelmet(stack); +// +// present.setTypeIdAndData(Material.SKULL.getId(), (byte)1, true); +// +// Skull skull = (Skull) present.getState(); +// skull.setSkullType(SkullType.PLAYER); +// +// //Present Type +// double r = Math.random(); +// if (r > 0.75) skull.setOwner("CruXXx"); +// else if (r > 0.5) skull.setOwner("CruXXx"); +// else if (r > 0.25) skull.setOwner("CruXXx"); +// else skull.setOwner("CruXXx"); +// +// //Angle +// BlockFace face = BlockFace.UP; +// while (face == BlockFace.UP || face == BlockFace.DOWN || face == BlockFace.SELF) +// face = BlockFace.values()[UtilMath.r(BlockFace.values().length)]; +// skull.setRotation(face); +// +// skull.update(); + + _spawnedPresents.put(stand, loc); //Beacon - present.getRelative(BlockFace.DOWN).setType(Material.BEACON); for (int x=-1 ; x<=1 ; x++) for (int z=-1 ; z<=1 ; z++) - present.getRelative(x, -2, z).setType(Material.IRON_BLOCK); + { + loc.getBlock().getRelative(x, -2, z).setType(Material.IRON_BLOCK); + loc.getBlock().getRelative(x, -3, z).setType(Material.IRON_BLOCK); + } + + loc.getBlock().getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN).setType(Material.BEACON); + loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS); + loc.getBlock().getRelative(BlockFace.DOWN).setData(UtilMath.randomElement(new Byte[]{14, 5, 13})); } } @@ -157,35 +190,38 @@ public abstract class Part implements Listener return true; } - @EventHandler - public void PresentCollect(PlayerInteractEvent event) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = false) + public void PresentCollect(PlayerInteractAtEntityEvent event) { - if (event.getClickedBlock() == null) + Location present = _spawnedPresents.get(event.getRightClicked()); + if (present == null) return; - + boolean contains = false; for (Location loc : _presents) - if (loc.getBlock().equals(event.getClickedBlock())) + if (loc.getBlock().equals(present.getBlock())) contains = true; if (!contains) return; - event.setCancelled(true); - if (!Host.IsLive()) return; if (!Host.IsAlive(event.getPlayer())) return; - if (Host.GetSleigh().HasPresent(event.getClickedBlock().getLocation())) + if (Host.GetSleigh().HasPresent(present.getBlock().getLocation())) return; - if (UtilMath.offset(event.getPlayer().getLocation(), event.getClickedBlock().getLocation().add(0.5, 0.5, 0.5)) > 2) + if (UtilMath.offset(event.getPlayer().getLocation(), present.clone().add(0.5, 0.5, 0.5)) > 2) return; - Host.GetSleigh().AddPresent(event.getClickedBlock().getLocation()); + _spawnedPresents.remove(event.getRightClicked()); + + event.getRightClicked().remove(); + + Host.GetSleigh().AddPresent(present.getBlock().getLocation()); Host.SantaSay("Well done " + event.getPlayer().getName() + "! You collected a present!", null); } @@ -276,4 +312,21 @@ public abstract class Part implements Listener _creatures.clear(); } + @EventHandler + public void onDamagePresent(EntityDamageEvent event) + { + event.setCancelled(_spawnedPresents.containsKey(event.getEntity())); + } + + @EventHandler + public void PresentParticles(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + for (Entity ent : _spawnedPresents.keySet()) + { + UtilParticle.PlayParticle(ParticleType.HAPPY_VILLAGER, ent.getLocation().clone().add(0, 1.5, 0), .3F, .3F, .3F, 0F, 1, ViewDist.LONG, UtilServer.getPlayers()); + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part1.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part1.java index c37047bce..6839ff135 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part1.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part1.java @@ -1,41 +1,33 @@ package nautilus.game.arcade.game.games.christmas.parts; import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilParticle.ParticleType; -import mineplex.core.common.util.UtilParticle.ViewDist; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.game.Game.GameState; -import nautilus.game.arcade.game.games.christmas.Christmas; -import nautilus.game.arcade.game.games.christmas.ChristmasAudio; - import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.inventory.ItemStack; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTime; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import nautilus.game.arcade.game.games.christmas.Christmas; +import nautilus.game.arcade.game.games.christmas.ChristmasAudio; + public class Part1 extends Part { private ArrayList _skeletons; @@ -145,7 +137,7 @@ public class Part1 extends Part _presents = System.currentTimeMillis(); - Host.SantaSay("Theres some of the presents up ahead!", ChristmasAudio.P1_B); + Host.SantaSay("There are some of the presents up ahead!", ChristmasAudio.P1_B); SetObjectivePresents(); } @@ -189,7 +181,7 @@ public class Part1 extends Part } Host.SantaSay("Clear the path! Watch out for the undead!", ChristmasAudio.P1_D); - SetObjectiveText("Clear a path for Santas Sleigh!", 1); + SetObjectiveText("Clear a path for Santa's Sleigh!", 1); } private void UpdateClear() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java index 7286d1512..26b282b57 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java @@ -3,10 +3,22 @@ package nautilus.game.arcade.game.games.christmas.parts; import java.util.ArrayList; import java.util.Iterator; +import org.bukkit.Effect; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.FallingBlock; +import org.bukkit.entity.Giant; +import org.bukkit.entity.Zombie; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.entity.EntityChangeBlockEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; + import mineplex.core.common.util.C; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilPlayer; import mineplex.core.hologram.Hologram; import mineplex.core.hologram.HologramManager; import mineplex.core.updater.UpdateType; @@ -17,24 +29,6 @@ import nautilus.game.arcade.game.games.christmas.ChristmasAudio; import nautilus.game.arcade.game.games.christmas.content.CaveGiant; import nautilus.game.arcade.game.games.christmas.content.Snake; -import org.bukkit.ChatColor; -import org.bukkit.Effect; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.FallingBlock; -import org.bukkit.entity.Giant; -import org.bukkit.entity.Spider; -import org.bukkit.entity.Zombie; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.entity.EntityChangeBlockEvent; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.ItemStack; - public class Part4 extends Part { private ArrayList _roofIce; @@ -51,6 +45,13 @@ public class Part4 extends Part private boolean _b = false; private HologramManager _holoManager; + private String[] _evilElfNames = new String[] + { "Bing", "Bling", "Blitz", "Larry", "Buddy", "Buster", "Cedar", "Dash", "Eggnog", "Elfie", "Elm", "Elvis", + "Evergreen", "Figgy", "Flake", "Frank", "Frost", "Gabriel", "George", "Henry", "Hermey", "Ice", "Jangle", + "Jingle", "Jinx", "Kringle", "Kris", "Louie", "Max", "Mistletoe", "Nat", "Nick", "Noel", "Pax", "Peppermin", + "Pine", "Ralphie", "Rudy", "Snow", "Snowball", "Star", "Tinsel", "Tiny", "Topper", "Trinket", "Wayne", + "Wink", "Yule", "Zippy" }; + public Part4(HologramManager holoManager, Christmas host, Location sleigh, Location[] presents, ArrayList roofIce, ArrayList mobs, ArrayList snakeHead, ArrayList snakeTrail, ArrayList gate, ArrayList checkpoints, Location giant) { @@ -85,7 +86,7 @@ public class Part4 extends Part @EventHandler public void GateUpdate(UpdateEvent event) { - if (event.getType() != UpdateType.SEC) + if (event.getType() != UpdateType.FAST) return; if (_gate.isEmpty()) @@ -187,6 +188,8 @@ public class Part4 extends Part ent.getEquipment().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS)); ent.getEquipment().setBoots(new ItemStack(Material.LEATHER_BOOTS)); ent.setVillager(true); + + ent.setCustomName("Evil Elf " + UtilMath.randomElement(_evilElfNames)); ent.setHealth(9); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java index 741b7f3ac..2dceaca60 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java @@ -2,41 +2,37 @@ package nautilus.game.arcade.game.games.christmas.parts; import java.util.ArrayList; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.game.games.christmas.Christmas; -import nautilus.game.arcade.game.games.christmas.ChristmasAudio; -import nautilus.game.arcade.game.games.christmas.content.*; -import net.minecraft.server.v1_8_R3.EntityCreature; - import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.EntityEffect; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.HandlerList; import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.block.BlockIgniteEvent; import org.bukkit.event.entity.EntityCombustEvent; -import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilTime; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.game.games.christmas.Christmas; +import nautilus.game.arcade.game.games.christmas.ChristmasAudio; +import nautilus.game.arcade.game.games.christmas.content.BossFloor; +import nautilus.game.arcade.game.games.christmas.content.BossMobs; +import nautilus.game.arcade.game.games.christmas.content.BossSnowmanPattern; +import nautilus.game.arcade.game.games.christmas.content.PumpkinKing; + public class Part5 extends Part { private ArrayList _spawn; @@ -385,6 +381,9 @@ public class Part5 extends Part @EventHandler public void Damage(CustomDamageEvent event) { + if (event.isCancelled()) + return; + if (_boss == null) return; From 0c383f8bf4858c4e3a32658f8d2b54e171b761eb Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 18:58:03 -0500 Subject: [PATCH 31/41] Remove bad message --- .../Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index cd1a4d1fd..86b7852ec 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import org.bukkit.ChatColor; -//Mysticate@184.154.0.242:7990/scm/min/mineplex.git import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; From 0e9e8c155f2f680cbded4a75eba11f57ee723626 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 19:11:06 -0500 Subject: [PATCH 32/41] Quick fix that I don't think i caused. --- .../Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 86b7852ec..6b1411ecd 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -248,7 +248,7 @@ public class ServerGameMenu extends ShopPageBase setItem(42, _minigameCycle.get(_minigameIndex)); setItem(44, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3) - .addLore(C.Reset + C.Bold + C.cYellow + "Player Servers " + C.cGray + "Player Hosted Games").addLore(new String[] + .setTitle(C.Reset + C.Bold + C.cYellow + "Player Servers " + C.cGray + "Player Hosted Games").addLore(new String[] { C.Reset + "", C.Reset + "Join your friends in their own ", From a827f95eb448564d925f861bb3d386db9ecf02c6 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 19:24:24 -0500 Subject: [PATCH 33/41] Fixed scoreboard. VIVA LA FIESTA --- .../game/arcade/game/games/christmas/Christmas.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java index ebe29c61b..7def0ed30 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java @@ -610,7 +610,7 @@ public class Christmas extends SoloGame Scoreboard.Reset(); String line = ""; - for (int i = 0 ; i < 10 ; i++) + for (int i = 0 ; i < 20 ; i++) line += ((i % 2 == 0 ? C.cRed : C.cDGreen) + "█"); Scoreboard.WriteBlank(); @@ -619,12 +619,14 @@ public class Christmas extends SoloGame Scoreboard.WriteBlank(); Scoreboard.Write(C.cWhiteB + "May your winter"); - Scoreboard.Write(C.cWhiteB + "be filled with " + C.cYellowB + "joy" + C.cWhiteB + " and " + C.cYellowB + "cheer" + C.cWhiteB + "."); + Scoreboard.Write(C.cWhiteB + "be filled with"); + Scoreboard.Write(C.cYellowB + "joy" + C.cWhiteB + " and " + C.cYellowB + "cheer" + C.cWhiteB + "."); Scoreboard.WriteBlank(); - Scoreboard.Write(C.cWhite + "Happy Holidays!"); - Scoreboard.Write(C.cWhiteB + "- Your friends at " + C.cGoldB + "MINEPLEX"); + Scoreboard.Write(C.cAquaB + "Happy Holidays!"); + Scoreboard.Write(C.cWhiteB + "- Your friends at"); + Scoreboard.Write(C.cGoldB + "MINEPLEX"); Scoreboard.WriteBlank(); Scoreboard.Write(line); From 0dd7db27cd6196b22acdc2ed751efce63ecbfaf7 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 19:49:41 -0500 Subject: [PATCH 34/41] FIXED FORAMTTING --- .../nautilus/game/arcade/game/games/christmas/Christmas.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java index 7def0ed30..d3644f231 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java @@ -620,11 +620,14 @@ public class Christmas extends SoloGame Scoreboard.Write(C.cWhiteB + "May your winter"); Scoreboard.Write(C.cWhiteB + "be filled with"); - Scoreboard.Write(C.cYellowB + "joy" + C.cWhiteB + " and " + C.cYellowB + "cheer" + C.cWhiteB + "."); + Scoreboard.Write(C.cYellowB + "joy" + C.cWhiteB + " and " + C.cYellowB + "cheer."); Scoreboard.WriteBlank(); Scoreboard.Write(C.cAquaB + "Happy Holidays!"); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cWhiteB + "- Your friends at"); Scoreboard.Write(C.cGoldB + "MINEPLEX"); From b5bdf7ced4341d29116c6efdd91a7bc85b65fd91 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 14 Dec 2015 15:42:32 +1300 Subject: [PATCH 35/41] Remove custom name on players on join and arcade spectator --- .../src/mineplex/core/CustomTagFix.java | 22 ++++++++++++++----- .../nautilus/game/arcade/ArcadeManager.java | 3 +++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java index 790df2c43..d757499b7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java @@ -35,6 +35,8 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.event.player.PlayerVelocityEvent; @@ -81,6 +83,15 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook _loggedIn.remove(event.getPlayer()); } + @EventHandler(priority = EventPriority.LOW) + public void playerJoin(PlayerJoinEvent event) + { + Player player = event.getPlayer(); + + player.setCustomName(""); + player.setCustomNameVisible(false); + } + @EventHandler public void ncpExempt(final PlayerToggleFlightEvent event) { @@ -140,7 +151,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook { Entry> entry = iterator.next(); - for (Iterator> innerIterator = entry.getValue().entrySet().iterator(); innerIterator.hasNext();) + for (Iterator> innerIterator = entry.getValue().entrySet().iterator(); innerIterator + .hasNext();) { final Entry entry2 = innerIterator.next(); @@ -247,7 +259,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook _entityNameMap.get(owner.getName()).put(spawnPacket.a, entityName); _entityMap.get(owner.getName()).put(spawnPacket.a, new Integer[] { - newId + newId }); sendProtocolPackets(owner, spawnPacket.a, newId, entityName, verifier, true, -1); @@ -349,7 +361,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook { newId = new Integer[] { - UtilEnt.getNewEntityId() + UtilEnt.getNewEntityId() }; _entityMap.get(owner.getName()).put(metaPacket.a, newId); @@ -469,8 +481,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook _entityRiding.get(owner.getName()).remove(attachPacket.b); - sendProtocolPackets(owner, vehicleId, ids[ids.length - 1], - _entityNameMap.get(owner.getName()).get(vehicleId), verifier, true, ids.length > 1 ? ids[0] : -1); + sendProtocolPackets(owner, vehicleId, ids[ids.length - 1], _entityNameMap.get(owner.getName()).get(vehicleId), + verifier, true, ids.length > 1 ? ids[0] : -1); } else { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index fbf22d621..016289a6f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -921,6 +921,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation ((CraftEntity) player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0)); + player.setCustomName(""); + player.setCustomNameVisible(false); + player.setSprinting(false); player.setSneaking(false); From a04eaddc427553f97bb159e35970e76c3e4664c0 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 22:25:18 -0500 Subject: [PATCH 36/41] Fixed bump --- .../arcade/game/games/christmas/Sleigh.java | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java index a41031b6c..26ef62540 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java @@ -207,17 +207,7 @@ public class Sleigh { for (Entity ent : UtilEnt.getInRadius(part.Ent.getLocation(), 1).keySet()) { - boolean matches = false; - for (SleighPart cur : SleighEnts) - { - if (ent instanceof LivingEntity && cur.HasEntity((LivingEntity) ent)) - { - matches = true; - break; - } - } - - if (matches) + if (isPart(ent)) continue; if (ent instanceof Player) @@ -236,17 +226,7 @@ public class Sleigh { for (Entity ent : UtilEnt.getInRadius(part.Ent.getLocation(), 1).keySet()) { - boolean matches = false; - for (SleighPart cur : SleighEnts) - { - if (ent instanceof LivingEntity && cur.HasEntity((LivingEntity) ent)) - { - matches = true; - break; - } - } - - if (matches) + if (isPart(ent)) continue; if (ent instanceof Player) @@ -322,4 +302,30 @@ public class Sleigh { return Santa; } + + public boolean isPart(Entity ent) + { + if (ent == null) + return false; + + if (ent == CentralEntity) + return true; + + if (ent == Santa) + return true; + + for (SleighPart part : SleighEnts) + if (part.Block == ent || part.Ent == ent || (ent instanceof LivingEntity && part.HasEntity((LivingEntity) ent))) + return true; + + for (SleighHorse horse : SleighHorses) + if (horse.Ent == ent || (ent instanceof LivingEntity && horse.HasEntity((LivingEntity) ent))) + return true; + + for (SleighPart part : PresentSlots) + if (part.Block == ent || part.Ent == ent || (ent instanceof LivingEntity && part.HasEntity((LivingEntity) ent))) + return true; + + return false; + } } From 42244ae79876e2075ddeeccb057c26116e7a922f Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 22:43:11 -0500 Subject: [PATCH 37/41] Snowman AI fix --- .../arcade/game/games/christmas/content/SnowmanMaze.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java index 140bcb805..a9d5d3767 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java @@ -234,10 +234,10 @@ public class SnowmanMaze //Stop at intersection int count = 0; - if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH)) && !_waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++; - if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH)) && !_waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++; - if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST)) && !_waypoints.contains(cur.getRelative(BlockFace.EAST))) count++; - if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST)) && !_waypoints.contains(cur.getRelative(BlockFace.WEST))) count++; + if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++; + if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++; + if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST))) count++; + if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST))) count++; if (count > 1) break; From dcf3c1ea8840475263b53f4a8391f67500685868 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Sun, 13 Dec 2015 23:14:17 -0500 Subject: [PATCH 38/41] Deleted and added new Cache since renaming was jacked up. --- Plugins/BuildFiles/common.xml | 10 +++++----- .../.classpath | 0 .../.project | 0 .../src/mineplex/cache/player/PlayerCache.java | 0 .../src/mineplex/cache/player/PlayerInfo.java | 0 .../Mineplex.PlayerCache/Mineplex.PlayerCache.iml | 12 ------------ 6 files changed, 5 insertions(+), 17 deletions(-) rename Plugins/{Mineplex.PlayerCache => Mineplex.Cache}/.classpath (100%) rename Plugins/{Mineplex.PlayerCache => Mineplex.Cache}/.project (100%) rename Plugins/{Mineplex.PlayerCache => Mineplex.Cache}/src/mineplex/cache/player/PlayerCache.java (100%) rename Plugins/{Mineplex.PlayerCache => Mineplex.Cache}/src/mineplex/cache/player/PlayerInfo.java (100%) delete mode 100644 Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml diff --git a/Plugins/BuildFiles/common.xml b/Plugins/BuildFiles/common.xml index 4200a7c8a..7cbbd04a4 100644 --- a/Plugins/BuildFiles/common.xml +++ b/Plugins/BuildFiles/common.xml @@ -86,7 +86,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -249,7 +249,7 @@ - + @@ -329,7 +329,7 @@ - + diff --git a/Plugins/Mineplex.PlayerCache/.classpath b/Plugins/Mineplex.Cache/.classpath similarity index 100% rename from Plugins/Mineplex.PlayerCache/.classpath rename to Plugins/Mineplex.Cache/.classpath diff --git a/Plugins/Mineplex.PlayerCache/.project b/Plugins/Mineplex.Cache/.project similarity index 100% rename from Plugins/Mineplex.PlayerCache/.project rename to Plugins/Mineplex.Cache/.project diff --git a/Plugins/Mineplex.PlayerCache/src/mineplex/cache/player/PlayerCache.java b/Plugins/Mineplex.Cache/src/mineplex/cache/player/PlayerCache.java similarity index 100% rename from Plugins/Mineplex.PlayerCache/src/mineplex/cache/player/PlayerCache.java rename to Plugins/Mineplex.Cache/src/mineplex/cache/player/PlayerCache.java diff --git a/Plugins/Mineplex.PlayerCache/src/mineplex/cache/player/PlayerInfo.java b/Plugins/Mineplex.Cache/src/mineplex/cache/player/PlayerInfo.java similarity index 100% rename from Plugins/Mineplex.PlayerCache/src/mineplex/cache/player/PlayerInfo.java rename to Plugins/Mineplex.Cache/src/mineplex/cache/player/PlayerInfo.java diff --git a/Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml b/Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml deleted file mode 100644 index 54892e832..000000000 --- a/Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file From c34ac3ec523a993bb9f6bcc801ad0c4ff2005fbc Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 14 Dec 2015 15:21:43 +1100 Subject: [PATCH 39/41] xmas --- .../nautilus/game/arcade/game/games/christmas/Christmas.java | 2 +- .../game/arcade/game/games/christmas/content/SnowmanBoss.java | 4 ++-- .../game/arcade/game/games/christmas/content/SnowmanMaze.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java index d3644f231..226fbcb51 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java @@ -475,7 +475,7 @@ public class Christmas extends SoloGame } else { - SetCustomWinMessage(player, "You earned " + C.cYellow + "Winter Chest x2"); + SetCustomWinMessage(player, "You earned " + C.cYellow + "2x Winter Holiday Treasure"); Manager.GetTaskManager().completedTask(new Callback() { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java index b97da2215..82b334134 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java @@ -49,8 +49,8 @@ public class SnowmanBoss _minions.add(new SnowmanMinion(_spawn.getWorld().spawn(_spawn, Snowman.class))); _heart = _spawn.getWorld().spawn(_spawn, IronGolem.class); - _heart.setMaxHealth(1000); - _heart.setHealth(1000); + _heart.setMaxHealth(1400); + _heart.setHealth(1400); UtilEnt.Vegetate(_heart); Host.CreatureAllowOverride = false; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java index a9d5d3767..e65212177 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java @@ -254,7 +254,7 @@ public class SnowmanMaze //Spawn if (!Host.GetSleigh().HasPresent(_present)) { - while (_ents.size() < 36) + while (_ents.size() < 44) { Location loc = UtilAlg.Random(_spawns); From 94169a5b8a16b364d2386a597866ceed6c68d4fd Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 14 Dec 2015 15:29:34 +1100 Subject: [PATCH 40/41] it made me push it :( --- Plugins/Mineplex.PlayerCache/.project | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Plugins/Mineplex.PlayerCache/.project diff --git a/Plugins/Mineplex.PlayerCache/.project b/Plugins/Mineplex.PlayerCache/.project new file mode 100644 index 000000000..5321c2157 --- /dev/null +++ b/Plugins/Mineplex.PlayerCache/.project @@ -0,0 +1,17 @@ + + + Mineplex.Cache + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + From f26c31b7ec461955ed6f630f052c2c4286e30bca Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 14 Dec 2015 15:33:09 +1100 Subject: [PATCH 41/41] xmas a little harder --- .../nautilus/game/arcade/game/games/christmas/Christmas.java | 2 +- .../game/arcade/game/games/christmas/content/CaveGiant.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java index 226fbcb51..8d129fc69 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java @@ -488,7 +488,7 @@ public class Christmas extends SoloGame } else { - UtilPlayer.message(player, F.main("Inventory", "An error occured while giving you " + C.cRed + "Winter Chest x2" + C.cGray + ".")); + UtilPlayer.message(player, F.main("Inventory", "An error occured while giving you " + C.cRed + "2x Winter Holiday Treasure" + C.cGray + ".")); } } }, player, "CC Reward 2015"); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/CaveGiant.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/CaveGiant.java index 153e41aa2..65c5b40d1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/CaveGiant.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/CaveGiant.java @@ -32,8 +32,8 @@ public class CaveGiant Host.Host.CreatureAllowOverride = false; UtilEnt.Vegetate(_ent); - _ent.setMaxHealth(200); - _ent.setHealth(200); + _ent.setMaxHealth(300); + _ent.setHealth(300); _tpLoc = _ent.getLocation();