mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2025-01-24 09:01:52 +01:00
Do group size check before initializing team block
This commit is contained in:
parent
b746e40155
commit
670664ca2f
@ -55,7 +55,9 @@ public class BedSign extends DSign {
|
||||
Block block = BlockUtil.getAttachedBlock(getSign().getBlock());
|
||||
|
||||
if (block.getType() == Material.BED_BLOCK) {
|
||||
getGameWorld().addGameBlock(new TeamBed(block, getGame().getDGroups().get(team)));
|
||||
if (getGame().getDGroups().size() > team) {
|
||||
getGameWorld().addGameBlock(new TeamBed(block, getGame().getDGroups().get(team)));
|
||||
}
|
||||
getSign().getBlock().setType(Material.AIR);
|
||||
} else {
|
||||
markAsErroneous();
|
||||
|
@ -49,7 +49,9 @@ public class FlagSign extends DSign {
|
||||
@Override
|
||||
public void onInit() {
|
||||
this.team = NumberUtil.parseInt(lines[1]);
|
||||
getGameWorld().addGameBlock(new TeamFlag(getSign().getBlock(), getGame().getDGroups().get(team)));
|
||||
if (getGame().getDGroups().size() > team) {
|
||||
getGameWorld().addGameBlock(new TeamFlag(getSign().getBlock(), getGame().getDGroups().get(team)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user