Add distribute items on team leave #34
@ -129,16 +129,16 @@ public class MWTeam {
|
|||||||
public void leave(Player p) {
|
public void leave(Player p) {
|
||||||
if (!players.contains(p)) return;
|
if (!players.contains(p)) return;
|
||||||
|
|
||||||
ItemStack[] savedInventory = p.getInventory().getContents();
|
|
||||||
players.remove(p);
|
players.remove(p);
|
||||||
p.getInventory().clear();
|
for (ItemStack stack : p.getInventory().getContents()) {
|
||||||
for (ItemStack stack : savedInventory) {
|
|
||||||
if (stack == null) continue;
|
if (stack == null) continue;
|
||||||
if (stack.getType() == Material.AIR) continue;
|
if (stack.getType() == Material.AIR) continue;
|
||||||
if (stack.isSimilar(bow)) continue;
|
if (stack.isSimilar(bow)) continue;
|
||||||
givePlayerItem(stack);
|
givePlayerItem(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.getInventory().clear();
|
||||||
|
|
||||||
p.setDisplayName("§7" + p.getName());
|
p.setDisplayName("§7" + p.getName());
|
||||||
sbteam.removePlayer(p);
|
sbteam.removePlayer(p);
|
||||||
if (players.isEmpty() && MissileWars.getFightState() == FightState.FIGHTING)
|
if (players.isEmpty() && MissileWars.getFightState() == FightState.FIGHTING)
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren