SPIGOT-1284: Run scheduler consistently within a tick
Dieser Commit ist enthalten in:
Ursprung
1faaa340e5
Commit
6b843d995f
@ -413,13 +413,19 @@
|
|||||||
this.methodProfiler.a("save");
|
this.methodProfiler.a("save");
|
||||||
this.v.savePlayers();
|
this.v.savePlayers();
|
||||||
this.saveChunks(true);
|
this.saveChunks(true);
|
||||||
@@ -524,20 +694,40 @@
|
@@ -513,6 +683,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
public void D() {
|
||||||
|
+ this.server.getScheduler().mainThreadHeartbeat(this.ticks); // CraftBukkit
|
||||||
|
this.methodProfiler.a("jobs");
|
||||||
|
Queue queue = this.j;
|
||||||
|
|
||||||
|
@@ -524,20 +695,38 @@
|
||||||
|
|
||||||
this.methodProfiler.c("levels");
|
this.methodProfiler.c("levels");
|
||||||
|
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ this.server.getScheduler().mainThreadHeartbeat(this.ticks);
|
|
||||||
+
|
|
||||||
+ // Run tasks that are waiting on processing
|
+ // Run tasks that are waiting on processing
|
||||||
+ while (!processQueue.isEmpty()) {
|
+ while (!processQueue.isEmpty()) {
|
||||||
+ processQueue.remove().run();
|
+ processQueue.remove().run();
|
||||||
@ -457,7 +463,7 @@
|
|||||||
|
|
||||||
this.methodProfiler.a("tick");
|
this.methodProfiler.a("tick");
|
||||||
|
|
||||||
@@ -564,9 +754,9 @@
|
@@ -564,9 +753,9 @@
|
||||||
worldserver.getTracker().updatePlayers();
|
worldserver.getTracker().updatePlayers();
|
||||||
this.methodProfiler.b();
|
this.methodProfiler.b();
|
||||||
this.methodProfiler.b();
|
this.methodProfiler.b();
|
||||||
@ -469,7 +475,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.methodProfiler.c("connection");
|
this.methodProfiler.c("connection");
|
||||||
@@ -590,10 +780,11 @@
|
@@ -590,10 +779,11 @@
|
||||||
this.o.add(itickable);
|
this.o.add(itickable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -482,7 +488,7 @@
|
|||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
String s = null;
|
String s = null;
|
||||||
String s1 = ".";
|
String s1 = ".";
|
||||||
@@ -638,13 +829,16 @@
|
@@ -638,13 +828,16 @@
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -500,7 +506,7 @@
|
|||||||
if (s != null) {
|
if (s != null) {
|
||||||
dedicatedserver.i(s);
|
dedicatedserver.i(s);
|
||||||
}
|
}
|
||||||
@@ -675,6 +869,25 @@
|
@@ -675,6 +868,25 @@
|
||||||
dedicatedserver.stop();
|
dedicatedserver.stop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -526,7 +532,7 @@
|
|||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception);
|
MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception);
|
||||||
}
|
}
|
||||||
@@ -682,8 +895,10 @@
|
@@ -682,8 +894,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void F() {
|
public void F() {
|
||||||
@ -537,7 +543,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public File d(String s) {
|
public File d(String s) {
|
||||||
@@ -699,7 +914,14 @@
|
@@ -699,7 +913,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldServer getWorldServer(int i) {
|
public WorldServer getWorldServer(int i) {
|
||||||
@ -553,7 +559,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
@@ -723,7 +945,7 @@
|
@@ -723,7 +944,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDebugging() {
|
public boolean isDebugging() {
|
||||||
@ -562,7 +568,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void g(String s) {
|
public void g(String s) {
|
||||||
@@ -738,7 +960,7 @@
|
@@ -738,7 +959,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
@ -571,7 +577,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CrashReport b(CrashReport crashreport) {
|
public CrashReport b(CrashReport crashreport) {
|
||||||
@@ -767,6 +989,7 @@
|
@@ -767,6 +988,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> tabCompleteCommand(ICommandListener icommandlistener, String s, @Nullable BlockPosition blockposition, boolean flag) {
|
public List<String> tabCompleteCommand(ICommandListener icommandlistener, String s, @Nullable BlockPosition blockposition, boolean flag) {
|
||||||
@ -579,7 +585,7 @@
|
|||||||
ArrayList arraylist = Lists.newArrayList();
|
ArrayList arraylist = Lists.newArrayList();
|
||||||
boolean flag1 = s.startsWith("/");
|
boolean flag1 = s.startsWith("/");
|
||||||
|
|
||||||
@@ -809,10 +1032,13 @@
|
@@ -809,10 +1031,13 @@
|
||||||
|
|
||||||
return arraylist;
|
return arraylist;
|
||||||
}
|
}
|
||||||
@ -594,7 +600,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@@ -868,11 +1094,13 @@
|
@@ -868,11 +1093,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(EnumDifficulty enumdifficulty) {
|
public void a(EnumDifficulty enumdifficulty) {
|
||||||
@ -611,7 +617,7 @@
|
|||||||
|
|
||||||
if (worldserver != null) {
|
if (worldserver != null) {
|
||||||
if (worldserver.getWorldData().isHardcore()) {
|
if (worldserver.getWorldData().isHardcore()) {
|
||||||
@@ -939,13 +1167,11 @@
|
@@ -939,13 +1166,11 @@
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
if (this.worldServer != null) {
|
if (this.worldServer != null) {
|
||||||
@ -629,7 +635,7 @@
|
|||||||
WorldData worlddata = worldserver.getWorldData();
|
WorldData worlddata = worldserver.getWorldData();
|
||||||
|
|
||||||
mojangstatisticsgenerator.a("world[" + i + "][dimension]", Integer.valueOf(worldserver.worldProvider.getDimensionManager().getDimensionID()));
|
mojangstatisticsgenerator.a("world[" + i + "][dimension]", Integer.valueOf(worldserver.worldProvider.getDimensionManager().getDimensionID()));
|
||||||
@@ -978,7 +1204,7 @@
|
@@ -978,7 +1203,7 @@
|
||||||
public abstract boolean aa();
|
public abstract boolean aa();
|
||||||
|
|
||||||
public boolean getOnlineMode() {
|
public boolean getOnlineMode() {
|
||||||
@ -638,7 +644,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setOnlineMode(boolean flag) {
|
public void setOnlineMode(boolean flag) {
|
||||||
@@ -1050,13 +1276,9 @@
|
@@ -1050,13 +1275,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGamemode(EnumGamemode enumgamemode) {
|
public void setGamemode(EnumGamemode enumgamemode) {
|
||||||
@ -655,7 +661,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1088,7 +1310,7 @@
|
@@ -1088,7 +1309,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public World getWorld() {
|
public World getWorld() {
|
||||||
@ -664,7 +670,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Entity f() {
|
public Entity f() {
|
||||||
@@ -1160,8 +1382,10 @@
|
@@ -1160,8 +1381,10 @@
|
||||||
WorldServer[] aworldserver = this.worldServer;
|
WorldServer[] aworldserver = this.worldServer;
|
||||||
int i = aworldserver.length;
|
int i = aworldserver.length;
|
||||||
|
|
||||||
@ -677,7 +683,7 @@
|
|||||||
|
|
||||||
if (worldserver != null) {
|
if (worldserver != null) {
|
||||||
Entity entity = worldserver.getEntity(uuid);
|
Entity entity = worldserver.getEntity(uuid);
|
||||||
@@ -1176,7 +1400,7 @@
|
@@ -1176,7 +1399,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getSendCommandFeedback() {
|
public boolean getSendCommandFeedback() {
|
||||||
@ -686,7 +692,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void a(CommandObjectiveExecutor.EnumCommandResult commandobjectiveexecutor_enumcommandresult, int i) {}
|
public void a(CommandObjectiveExecutor.EnumCommandResult commandobjectiveexecutor_enumcommandresult, int i) {}
|
||||||
@@ -1191,7 +1415,7 @@
|
@@ -1191,7 +1414,7 @@
|
||||||
|
|
||||||
public <V> ListenableFuture<V> a(Callable<V> callable) {
|
public <V> ListenableFuture<V> a(Callable<V> callable) {
|
||||||
Validate.notNull(callable);
|
Validate.notNull(callable);
|
||||||
@ -695,7 +701,7 @@
|
|||||||
ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callable);
|
ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callable);
|
||||||
Queue queue = this.j;
|
Queue queue = this.j;
|
||||||
|
|
||||||
@@ -1236,4 +1460,11 @@
|
@@ -1236,4 +1459,11 @@
|
||||||
public int a(@Nullable WorldServer worldserver) {
|
public int a(@Nullable WorldServer worldserver) {
|
||||||
return worldserver != null ? worldserver.getGameRules().c("spawnRadius") : 10;
|
return worldserver != null ? worldserver.getGameRules().c("spawnRadius") : 10;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren