From 98b285d819e07ffd793218b92b92bd249a930b2b Mon Sep 17 00:00:00 2001 From: Chiss Date: Mon, 2 Sep 2013 15:07:07 +1000 Subject: [PATCH 1/3] turf forts self kill fix. --- .../arcade/game/minigames/turfforts/TurfForts.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/minigames/turfforts/TurfForts.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/minigames/turfforts/TurfForts.java index 6bf164d9a..61c0ab9f9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/minigames/turfforts/TurfForts.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/minigames/turfforts/TurfForts.java @@ -96,6 +96,7 @@ public class TurfForts extends TeamGame this.BlockBreakAllow.add(35); this.ItemDrop = false; this.ItemPickup = false; + this.DamageSelf = false; } @Override @@ -133,6 +134,8 @@ public class TurfForts extends TeamGame if (event.GetLog().GetKiller() == null) return; + + Player killed = (Player)event.GetEvent().getEntity(); Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName()); if (killer == null) @@ -140,6 +143,12 @@ public class TurfForts extends TeamGame if (GetTeam(killer) == null) return; + + if (GetTeam(killed) == null) + return; + + if (GetTeam(killer).equals(GetTeam(killed))) + return; if (GetTeam(killer).GetColor() == ChatColor.RED) { @@ -325,6 +334,9 @@ public class TurfForts extends TeamGame @EventHandler public void Damage(CustomDamageEvent event) { + if (event.IsCancelled()) + return; + if (!_fight) { event.SetCancelled("Build Time"); From ee20174d80713fe26dfb95a7977ccdf17468337e Mon Sep 17 00:00:00 2001 From: Chiss Date: Mon, 2 Sep 2013 15:47:08 +1000 Subject: [PATCH 2/3] lobby adv messagfe --- .../src/nautilus/game/arcade/managers/GameLobbyManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java index 452b25240..2b136199d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java @@ -517,9 +517,9 @@ public class GameLobbyManager implements IPacketRunnable, Listener } else if (_advertiseStage == 1) { - WriteAdvertiseLine("BRIDGE ULTRA RANK", 0, 159, (byte)4); - WriteAdvertiseLine("UNLOCKS EVERY KIT", 1, 159, (byte)15); - WriteAdvertiseLine("IN THE BRIDGES", 2, 159, (byte)15); + WriteAdvertiseLine("GAME ULTRA RANKS", 0, 159, (byte)4); + WriteAdvertiseLine("UNLOCK EVERY KIT", 1, 159, (byte)15); + WriteAdvertiseLine("IN THAT GAME", 2, 159, (byte)15); WriteAdvertiseLine("www.mineplex.com", 4, 159, (byte)15); } From 441e6d80b77b33843d8839d660a8870e8a273fda Mon Sep 17 00:00:00 2001 From: Chiss Date: Mon, 2 Sep 2013 16:01:14 +1000 Subject: [PATCH 3/3] lobby kit disguises :D slime NPE fix --- .../src/nautilus/game/arcade/game/Game.java | 2 +- .../game/standalone/smash/SuperSmash.java | 26 +++++++++++++++++++ .../game/standalone/smash/kits/KitBlaze.java | 2 +- .../standalone/smash/kits/KitChicken.java | 2 +- .../standalone/smash/kits/KitEnderman.java | 2 +- .../game/standalone/smash/kits/KitGolem.java | 2 +- .../game/standalone/smash/kits/KitKnight.java | 2 +- .../standalone/smash/kits/KitSkeleton.java | 2 +- .../standalone/smash/kits/KitSkySquid.java | 2 +- .../game/standalone/smash/kits/KitSlime.java | 2 +- .../standalone/smash/kits/KitSnowman.java | 2 +- .../game/standalone/smash/kits/KitSpider.java | 2 +- .../smash/kits/KitWitherSkeleton.java | 2 +- .../arcade/kit/perks/PerkSlimeRocket.java | 2 +- 14 files changed, 39 insertions(+), 13 deletions(-) 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 b696ed588..929aa7ae0 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 @@ -82,7 +82,7 @@ public abstract class Game implements Listener private ArrayList _teamList = new ArrayList(); //Player Preferences - private NautHashMap _playerKit = new NautHashMap(); + protected NautHashMap _playerKit = new NautHashMap(); private NautHashMap> _teamPreference = new NautHashMap>(); private NautHashMap> _gemCount = new NautHashMap>(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/SuperSmash.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/SuperSmash.java index 344205b87..dddcea077 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/SuperSmash.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/SuperSmash.java @@ -15,6 +15,7 @@ import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; import org.bukkit.event.entity.PlayerDeathEvent; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -22,6 +23,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.game.standalone.smash.kits.*; @@ -209,4 +211,28 @@ public class SuperSmash extends SoloGame { event.getDrops().clear(); } + + @Override + public void SetKit(Player player, Kit kit, boolean announce) + { + GameTeam team = GetTeam(player); + if (team != null) + { + if (!team.KitAllowed(kit)) + { + player.playSound(player.getLocation(), Sound.NOTE_BASS, 2f, 0.5f); + UtilPlayer.message(player, F.main("Kit", F.elem(team.GetFormattedName()) + " cannot use " + F.elem(kit.GetFormattedName() + " Kit") + ".")); + return; + } + } + + _playerKit.put(player, kit); + + if (announce) + { + player.playSound(player.getLocation(), Sound.ORB_PICKUP, 2f, 1f); + UtilPlayer.message(player, F.main("Kit", "You equipped " + F.elem(kit.GetFormattedName() + " Kit") + ".")); + kit.ApplyKit(player); + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitBlaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitBlaze.java index 64a39442c..02e2d6252 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitBlaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitBlaze.java @@ -57,7 +57,7 @@ public class KitBlaze extends SmashKit //Disguise DisguiseBlaze disguise = new DisguiseBlaze(player); - disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.SetName(C.cYellow + player.getName()); disguise.SetCustomNameVisible(true); Manager.GetDisguise().disguise(disguise); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitChicken.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitChicken.java index fc242f056..a595c4cf2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitChicken.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitChicken.java @@ -49,7 +49,7 @@ public class KitChicken extends SmashKit //Disguise DisguiseChicken disguise = new DisguiseChicken(player); - disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.SetName(C.cYellow + player.getName()); disguise.SetCustomNameVisible(true); Manager.GetDisguise().disguise(disguise); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitEnderman.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitEnderman.java index 3d3895ec2..d5ed05510 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitEnderman.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitEnderman.java @@ -59,7 +59,7 @@ public class KitEnderman extends SmashKit //Disguise DisguiseEnderman disguise = new DisguiseEnderman(player); - disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.SetName(C.cYellow + player.getName()); disguise.SetCustomNameVisible(true); disguise.a(false); Manager.GetDisguise().disguise(disguise); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitGolem.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitGolem.java index 4d161b3a4..fb4556995 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitGolem.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitGolem.java @@ -50,7 +50,7 @@ public class KitGolem extends SmashKit //Disguise DisguiseIronGolem disguise = new DisguiseIronGolem(player); - disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.SetName(C.cYellow + player.getName()); disguise.SetCustomNameVisible(true); Manager.GetDisguise().disguise(disguise); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitKnight.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitKnight.java index da912b0d2..1bbdecc38 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitKnight.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitKnight.java @@ -46,7 +46,7 @@ public class KitKnight extends SmashKit //Disguise DisguiseSpider disguise = new DisguiseSpider(player); - disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.SetName(C.cYellow + player.getName()); disguise.SetCustomNameVisible(true); Manager.GetDisguise().disguise(disguise); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSkeleton.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSkeleton.java index 2a23161a9..034b8f016 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSkeleton.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSkeleton.java @@ -56,7 +56,7 @@ public class KitSkeleton extends SmashKit //Disguise DisguiseSkeleton disguise = new DisguiseSkeleton(player); - disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.SetName(C.cYellow + player.getName()); disguise.SetCustomNameVisible(true); Manager.GetDisguise().disguise(disguise); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSkySquid.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSkySquid.java index 2e5841fa7..cced4aae7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSkySquid.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSkySquid.java @@ -49,7 +49,7 @@ public class KitSkySquid extends SmashKit //Disguise DisguiseSquid disguise = new DisguiseSquid(player); - disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.SetName(C.cYellow + player.getName()); disguise.SetCustomNameVisible(true); Manager.GetDisguise().disguise(disguise); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSlime.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSlime.java index 872f4a5df..cecab4e7d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSlime.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSlime.java @@ -48,7 +48,7 @@ public class KitSlime extends SmashKit //Disguise DisguiseSlime disguise = new DisguiseSlime(player); - disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.SetName(C.cYellow + player.getName()); disguise.SetCustomNameVisible(true); Manager.GetDisguise().disguise(disguise); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSnowman.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSnowman.java index 3723f611d..aa2fba5b8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSnowman.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSnowman.java @@ -55,7 +55,7 @@ public class KitSnowman extends SmashKit //Disguise DisguiseSnowman disguise = new DisguiseSnowman(player); - disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.SetName(C.cYellow + player.getName()); disguise.SetCustomNameVisible(true); Manager.GetDisguise().disguise(disguise); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSpider.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSpider.java index 4378d4886..da7a098b5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSpider.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitSpider.java @@ -49,7 +49,7 @@ public class KitSpider extends SmashKit //Disguise DisguiseSpider disguise = new DisguiseSpider(player); - disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.SetName(C.cYellow + player.getName()); disguise.SetCustomNameVisible(true); Manager.GetDisguise().disguise(disguise); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitWitherSkeleton.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitWitherSkeleton.java index d2d2f1c84..fd4e37f8a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitWitherSkeleton.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitWitherSkeleton.java @@ -47,7 +47,7 @@ public class KitWitherSkeleton extends SmashKit //Disguise DisguiseSpider disguise = new DisguiseSpider(player); - disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.SetName(C.cYellow + player.getName()); disguise.SetCustomNameVisible(true); Manager.GetDisguise().disguise(disguise); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java index 194baac83..9491c6452 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java @@ -62,7 +62,7 @@ public class PerkSlimeRocket extends Perk implements IThrown DisguiseSlime slime = (DisguiseSlime)Manager.GetDisguise().getDisguise(player); - if (slime.GetSize() != size) + if (slime != null && slime.GetSize() != size) { slime.SetSize(size); Manager.GetDisguise().updateDisguise(slime);