diff --git a/annotations/src/main/resources/revisions/CommanderUnitWaterMoveEntity/0.json b/annotations/src/main/resources/revisions/CommanderUnitWaterMoveEntity/0.json new file mode 100644 index 0000000000..010ca755c5 --- /dev/null +++ b/annotations/src/main/resources/revisions/CommanderUnitWaterMoveEntity/0.json @@ -0,0 +1 @@ +{fields:[{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/core/src/mindustry/async/AsyncLogic.java b/core/src/mindustry/async/AsyncLogic.java index 7820f86061..e27a9c8012 100644 --- a/core/src/mindustry/async/AsyncLogic.java +++ b/core/src/mindustry/async/AsyncLogic.java @@ -7,17 +7,19 @@ import mindustry.game.EventType.*; import java.util.concurrent.*; +import static mindustry.Vars.state; + public class AsyncLogic{ //all processes to be executed each frame - private Array processes = Array.with( + private final Array processes = Array.with( new PhysicsProcess(), Vars.teamIndex = new TeamIndexProcess() ); //futures to be awaited - private Array> futures = new Array<>(); + private final Array> futures = new Array<>(); - private ExecutorService executor = Executors.newFixedThreadPool(processes.size, r -> { + private final ExecutorService executor = Executors.newFixedThreadPool(processes.size, r -> { Thread thread = new Thread(r, "AsyncLogic-Thread"); thread.setDaemon(true); thread.setUncaughtExceptionHandler((t, e) -> Core.app.post(() -> { throw new RuntimeException(e); })); @@ -41,7 +43,7 @@ public class AsyncLogic{ } public void begin(){ - if(Vars.state.isPlaying()){ + if(state.isPlaying()){ //sync begin for(AsyncProcess p : processes){ p.begin(); @@ -59,7 +61,7 @@ public class AsyncLogic{ } public void end(){ - if(Vars.state.isPlaying()){ + if(state.isPlaying()){ complete(); //sync end (flush data)