Paper 1.13.1 Update

Updated Upstream (Bukkit/CraftBukkit/Spigot)

Bukkit Changes:
2dcc44dc SPIGOT-4307: Fix hacky API for banners on shields
e0fc6572 SPIGOT-4309: Add "forced" display of particles
efeeab2f Add index to README.md for easier navigation
f502bc6f Update to Minecraft 1.13.1

CraftBukkit Changes:
d0bb0a1d Fix some tests randomly failing
997d378d Fix client stall in specific teleportation scenarios
b3dc2366 SPIGOT-4307: Fix hacky API for banners on shields
2a271162 SPIGOT-4301: Fix more invalid enchants
5d0d83bb SPIGOT-4309: Add "forced" display of particles
a6772578 Add additional tests for CraftBlockData
ce1af0c3 Update to Minecraft 1.13.1

Spigot Changes:
2440e189 Rebuild patches
4ecffced Update to Minecraft 1.13.1
This commit is contained in:
Aikar
2018-08-26 14:11:49 -04:00
parent 338c730c10
commit 05dfa62d32
324 changed files with 1984 additions and 2579 deletions

View File

@@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c72bdd29d1..687250c639 100644
index 8dc922ccd0..e8c3dcc244 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@@ -25,34 +25,36 @@ index c72bdd29d1..687250c639 100644
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod;
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
public CommandDispatcher vanillaCommandDispatcher;
// CraftBukkit end
// Spigot start
- public static final int TPS = 20;
- public static final int TICK_TIME = 1000000000 / TPS;
public static final int TPS = 20;
public static final int TICK_TIME = 1000000000 / TPS;
- private static final int SAMPLE_INTERVAL = 100;
- public final double[] recentTps = new double[ 3 ];
+ private static final int SAMPLE_INTERVAL = 20; // Paper
public final double[] recentTps = new double[ 3 ];
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
// Spigot end
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
this.isRunning = false;
}
- // Spigot Start
- private static double calcTps(double avg, double exp, double tps)
- {
- return ( avg * exp ) + ( tps * ( 1 - exp ) );
private boolean aT() {
- return SystemUtils.b() < this.aa;
+ return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own
}
// Spigot Start
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
{
return ( avg * exp ) + ( tps * ( 1 - exp ) );
}
+
+ // Paper start - Further improve server tick loop
+ private static final int TPS = 20;
+ private static final long SEC_IN_NANO = 1000000000;
+ public static final long TICK_TIME = SEC_IN_NANO / TPS;
+ private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L;
+ private static final int SAMPLE_INTERVAL = 20;
+ private long lastTick = 0;
+ private long catchupTime = 0;
+ public final RollingAverage tps1 = new RollingAverage(60);
+ public final RollingAverage tps5 = new RollingAverage(60 * 5);
+ public final RollingAverage tps15 = new RollingAverage(60 * 15);
+ public double[] recentTps = new double[3]; // Paper - Fine have your darn compat with bad plugins
+
+ public static class RollingAverage {
+ private final int size;
@@ -89,18 +91,18 @@ index c72bdd29d1..687250c639 100644
+ public double getAverage() {
+ return total / time;
+ }
}
- // Spigot End
+ }
+ // Paper End
// Spigot End
public void run() {
try {
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
// Spigot start
Arrays.fill( recentTps, 20 );
- long lastTick = System.nanoTime(), catchupTime = 0, curTime, wait, tickSection = lastTick, tickCount = 1;
+ long start = System.nanoTime(), lastTick = start - TICK_TIME, catchupTime = 0, curTime, wait, tickSection = start; // Paper - Further improve server tick loop
+ long start = System.nanoTime(), curTime, wait, tickSection = start; // Paper - Further improve server tick loop
+ lastTick = start - TICK_TIME; // Paper
while (this.isRunning) {
curTime = System.nanoTime();
- wait = TICK_TIME - (curTime - lastTick) - catchupTime;
@@ -151,11 +153,11 @@ index c72bdd29d1..687250c639 100644
- MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
+ //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
this.v();
this.a(this::aT);
this.aa += 50L;
// Spigot end
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 567af5b9fa..1c003a3898 100644
index 6414f3d6b0..f066af3fe5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {