lobby kit disguises :D
slime NPE fix
This commit is contained in:
parent
ee20174d80
commit
441e6d80b7
@ -82,7 +82,7 @@ public abstract class Game implements Listener
|
|||||||
private ArrayList<GameTeam> _teamList = new ArrayList<GameTeam>();
|
private ArrayList<GameTeam> _teamList = new ArrayList<GameTeam>();
|
||||||
|
|
||||||
//Player Preferences
|
//Player Preferences
|
||||||
private NautHashMap<Player, Kit> _playerKit = new NautHashMap<Player, Kit>();
|
protected NautHashMap<Player, Kit> _playerKit = new NautHashMap<Player, Kit>();
|
||||||
private NautHashMap<GameTeam, ArrayList<Player>> _teamPreference = new NautHashMap<GameTeam, ArrayList<Player>>();
|
private NautHashMap<GameTeam, ArrayList<Player>> _teamPreference = new NautHashMap<GameTeam, ArrayList<Player>>();
|
||||||
private NautHashMap<Player, HashMap<String,GemData>> _gemCount = new NautHashMap<Player, HashMap<String,GemData>>();
|
private NautHashMap<Player, HashMap<String,GemData>> _gemCount = new NautHashMap<Player, HashMap<String,GemData>>();
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
|||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
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.ArcadeManager;
|
||||||
import nautilus.game.arcade.GameType;
|
import nautilus.game.arcade.GameType;
|
||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
|
import nautilus.game.arcade.game.GameTeam;
|
||||||
import nautilus.game.arcade.game.SoloGame;
|
import nautilus.game.arcade.game.SoloGame;
|
||||||
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||||
import nautilus.game.arcade.game.standalone.smash.kits.*;
|
import nautilus.game.arcade.game.standalone.smash.kits.*;
|
||||||
@ -209,4 +211,28 @@ public class SuperSmash extends SoloGame
|
|||||||
{
|
{
|
||||||
event.getDrops().clear();
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ public class KitBlaze extends SmashKit
|
|||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseBlaze disguise = new DisguiseBlaze(player);
|
DisguiseBlaze disguise = new DisguiseBlaze(player);
|
||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public class KitChicken extends SmashKit
|
|||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseChicken disguise = new DisguiseChicken(player);
|
DisguiseChicken disguise = new DisguiseChicken(player);
|
||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ public class KitEnderman extends SmashKit
|
|||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseEnderman disguise = new DisguiseEnderman(player);
|
DisguiseEnderman disguise = new DisguiseEnderman(player);
|
||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
disguise.a(false);
|
disguise.a(false);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
|
@ -50,7 +50,7 @@ public class KitGolem extends SmashKit
|
|||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseIronGolem disguise = new DisguiseIronGolem(player);
|
DisguiseIronGolem disguise = new DisguiseIronGolem(player);
|
||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public class KitKnight extends SmashKit
|
|||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseSpider disguise = new DisguiseSpider(player);
|
DisguiseSpider disguise = new DisguiseSpider(player);
|
||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ public class KitSkeleton extends SmashKit
|
|||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
|
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
|
||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public class KitSkySquid extends SmashKit
|
|||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseSquid disguise = new DisguiseSquid(player);
|
DisguiseSquid disguise = new DisguiseSquid(player);
|
||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ public class KitSlime extends SmashKit
|
|||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseSlime disguise = new DisguiseSlime(player);
|
DisguiseSlime disguise = new DisguiseSlime(player);
|
||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ public class KitSnowman extends SmashKit
|
|||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseSnowman disguise = new DisguiseSnowman(player);
|
DisguiseSnowman disguise = new DisguiseSnowman(player);
|
||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public class KitSpider extends SmashKit
|
|||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseSpider disguise = new DisguiseSpider(player);
|
DisguiseSpider disguise = new DisguiseSpider(player);
|
||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public class KitWitherSkeleton extends SmashKit
|
|||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
DisguiseSpider disguise = new DisguiseSpider(player);
|
DisguiseSpider disguise = new DisguiseSpider(player);
|
||||||
disguise.SetName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
|
disguise.SetName(C.cYellow + player.getName());
|
||||||
disguise.SetCustomNameVisible(true);
|
disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ public class PerkSlimeRocket extends Perk implements IThrown
|
|||||||
|
|
||||||
|
|
||||||
DisguiseSlime slime = (DisguiseSlime)Manager.GetDisguise().getDisguise(player);
|
DisguiseSlime slime = (DisguiseSlime)Manager.GetDisguise().getDisguise(player);
|
||||||
if (slime.GetSize() != size)
|
if (slime != null && slime.GetSize() != size)
|
||||||
{
|
{
|
||||||
slime.SetSize(size);
|
slime.SetSize(size);
|
||||||
Manager.GetDisguise().updateDisguise(slime);
|
Manager.GetDisguise().updateDisguise(slime);
|
||||||
|
Loading…
Reference in New Issue
Block a user