This commit is contained in:
parent
c484e6d78a
commit
c095f7da28
@ -47,6 +47,8 @@ public class EnergyTicker {
|
||||
|
||||
NetworkComponent.getInstance((ServerWorld) world).clearCache();
|
||||
|
||||
world.getProfiler().push("startTick");
|
||||
|
||||
List<EnergyTickable> started = new ArrayList<>();
|
||||
|
||||
List<EnergyTickable> temp = new ArrayList<>(scheduled);
|
||||
@ -54,7 +56,7 @@ public class EnergyTicker {
|
||||
while (!temp.isEmpty()) {
|
||||
for (EnergyTickable tickable : temp) {
|
||||
if (!started.contains(tickable)) {
|
||||
world.getProfiler().push(() -> tickable.getID() + " startTick");
|
||||
world.getProfiler().push(tickable::getID);
|
||||
|
||||
temp2.addAll(tickable.startTick());
|
||||
started.add(tickable);
|
||||
@ -62,8 +64,10 @@ public class EnergyTicker {
|
||||
world.getProfiler().pop();
|
||||
}
|
||||
}
|
||||
temp.clear();
|
||||
temp.addAll(temp2);
|
||||
|
||||
List<EnergyTickable> temp3 = temp;
|
||||
temp = temp2;
|
||||
temp2 = temp3;
|
||||
temp2.clear();
|
||||
}
|
||||
|
||||
@ -73,8 +77,12 @@ public class EnergyTicker {
|
||||
Collections.shuffle(started, world.random);
|
||||
world.getProfiler().pop();
|
||||
|
||||
world.getProfiler().pop();
|
||||
|
||||
world.getProfiler().push("logicTick");
|
||||
|
||||
for (EnergyTickable tickable : started) {
|
||||
world.getProfiler().push(() -> tickable.getID() + " logicTick");
|
||||
world.getProfiler().push(tickable::getID);
|
||||
|
||||
tickable.logicTick();
|
||||
|
||||
@ -82,6 +90,8 @@ public class EnergyTicker {
|
||||
}
|
||||
|
||||
world.getProfiler().pop();
|
||||
|
||||
world.getProfiler().pop();
|
||||
}
|
||||
scheduled.clear();
|
||||
|
||||
|
Reference in New Issue
Block a user