Bug fixes.
This commit is contained in:
parent
978ee0055a
commit
9f58e57a67
@ -1,11 +1,8 @@
|
|||||||
package mineplex.core.party;
|
package mineplex.core.party;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import static sun.audio.AudioPlayer.player;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All chat messages for the party system to align with PE
|
* All chat messages for the party system to align with PE
|
||||||
@ -31,6 +28,7 @@ public enum Lang
|
|||||||
PARTY_OWNER_LEAVE("{0} has left the party. {1} is the new party owner."),
|
PARTY_OWNER_LEAVE("{0} has left the party. {1} is the new party owner."),
|
||||||
TRANSFER_OWNER("{0} has given party leadership to {1}."),
|
TRANSFER_OWNER("{0} has given party leadership to {1}."),
|
||||||
DISBANDED("Your party has been disbanded, due to a lack of players."),
|
DISBANDED("Your party has been disbanded, due to a lack of players."),
|
||||||
|
DISBANDED_BY_OWNER("Your party has been disbanded!"),
|
||||||
REMOVED("You have been removed from the party."),
|
REMOVED("You have been removed from the party."),
|
||||||
|
|
||||||
NOT_EXIST("Error: {0} is not in a party right now."),
|
NOT_EXIST("Error: {0} is not in a party right now."),
|
||||||
|
@ -2,12 +2,11 @@ package mineplex.core.party;
|
|||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import mineplex.core.chat.Chat;
|
|
||||||
import mineplex.core.common.util.F;
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.party.event.PartyTransferOwnerEvent;
|
import mineplex.core.party.event.PartyTransferOwnerEvent;
|
||||||
import mineplex.core.party.event.PartyTransferOwnerEvent.TransferReason;
|
import mineplex.core.party.event.PartyTransferOwnerEvent.TransferReason;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -27,6 +26,7 @@ public class Party
|
|||||||
private List<UUID> _membersByUUID;
|
private List<UUID> _membersByUUID;
|
||||||
private Map<String, Long> _invites;
|
private Map<String, Long> _invites;
|
||||||
private int size;
|
private int size;
|
||||||
|
private boolean _alreadyTeamed;
|
||||||
|
|
||||||
public Party()
|
public Party()
|
||||||
{
|
{
|
||||||
@ -86,6 +86,10 @@ public class Party
|
|||||||
}
|
}
|
||||||
_members.add(player);
|
_members.add(player);
|
||||||
Lang.ADD_MEMBER.send(this, player);
|
Lang.ADD_MEMBER.send(this, player);
|
||||||
|
getMembers().stream().forEach(s -> {
|
||||||
|
Player player1 = Bukkit.getPlayer(s);
|
||||||
|
player1.playSound(player1.getLocation(), Sound.NOTE_PLING, 1.0F, 10.0F);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPlayerRemove(String player, PartyRemoveReason reason)
|
public void onPlayerRemove(String player, PartyRemoveReason reason)
|
||||||
@ -149,4 +153,26 @@ public class Party
|
|||||||
{
|
{
|
||||||
return _membersByUUID;
|
return _membersByUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean alreadyTeamed()
|
||||||
|
{
|
||||||
|
return _alreadyTeamed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlreadyTeamed(boolean alreadyTeamed)
|
||||||
|
{
|
||||||
|
_alreadyTeamed = alreadyTeamed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean contains(String name)
|
||||||
|
{
|
||||||
|
for(String s : _members)
|
||||||
|
{
|
||||||
|
if(s.equalsIgnoreCase(name))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package mineplex.core.party;
|
package mineplex.core.party;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
@ -86,6 +87,11 @@ public class PartyManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addToPartyOnTransfer(UUID uuid, Party party)
|
||||||
|
{
|
||||||
|
_players.put(uuid, party);
|
||||||
|
}
|
||||||
|
|
||||||
public void addToParty(Player player, Party party)
|
public void addToParty(Player player, Party party)
|
||||||
{
|
{
|
||||||
addToParty(player.getUniqueId(), party);
|
addToParty(player.getUniqueId(), party);
|
||||||
@ -114,10 +120,9 @@ public class PartyManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player player = Bukkit.getPlayer(uuid);
|
Player player = Bukkit.getPlayer(uuid);
|
||||||
party.getMembers().remove(player.getName());
|
|
||||||
party.getMembersByUUID().remove(uuid);
|
|
||||||
party.onPlayerRemove(player.getName(), reason);
|
|
||||||
if(player.getOpenInventory() != null)
|
if(player.getOpenInventory() != null)
|
||||||
{
|
{
|
||||||
if (Menu.get(player.getUniqueId()) != null)
|
if (Menu.get(player.getUniqueId()) != null)
|
||||||
@ -126,6 +131,15 @@ public class PartyManager extends MiniPlugin
|
|||||||
Menu.remove(player.getUniqueId());
|
Menu.remove(player.getUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(reason == PartyRemoveReason.DISBANDED_BY_OWNER)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
party.getMembers().remove(player.getName());
|
||||||
|
party.getMembersByUUID().remove(uuid);
|
||||||
|
party.onPlayerRemove(player.getName(), reason);
|
||||||
|
|
||||||
int size = party.getMembers().size();
|
int size = party.getMembers().size();
|
||||||
if(size <= 1)
|
if(size <= 1)
|
||||||
{
|
{
|
||||||
@ -147,14 +161,17 @@ public class PartyManager extends MiniPlugin
|
|||||||
|
|
||||||
public void disbandParty(Party party)
|
public void disbandParty(Party party)
|
||||||
{
|
{
|
||||||
List<String> members = party.getMembers();
|
List<UUID> members = Lists.newArrayList(party.getMembersByUUID());
|
||||||
members.stream().map(Bukkit::getPlayer).forEach(player -> removeFromParty(player.getUniqueId(), PartyRemoveReason.LEFT));
|
Lang.DISBANDED_BY_OWNER.send(party);
|
||||||
|
members.stream().forEach(player -> removeFromParty(player, PartyRemoveReason.DISBANDED_BY_OWNER));
|
||||||
|
party.getMembers().clear();
|
||||||
|
party.getMembersByUUID().clear();
|
||||||
removeParty(party);
|
removeParty(party);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void transferOwner(String newOwner, String oldOwner)
|
public void transferOwner(String newOwner, String oldOwner)
|
||||||
{
|
{
|
||||||
Party party = _parties.remove(oldOwner.toLowerCase());
|
Party party = _parties.remove(oldOwner);
|
||||||
if(party == null)
|
if(party == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -9,6 +9,7 @@ public enum PartyRemoveReason
|
|||||||
LEFT(2, "left"),
|
LEFT(2, "left"),
|
||||||
OTHER(3, "other"),
|
OTHER(3, "other"),
|
||||||
DISBANDED(4, "disbanded"),
|
DISBANDED(4, "disbanded"),
|
||||||
|
DISBANDED_BY_OWNER(5, "disbandedByOwner"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private int _id;
|
private int _id;
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
package mineplex.core.party.command;
|
package mineplex.core.party.command;
|
||||||
|
|
||||||
import mineplex.core.chat.Chat;
|
|
||||||
import mineplex.core.command.CommandBase;
|
import mineplex.core.command.CommandBase;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.jsonchat.ChildJsonMessage;
|
import mineplex.core.common.jsonchat.ChildJsonMessage;
|
||||||
import mineplex.core.common.jsonchat.ClickEvent;
|
import mineplex.core.common.jsonchat.ClickEvent;
|
||||||
import mineplex.core.common.jsonchat.JsonMessage;
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.party.Lang;
|
import mineplex.core.party.Lang;
|
||||||
@ -30,14 +28,14 @@ public class PartyCommand extends CommandBase<PartyManager>
|
|||||||
|
|
||||||
private final String[] HELP = {
|
private final String[] HELP = {
|
||||||
F.main("Party", "Party Commands (Click the command!)"),
|
F.main("Party", "Party Commands (Click the command!)"),
|
||||||
help("help", "Shows this help screen"),
|
// help("help", "Shows this help screen"),
|
||||||
help("", "Brings up the Party GUI"),
|
help("", "Brings up the Party GUI"),
|
||||||
help("invite <player>", "Invite a player to your party."),
|
//help("invite <player>", "Invite a player to your party."),
|
||||||
help("accept <party>", "Accept an invite to a party."),
|
//help("accept <party>", "Accept an invite to a party."),
|
||||||
help("deny <party>", "Deny an invite to a party."),
|
//help("deny <party>", "Deny an invite to a party."),
|
||||||
help("leave", "Leave your current party"),
|
//help("leave", "Leave your current party"),
|
||||||
help("kick <player>", "Kick a player from your party."),
|
//help("kick <player>", "Kick a player from your party."),
|
||||||
help("disband", "Disband your party."),
|
//help("disband", "Disband your party."),
|
||||||
C.cBlue + "Party> " + C.cWhite + "#<message> " + C.cGray + "- Send a message to your party."
|
C.cBlue + "Party> " + C.cWhite + "#<message> " + C.cGray + "- Send a message to your party."
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -49,28 +47,6 @@ public class PartyCommand extends CommandBase<PartyManager>
|
|||||||
@Override
|
@Override
|
||||||
public void Execute(Player caller, String[] args)
|
public void Execute(Player caller, String[] args)
|
||||||
{
|
{
|
||||||
if(_aliasUsed.equalsIgnoreCase("z"))
|
|
||||||
{
|
|
||||||
caller.sendMessage(F.main("Party", "That command is no longer allowed! Please use \"/party\""));
|
|
||||||
caller.sendMessage(HELP[0]);
|
|
||||||
//Show this menu
|
|
||||||
for(int i = 1; i < HELP.length; i++)
|
|
||||||
{
|
|
||||||
String s = HELP[i];
|
|
||||||
String command = ChatColor.stripColor(s);
|
|
||||||
ChildJsonMessage jsonMessage = new ChildJsonMessage(s);
|
|
||||||
if ((i + 1) == HELP.length)
|
|
||||||
{
|
|
||||||
command = "#<message>";
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
command = command.substring(command.indexOf("/"), command.indexOf("-") - 1);
|
|
||||||
}
|
|
||||||
jsonMessage.click(ClickEvent.SUGGEST_COMMAND, command);
|
|
||||||
jsonMessage.sendToPlayer(caller);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (args.length == 0)
|
if (args.length == 0)
|
||||||
{
|
{
|
||||||
Party party = Plugin.getParty(caller);
|
Party party = Plugin.getParty(caller);
|
||||||
|
@ -7,7 +7,6 @@ import mineplex.core.common.util.F;
|
|||||||
import mineplex.core.party.Lang;
|
import mineplex.core.party.Lang;
|
||||||
import mineplex.core.party.Party;
|
import mineplex.core.party.Party;
|
||||||
import mineplex.core.party.PartyManager;
|
import mineplex.core.party.PartyManager;
|
||||||
import mineplex.core.party.PartyRemoveReason;
|
|
||||||
import mineplex.core.party.event.PartyDataReceivedEvent;
|
import mineplex.core.party.event.PartyDataReceivedEvent;
|
||||||
import mineplex.core.party.manager.PartyInviteManager.InviteResponse;
|
import mineplex.core.party.manager.PartyInviteManager.InviteResponse;
|
||||||
import mineplex.core.party.manager.PartyJoinManager.JoinResponseReason;
|
import mineplex.core.party.manager.PartyJoinManager.JoinResponseReason;
|
||||||
@ -17,20 +16,15 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
import org.jooq.util.derby.sys.Sys;
|
|
||||||
import redis.clients.jedis.Jedis;
|
import redis.clients.jedis.Jedis;
|
||||||
import redis.clients.jedis.JedisPool;
|
import redis.clients.jedis.JedisPool;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static mineplex.core.party.redis.RedisMessageType.INVITE_PLAYER_REQUEST;
|
import static mineplex.core.party.redis.RedisMessageType.INVITE_PLAYER_REQUEST;
|
||||||
import static mineplex.core.party.redis.RedisMessageType.PARTY_INFO;
|
import static mineplex.core.party.redis.RedisMessageType.PARTY_INFO;
|
||||||
import static net.minecraft.server.v1_8_R3.PotionBrewer.c;
|
|
||||||
import static net.minecraft.server.v1_8_R3.PotionBrewer.f;
|
|
||||||
import static sun.audio.AudioPlayer.player;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redis system for Parties
|
* Redis system for Parties
|
||||||
@ -56,6 +50,7 @@ public class PartyRedisManager
|
|||||||
_channel = CHANNEL_BASE + "-" + serverName;
|
_channel = CHANNEL_BASE + "-" + serverName;
|
||||||
|
|
||||||
plugin.runAsync(() -> {
|
plugin.runAsync(() -> {
|
||||||
|
System.out.println("Connecting to redis and listening on channel " + _channel);
|
||||||
try (Jedis jedis = readPool.getResource())
|
try (Jedis jedis = readPool.getResource())
|
||||||
{
|
{
|
||||||
jedis.subscribe(new PartyRedisListener(this), _channel, FIND_PLAYERS_CHANNEL);
|
jedis.subscribe(new PartyRedisListener(this), _channel, FIND_PLAYERS_CHANNEL);
|
||||||
@ -65,6 +60,7 @@ public class PartyRedisManager
|
|||||||
|
|
||||||
public void publish(String server, RedisMessageType messageType, String... args)
|
public void publish(String server, RedisMessageType messageType, String... args)
|
||||||
{
|
{
|
||||||
|
System.out.println("Sending " + messageType.name() + " to " + server);
|
||||||
_plugin.runAsync(() -> {
|
_plugin.runAsync(() -> {
|
||||||
try (Jedis jedis = _writePool.getResource())
|
try (Jedis jedis = _writePool.getResource())
|
||||||
{
|
{
|
||||||
@ -200,7 +196,7 @@ public class PartyRedisManager
|
|||||||
{
|
{
|
||||||
Party party = GSON.fromJson(json, Party.class);
|
Party party = GSON.fromJson(json, Party.class);
|
||||||
_plugin.addParty(party);
|
_plugin.addParty(party);
|
||||||
party.getMembersByUUID().forEach(s -> _plugin.addToParty(s, party));
|
party.getMembersByUUID().forEach(s -> _plugin.addToPartyOnTransfer(s, party));
|
||||||
Bukkit.getServer().getPluginManager().callEvent(new PartyDataReceivedEvent(party));
|
Bukkit.getServer().getPluginManager().callEvent(new PartyDataReceivedEvent(party));
|
||||||
}
|
}
|
||||||
}.runTaskLater(_plugin.getPlugin(), 10L);
|
}.runTaskLater(_plugin.getPlugin(), 10L);
|
||||||
|
@ -3,8 +3,6 @@ package mineplex.core.party.redis;
|
|||||||
import mineplex.core.party.manager.PartyRedisManager;
|
import mineplex.core.party.manager.PartyRedisManager;
|
||||||
import redis.clients.jedis.JedisPubSub;
|
import redis.clients.jedis.JedisPubSub;
|
||||||
|
|
||||||
import static net.minecraft.server.v1_8_R3.PotionBrewer.m;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles incoming messages into the Party Redis System
|
* Handles incoming messages into the Party Redis System
|
||||||
*/
|
*/
|
||||||
@ -21,6 +19,7 @@ public class PartyRedisListener extends JedisPubSub
|
|||||||
@Override
|
@Override
|
||||||
public void onMessage(String channel, String message)
|
public void onMessage(String channel, String message)
|
||||||
{
|
{
|
||||||
|
System.out.println("Message on " + channel + " :: " + message);
|
||||||
if(channel.equalsIgnoreCase(_redisManager.getFinder()))
|
if(channel.equalsIgnoreCase(_redisManager.getFinder()))
|
||||||
{
|
{
|
||||||
_redisManager.handle(RedisMessageType.PLAYER_FIND_REQUEST, message);
|
_redisManager.handle(RedisMessageType.PLAYER_FIND_REQUEST, message);
|
||||||
|
@ -31,6 +31,6 @@ public class TransferOwnerButton extends PartyButton
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(Player player, ClickType clickType)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
new PartyTransferOwnerMenu(getPlugin(), player, getParty());
|
new PartyTransferOwnerMenu(getPlugin(), player, getParty()).openInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import mineplex.core.common.util.F;
|
|||||||
import mineplex.core.party.Lang;
|
import mineplex.core.party.Lang;
|
||||||
import mineplex.core.party.Party;
|
import mineplex.core.party.Party;
|
||||||
import mineplex.core.party.PartyManager;
|
import mineplex.core.party.PartyManager;
|
||||||
import mineplex.core.anvilMenu.PlayerInputActionMenu;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -33,6 +32,12 @@ public class PlayerSuggestPlayerMenu extends PlayerNameMenu
|
|||||||
Lang.NO_PARTY.send(_player);
|
Lang.NO_PARTY.send(_player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(_party.contains(name))
|
||||||
|
{
|
||||||
|
Lang.ALREADY_MEMBER.send(_player, name);
|
||||||
|
}
|
||||||
|
|
||||||
Player player = Bukkit.getPlayerExact(_party.getOwner());
|
Player player = Bukkit.getPlayerExact(_party.getOwner());
|
||||||
|
|
||||||
_party.sendMessage(C.mHead + "Party> " + F.name(_player.getName()) + " has suggested " + F.name(name) + " be invited.");
|
_party.sendMessage(C.mHead + "Party> " + F.name(_player.getName()) + " has suggested " + F.name(name) + " be invited.");
|
||||||
|
@ -9,6 +9,7 @@ import mineplex.core.elo.EloTeam;
|
|||||||
import mineplex.core.itemstack.ItemBuilder;
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
import mineplex.core.packethandler.IPacketHandler;
|
import mineplex.core.packethandler.IPacketHandler;
|
||||||
import mineplex.core.packethandler.PacketInfo;
|
import mineplex.core.packethandler.PacketInfo;
|
||||||
|
import mineplex.core.party.Party;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
@ -1112,8 +1113,7 @@ public abstract class Game implements Listener
|
|||||||
{
|
{
|
||||||
return team.GetSize() < PlayersPerTeam;
|
return team.GetSize() < PlayersPerTeam;
|
||||||
}
|
}
|
||||||
return Manager.IsTeamBalance() ? team.GetSize() < Math.max(1, UtilServer.getPlayers().length / GetTeamList().size())
|
return !Manager.IsTeamBalance() || team.GetSize() < Math.max(1, UtilServer.getPlayers().length / GetTeamList().size());
|
||||||
: true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package nautilus.game.arcade.managers;
|
package nautilus.game.arcade.managers;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
@ -23,7 +21,6 @@ import nautilus.game.arcade.game.Game.GameState;
|
|||||||
import nautilus.game.arcade.game.GameTeam;
|
import nautilus.game.arcade.game.GameTeam;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
import nautilus.game.arcade.kit.ProgressingKit;
|
import nautilus.game.arcade.kit.ProgressingKit;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -41,6 +38,8 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class GamePlayerManager implements Listener
|
public class GamePlayerManager implements Listener
|
||||||
{
|
{
|
||||||
ArcadeManager Manager;
|
ArcadeManager Manager;
|
||||||
@ -267,6 +266,7 @@ public class GamePlayerManager implements Listener
|
|||||||
TeamClick(player, team);
|
TeamClick(player, team);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void TeamClick(final Player player, final GameTeam team)
|
public void TeamClick(final Player player, final GameTeam team)
|
||||||
{
|
{
|
||||||
if (Manager.GetGame() == null)
|
if (Manager.GetGame() == null)
|
||||||
@ -301,8 +301,9 @@ public class GamePlayerManager implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!game.GetTeamPreferences().containsKey(team))
|
if (!game.GetTeamPreferences().containsKey(team))
|
||||||
game.GetTeamPreferences().put(team, new ArrayList<Player>());
|
{
|
||||||
|
game.GetTeamPreferences().put(team, new ArrayList<>());
|
||||||
|
}
|
||||||
game.GetTeamPreferences().get(team).add(player);
|
game.GetTeamPreferences().get(team).add(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,8 +318,6 @@ public class GamePlayerManager implements Listener
|
|||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Kit kit = Manager.GetLobby().GetClickedKit(event.getRightClicked());
|
Kit kit = Manager.GetLobby().GetClickedKit(event.getRightClicked());
|
||||||
|
|
||||||
if (kit == null)
|
if (kit == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user