Update to CraftBukkit 1.6.4

By: md_5 <md_5@live.com.au>
This commit is contained in:
Spigot
2013-09-20 11:46:45 +10:00
parent 759d56f0fb
commit d0f0d605bf
26 changed files with 129 additions and 177 deletions

View File

@@ -1,14 +1,14 @@
From b51ae5df5a86c36e57460ed23da469e615fa943e Mon Sep 17 00:00:00 2001
From 608e4269f7d6eaa3db5509d6c696185e35a351e9 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] Highly Optimized Tick Loop
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 26cfa0c..f025083 100644
index 029131d..d3a4265 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -86,6 +86,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -87,6 +87,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod;
// CraftBukkit end
@@ -21,21 +21,21 @@ index 26cfa0c..f025083 100644
public MinecraftServer(OptionSet options) { // CraftBukkit - signature file -> OptionSet
this.c = Proxy.NO_PROXY;
@@ -389,39 +395,23 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@@ -391,39 +397,23 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
public void run() {
try {
if (this.init()) {
- long i = aq();
-
- for (long j = 0L; this.isRunning; this.Q = true) {
- for (long j = 0L; this.isRunning; this.R = true) {
- long k = aq();
- long l = k - i;
-
- if (l > 2000L && i - this.R >= 15000L) {
- if (l > 2000L && i - this.S >= 15000L) {
- if (this.server.getWarnOnOverload()) // CraftBukkit - Added option to suppress warning messages
- this.getLogger().warning("Can\'t keep up! Did the system time change, or is the server overloaded?");
- l = 2000L;
- this.R = i;
- this.S = i;
- }
-
- if (l < 0L) {
@@ -49,7 +49,7 @@ index 26cfa0c..f025083 100644
- this.s();
- j = 0L;
+ // Spigot start
+ for (long lastTick = 0L; this.isRunning; this.Q = true) {
+ for (long lastTick = 0L; this.isRunning; this.R = true) {
+ long curTime = System.nanoTime();
+ long wait = TICK_TIME - (curTime - lastTick) - catchupTime;
+ if (wait > 0) {
@@ -117,7 +117,7 @@ index 0000000..f114a31
+ }
+}
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 83696e9..f97a80b 100644
index 8f42042..693518d 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -14,6 +14,7 @@ import net.minecraft.server.MinecraftServer;