Actually check that the player is allowed to have the default kit

This commit is contained in:
Sam 2017-08-10 20:14:57 +01:00
parent b9640a763c
commit 8135ca022c
2 changed files with 4 additions and 2 deletions

View File

@ -114,7 +114,7 @@ public class GamePlayerManager implements Listener
if (kit instanceof ProgressingKit)
{
ProgressingKit progressingKit = (ProgressingKit) kit;
if (progressingKit.isDefault(player.getUniqueId()))
if (progressingKit.canEquipKit(player) && progressingKit.isDefault(player.getUniqueId()))
{
progressingKit.onSelected(player.getUniqueId());
return;

View File

@ -302,13 +302,15 @@ public class ProgressingKitManager implements Listener
{
UtilServer.getPlayersCollection().forEach(player ->
{
UUID id = player.getUniqueId();
for (Kit kit : _manager.GetGame().GetKits())
{
//Set default kit
if (kit instanceof ProgressingKit)
{
ProgressingKit progressingKit = (ProgressingKit) kit;
if (progressingKit.isDefault(player.getUniqueId()))
if (progressingKit.canEquipKit(player) && progressingKit.isDefault(id))
{
progressingKit.onSelected(player.getUniqueId());
break;