Overall difficulty decrease / Crash fix / Server fillitems command

This commit is contained in:
Anuken
2018-08-08 15:02:51 -04:00
parent 91552a3a2b
commit f8def04653
4 changed files with 38 additions and 21 deletions

View File

@@ -16,6 +16,8 @@ import io.anuke.mindustry.game.Version;
import io.anuke.mindustry.net.*;
import io.anuke.mindustry.net.Administration.PlayerInfo;
import io.anuke.mindustry.net.Packets.KickReason;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemType;
import io.anuke.mindustry.ui.fragments.DebugFragment;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.*;
@@ -261,6 +263,20 @@ public class ServerControl extends Module{
}
});
handler.register("fillitems", "Fill the core with 2000 items.", arg -> {
if(!state.is(State.playing)){
err("Not playing. Host first.");
return;
}
for(Item item : Item.all()){
if(item.type == ItemType.material){
state.teams.get(Team.blue).cores.first().entity.items.add(item, 2000);
}
}
info("Core filled.");
});
handler.register("friendlyfire", "<on/off>", "Enable or disable friendly fire.", arg -> {
String s = arg[0];
if(s.equalsIgnoreCase("on")){
@@ -544,10 +560,12 @@ public class ServerControl extends Module{
return;
}
SaveIO.loadFromSlot(slot);
info("Save loaded.");
host();
state.set(State.playing);
threads.run(() -> {
SaveIO.loadFromSlot(slot);
info("Save loaded.");
host();
state.set(State.playing);
});
});
handler.register("save", "<slot>", "Save game state to a slot.", arg -> {
@@ -559,11 +577,11 @@ public class ServerControl extends Module{
return;
}
int slot = Strings.parseInt(arg[0]);
SaveIO.saveToSlot(slot);
info("Saved to slot {0}.", slot);
threads.run(() -> {
int slot = Strings.parseInt(arg[0]);
SaveIO.saveToSlot(slot);
info("Saved to slot {0}.", slot);
});
});
handler.register("griefers", "[min-break:place-ratio] [min-breakage]", "Find possible griefers currently online.", arg -> {