mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-11 19:00:37 +01:00
Remove team metadata
This commit is contained in:
parent
d9762be13b
commit
21b2908e83
@ -427,11 +427,14 @@ public class EventListen implements Listener {
|
||||
if (!Setting.USE_SCOREBOARD_TEAMS.asBoolean())
|
||||
return;
|
||||
String teamName = event.getNPC().data().get(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA, "");
|
||||
if (teamName.isEmpty() || !(event.getNPC() instanceof Player))
|
||||
if (teamName.isEmpty())
|
||||
return;
|
||||
Team team = Util.getDummyScoreboard().getTeam(teamName);
|
||||
event.getNPC().data().remove(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA);
|
||||
if (team == null || !(event.getNPC().getEntity() instanceof Player))
|
||||
return;
|
||||
Player player = (Player) event.getNPC().getEntity();
|
||||
Team team = Util.getDummyScoreboard().getTeam(teamName);
|
||||
if (team != null && team.hasPlayer(player)) {
|
||||
if (team.hasPlayer(player)) {
|
||||
if (team.getSize() == 1) {
|
||||
Util.sendTeamPacketToOnlinePlayers(team, 1);
|
||||
team.unregister();
|
||||
|
Loading…
Reference in New Issue
Block a user