Add distribute items on team leave #34
@ -62,7 +62,7 @@ public class MWTeam {
|
||||
this.color = color;
|
||||
this.spawn = spawn;
|
||||
this.portalZ = portalZ;
|
||||
if(FightScoreboard.getScoreboard().getTeam(teamName) == null)
|
||||
if (FightScoreboard.getScoreboard().getTeam(teamName) == null)
|
||||
sbteam = FightScoreboard.getScoreboard().registerNewTeam(teamName);
|
||||
else
|
||||
sbteam = FightScoreboard.getScoreboard().getTeam(teamName);
|
||||
@ -108,7 +108,7 @@ public class MWTeam {
|
||||
return portalZ;
|
||||
}
|
||||
|
||||
public Location getSpawn(){
|
||||
public Location getSpawn() {
|
||||
return spawn;
|
||||
}
|
||||
|
||||
@ -129,7 +129,16 @@ public class MWTeam {
|
||||
public void leave(Player p) {
|
||||
if (!players.contains(p)) return;
|
||||
|
||||
ItemStack[] savedInventory = p.getInventory().getContents();
|
||||
players.remove(p);
|
||||
p.getInventory().clear();
|
||||
for (ItemStack stack : savedInventory) {
|
||||
if (stack == null) continue;
|
||||
if (stack.getType() == Material.AIR) continue;
|
||||
if (stack.isSimilar(bow)) continue;
|
||||
givePlayerItem(stack);
|
||||
}
|
||||
|
||||
p.setDisplayName("§7" + p.getName());
|
||||
sbteam.removePlayer(p);
|
||||
if (players.isEmpty() && MissileWars.getFightState() == FightState.FIGHTING)
|
||||
@ -156,7 +165,7 @@ public class MWTeam {
|
||||
return MissileWars.getRedTeam();
|
||||
}
|
||||
|
||||
public String getColorCode(){
|
||||
public String getColorCode() {
|
||||
return "§" + color.getChar();
|
||||
}
|
||||
|
||||
|
@ -47,5 +47,4 @@ public class ConnectionListener extends BasicListener{
|
||||
MWTeam.removeInvitations(e.getPlayer());
|
||||
MissileWars.leave(e.getPlayer());
|
||||
}
|
||||
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren