Revert tick loop catch up TPS

This commit is contained in:
md_5 2013-06-08 16:14:43 +10:00
parent 09ec323cc3
commit f6ecb2c9fa
4 changed files with 18 additions and 20 deletions

View File

@ -1,11 +1,11 @@
From c1828561102ac926f5a7a3f3f4d9d3f7d415fe3a Mon Sep 17 00:00:00 2001
From e6b7404237e2092f4fcd6d298f3418a7c35d61e5 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 3 Feb 2013 12:28:17 +1100
Subject: [PATCH] Tick loop optimization - sleep for as long as possible.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3e134fb..16df63f 100644
index 3e134fb..3c80340 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -84,6 +84,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@ -21,7 +21,7 @@ index 3e134fb..16df63f 100644
public MinecraftServer(OptionSet options) { // CraftBukkit - signature file -> OptionSet
k = this;
@@ -380,39 +386,25 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -380,39 +386,23 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
public void run() {
try {
if (this.init()) {
@ -62,9 +62,7 @@ index 3e134fb..16df63f 100644
- j -= 50L;
- this.q();
- }
+ long left = Math.abs(wait);
+ lastTick -= Math.min(TICK_TIME, left);
+ catchupTime = Math.min(TICK_TIME * TPS, left);
+ catchupTime = Math.min(TICK_TIME * TPS, Math.abs(wait));
}
-
- Thread.sleep(1L);

View File

@ -1,4 +1,4 @@
From bd13994293a8c2208638965e6072a486e2c0188e Mon Sep 17 00:00:00 2001
From ccace5cb2e3762d56d5533ac32427abecc381d6c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 10 Jan 2013 00:18:11 -0500
Subject: [PATCH] Improved Timings System
@ -132,7 +132,7 @@ index 965e6ce..58a4acb 100644
this.world.methodProfiler.b();
this.world.methodProfiler.a("looting");
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 16df63f..523d83e 100644
index 3c80340..db396b3 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -6,7 +6,6 @@ import java.security.KeyPair;
@ -151,7 +151,7 @@ index 16df63f..523d83e 100644
import org.bukkit.craftbukkit.util.Waitable;
import org.bukkit.event.server.RemoteServerCommandEvent;
import org.bukkit.event.world.WorldSaveEvent;
@@ -402,7 +402,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -400,7 +400,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
currentTPS = (currentTPS * 0.95) + (1E9 / (curTime - lastTick) * 0.05);
lastTick = curTime;
MinecraftServer.currentTick++;
@ -162,7 +162,7 @@ index 16df63f..523d83e 100644
}
// Spigot end
} else {
@@ -501,6 +504,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -499,6 +502,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
public void r() {
this.methodProfiler.a("levels");
@ -170,7 +170,7 @@ index 16df63f..523d83e 100644
// CraftBukkit start
this.server.getScheduler().mainThreadHeartbeat(this.ticks);
@@ -509,7 +513,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -507,7 +511,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
processQueue.remove().run();
}
@ -181,7 +181,7 @@ index 16df63f..523d83e 100644
// Send time updates to everyone, it will get the right time from the world the player is in.
if (this.ticks % 20 == 0) {
@@ -561,7 +568,9 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -559,7 +566,9 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
this.methodProfiler.b();
this.methodProfiler.a("tracker");
@ -191,7 +191,7 @@ index 16df63f..523d83e 100644
this.methodProfiler.b();
this.methodProfiler.b();
// } // CraftBukkit
@@ -570,14 +579,20 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -568,14 +577,20 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
}
this.methodProfiler.c("connection");

View File

@ -1,14 +1,14 @@
From f8f088807768c6185ac12a126a1b0c035f8205ba Mon Sep 17 00:00:00 2001
From 71385796935c0381e4242da0871d286763302075 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Feb 2013 12:33:20 +1100
Subject: [PATCH] Watchdog Thread.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 523d83e..1079d1c 100644
index db396b3..d197f06 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -406,6 +406,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -404,6 +404,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
this.q();
SpigotTimings.serverTickTimer.stopTiming();
org.spigotmc.CustomTimingsHandler.tick();
@ -16,7 +16,7 @@ index 523d83e..1079d1c 100644
}
// Spigot end
} else {
@@ -433,6 +434,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -431,6 +432,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
this.a(crashreport);
} finally {
try {

View File

@ -1,4 +1,4 @@
From b33ddea4d6783e043f800307afcad113312e0332 Mon Sep 17 00:00:00 2001
From 4ef41da6c5d5959ae5f93d98d2f4aebb464be00a Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 13:04:45 +1100
Subject: [PATCH] Texture Pack Resolutions
@ -6,10 +6,10 @@ Subject: [PATCH] Texture Pack Resolutions
Fix issues when specifiying a server texture pack URL with resolution != 16.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 1079d1c..96cf583 100644
index d197f06..e348ac5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1078,7 +1078,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -1076,7 +1076,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
}
public int S() {