Update ServerControl.java
This commit is contained in:
@@ -44,6 +44,7 @@ public class ServerControl implements ApplicationListener{
|
|||||||
private FileHandle currentLogFile;
|
private FileHandle currentLogFile;
|
||||||
private boolean inExtraRound;
|
private boolean inExtraRound;
|
||||||
private Task lastTask;
|
private Task lastTask;
|
||||||
|
private GameMode lastMode = GameMode.survival;
|
||||||
|
|
||||||
private Thread socketThread;
|
private Thread socketThread;
|
||||||
private PrintWriter socketOutput;
|
private PrintWriter socketOutput;
|
||||||
@@ -235,6 +236,7 @@ public class ServerControl implements ApplicationListener{
|
|||||||
info("Loading map...");
|
info("Loading map...");
|
||||||
|
|
||||||
logic.reset();
|
logic.reset();
|
||||||
|
lastMode = preset:
|
||||||
try{
|
try{
|
||||||
world.loadMap(result);
|
world.loadMap(result);
|
||||||
state.rules = preset.apply(result.rules());
|
state.rules = preset.apply(result.rules());
|
||||||
@@ -698,12 +700,13 @@ public class ServerControl implements ApplicationListener{
|
|||||||
players.add(p);
|
players.add(p);
|
||||||
p.setDead(true);
|
p.setDead(true);
|
||||||
}
|
}
|
||||||
Rules rules = state.rules;
|
|
||||||
logic.reset();
|
logic.reset();
|
||||||
state.rules = rules;
|
|
||||||
Call.onWorldDataBegin();
|
Call.onWorldDataBegin();
|
||||||
run.run();
|
run.run();
|
||||||
logic.play();
|
logic.play();
|
||||||
|
state.rules = lastMode.apply(world.getMap().rules());
|
||||||
for(Player p : players){
|
for(Player p : players){
|
||||||
p.reset();
|
p.reset();
|
||||||
if(state.rules.pvp){
|
if(state.rules.pvp){
|
||||||
|
|||||||
Reference in New Issue
Block a user