Update ServerControl.java (#339)

* Update ServerControl.java

Hopefully made core fill for teams.

* Fixed compile errors and incorrect team handling
This commit is contained in:
Milinai
2018-11-17 18:57:10 +01:00
committed by Anuken
parent 1251680a1c
commit 03268a5575

View File

@@ -355,13 +355,20 @@ public class ServerControl extends Module{
err("Not playing. Host first.");
return;
}
for(Item item : content.items()){
if(item.type == ItemType.material){
state.teams.get(Team.blue).cores.first().entity.items.add(item, 2000);
try{
Team team = Team.valueOf(arg[0]);
for(Item item : content.items()){
if(item.type == ItemType.material){
state.teams.get(team).cores.first().entity.items.add(item, 2000);
}
}
info("Core filled.");
}catch(IllegalArgumentException ignored){
err("No such team exists.");
}
info("Core filled.");
});
handler.register("crashreport", "<on/off>", "Disables or enables automatic crash reporting", arg -> {