Fix spawn loading percentages
Dieser Commit ist enthalten in:
Ursprung
b801b4baa8
Commit
643187e289
@ -1,4 +1,4 @@
|
||||
From dfd965ef359e7bf7dfc9ed33736374439c753e83 Mon Sep 17 00:00:00 2001
|
||||
From 47ce849db0e23612ca6013dafefca6cfa5129b3d Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 13 Sep 2014 23:14:43 -0400
|
||||
Subject: [PATCH] Configurable Keep Spawn Loaded range per world
|
||||
@ -21,10 +21,10 @@ index eb09be512..6ac58e5ec 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 96d31f874..664007c29 100644
|
||||
index 96d31f874..7fb0a58f9 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -485,8 +485,11 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -485,13 +485,21 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
ArrayList arraylist = Lists.newArrayList();
|
||||
Set set = Sets.newConcurrentHashSet();
|
||||
|
||||
@ -37,6 +37,30 @@ index 96d31f874..664007c29 100644
|
||||
+ // Paper end
|
||||
arraylist.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4));
|
||||
}
|
||||
+ } // Paper
|
||||
+ if (true) { // Paper
|
||||
+ int expected = arraylist.size(); // Paper
|
||||
+
|
||||
|
||||
CompletableFuture completablefuture = worldserver.getChunkProviderServer().a((Iterable) arraylist, (chunk) -> {
|
||||
set.add(chunk.getPos());
|
||||
+ if (set.size() < expected && set.size() % 25 == 0) this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / expected); // Paper
|
||||
});
|
||||
|
||||
while (!completablefuture.isDone()) {
|
||||
@@ -506,11 +514,11 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
|
||||
throw new RuntimeException(executionexception.getCause());
|
||||
} catch (TimeoutException timeoutexception) {
|
||||
- this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / 625);
|
||||
+ this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / expected); // Paper
|
||||
}
|
||||
}
|
||||
|
||||
- this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / 625);
|
||||
+ this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / expected); // Paper
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 6ec1ee26d..a4c8e62e2 100644
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 977b959e4d5d6964c13e43d5f3a6b6db6af2cb32 Mon Sep 17 00:00:00 2001
|
||||
From 767ba63e4bab628feacd5454d38b96a849cb089d Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 28 Apr 2016 00:57:27 -0400
|
||||
Subject: [PATCH] remove null possibility for getServer singleton
|
||||
@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton
|
||||
to stop IDE complaining about potential NPE
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index eb0e1361a..68ab9b7eb 100644
|
||||
index c181acd99..6de0b22f7 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -68,6 +68,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
|
||||
@ -26,7 +26,7 @@ index eb0e1361a..68ab9b7eb 100644
|
||||
this.ac = new ResourceManager(EnumResourcePackType.SERVER_DATA);
|
||||
this.resourcePackRepository = new ResourcePackRepository(ResourcePackLoader::new);
|
||||
this.ag = new CraftingManager();
|
||||
@@ -1806,7 +1809,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -1811,7 +1814,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
// CraftBukkit start
|
||||
@Deprecated
|
||||
public static MinecraftServer getServer() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 575168a9432ee2e2241160b96d5a72f299dfa366 Mon Sep 17 00:00:00 2001
|
||||
From 55c50523df7924649d44089d0ef4e4bd9471334a Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 16 May 2016 20:47:41 -0400
|
||||
Subject: [PATCH] Optimize UserCache / Thread Safe
|
||||
@ -10,10 +10,10 @@ Additionally, move Saving of the User cache to be done async, incase
|
||||
the user never changed the default setting for Spigot's save on stop only.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 68ab9b7eb..0e385e4ea 100644
|
||||
index 6de0b22f7..5f17ec1e9 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -671,7 +671,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -676,7 +676,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
// Spigot start
|
||||
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
|
||||
LOGGER.info("Saving usercache.json");
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 10a2933aa9c03c4525c9e19672a5532ea55965e4 Mon Sep 17 00:00:00 2001
|
||||
From d90131ced1d9d0e53f7c997d16e8ebffb3c3a761 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 19 Sep 2016 23:16:39 -0400
|
||||
Subject: [PATCH] Auto Save Improvements
|
||||
@ -128,7 +128,7 @@ index 982e18f8a..1879c3238 100644
|
||||
public final MinecraftServer server;
|
||||
public final PlayerInteractManager playerInteractManager;
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 0e385e4ea..326d4242d 100644
|
||||
index 5f17ec1e9..94df23c31 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -144,6 +144,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@ -139,7 +139,7 @@ index 0e385e4ea..326d4242d 100644
|
||||
public final Thread primaryThread;
|
||||
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
|
||||
public int autosavePeriod;
|
||||
@@ -908,22 +909,30 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -913,22 +914,30 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
this.n.b().a(agameprofile);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From a196d99aed3b693c24cece49966b2089b7123812 Mon Sep 17 00:00:00 2001
|
||||
From 62401f6501f068b9494c86dc02f8ec41b2825a25 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Fri, 12 May 2017 23:34:11 -0500
|
||||
Subject: [PATCH] Properly handle async calls to restart the server
|
||||
@ -30,7 +30,7 @@ will have plugins and worlds saving to the disk has a high potential to result
|
||||
in corruption/dataloss.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 9405dc7bf..eb8c7aaad 100644
|
||||
index c97953a2f..8576545bb 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -85,6 +85,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@ -41,7 +41,7 @@ index 9405dc7bf..eb8c7aaad 100644
|
||||
private boolean isStopped;
|
||||
private int ticks;
|
||||
protected final Proxy d;
|
||||
@@ -630,7 +631,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -635,7 +636,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
if (this.s != null) {
|
||||
MinecraftServer.LOGGER.info("Saving players");
|
||||
this.s.savePlayers();
|
||||
@ -50,7 +50,7 @@ index 9405dc7bf..eb8c7aaad 100644
|
||||
try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets
|
||||
}
|
||||
|
||||
@@ -689,10 +690,18 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -694,10 +695,18 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
return this.isRunning;
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ index 9405dc7bf..eb8c7aaad 100644
|
||||
// Paper start - Further improve server tick loop
|
||||
private static final int TPS = 20;
|
||||
private static final long SEC_IN_NANO = 1000000000;
|
||||
@@ -1662,6 +1671,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -1667,6 +1676,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
return this.aa;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 9192bd2b48900aca881a1ac43bc94dfea1585a2f Mon Sep 17 00:00:00 2001
|
||||
From fac7eb134f5fdf048ac9db058b571944ed8c6015 Mon Sep 17 00:00:00 2001
|
||||
From: Minecrell <minecrell@minecrell.net>
|
||||
Date: Fri, 9 Jun 2017 19:03:43 +0200
|
||||
Subject: [PATCH] Use TerminalConsoleAppender for console improvements
|
||||
@ -199,7 +199,7 @@ index bf1fffcfe..af430b73f 100644
|
||||
System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true));
|
||||
System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true));
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index eb8c7aaad..88900121d 100644
|
||||
index 8576545bb..0808da26f 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -57,7 +57,6 @@ import org.apache.commons.lang3.Validate;
|
||||
@ -238,7 +238,7 @@ index eb8c7aaad..88900121d 100644
|
||||
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
||||
|
||||
this.serverThread = primaryThread = new Thread(this, "Server thread"); // Moved from main
|
||||
@@ -844,7 +847,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -849,7 +852,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
} finally {
|
||||
// CraftBukkit start - Restore terminal to original settings
|
||||
try {
|
||||
@ -247,7 +247,7 @@ index eb8c7aaad..88900121d 100644
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -1340,7 +1343,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -1345,7 +1348,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
}
|
||||
|
||||
public void sendMessage(IChatBaseComponent ichatbasecomponent) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
From f69c68a61170d29cde2e2b8f41e5fcd7601a3d7b Mon Sep 17 00:00:00 2001
|
||||
From ab857a7e34a6916af5ef7105f553d74934c8f5fb Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 15 Jan 2018 22:11:48 -0500
|
||||
Subject: [PATCH] Basic PlayerProfile API
|
||||
@ -429,10 +429,10 @@ index 381542e0d..80927de08 100644
|
||||
* Calculates distance between 2 entities
|
||||
* @param e1
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 88900121d..5d12855ba 100644
|
||||
index 0808da26f..cdcc37592 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1157,7 +1157,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -1162,7 +1162,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
*/ // CraftBukkit end
|
||||
|
||||
String s1 = "."; // PAIL?
|
||||
@ -441,7 +441,7 @@ index 88900121d..5d12855ba 100644
|
||||
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
|
||||
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
|
||||
UserCache usercache = new UserCache(gameprofilerepository, new File(s1, MinecraftServer.a.getName()));
|
||||
@@ -1617,6 +1617,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -1622,6 +1622,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
this.G = i;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 0d34338ddc54622e57515a7f8281f3726f33b1f6 Mon Sep 17 00:00:00 2001
|
||||
From 7eb0bcaafabf173fa684587c8b7654a86a81417a Mon Sep 17 00:00:00 2001
|
||||
From: Minecrell <minecrell@minecrell.net>
|
||||
Date: Wed, 11 Oct 2017 15:56:26 +0200
|
||||
Subject: [PATCH] Implement extended PaperServerListPingEvent
|
||||
@ -177,10 +177,10 @@ index 000000000..350410527
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 5d12855ba..ebc0709eb 100644
|
||||
index cdcc37592..66b637326 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -910,7 +910,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -915,7 +915,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
if (i - this.Y >= 5000000000L) {
|
||||
this.Y = i;
|
||||
this.n.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.B(), this.A()));
|
||||
@ -189,7 +189,7 @@ index 5d12855ba..ebc0709eb 100644
|
||||
int j = MathHelper.nextInt(this.o, 0, this.A() - agameprofile.length);
|
||||
|
||||
for (int k = 0; k < agameprofile.length; ++k) {
|
||||
@@ -1275,10 +1275,12 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -1280,10 +1280,12 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
return "1.13";
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From c48ed623914dfeed35ef536b48b527415a70eabd Mon Sep 17 00:00:00 2001
|
||||
From 4d6153f46915538901e3983474ee836e2ea49d97 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 27 Apr 2016 22:09:52 -0400
|
||||
Subject: [PATCH] Optimize Hoppers
|
||||
@ -31,10 +31,10 @@ index b9f5f4905..a8470e6e7 100644
|
||||
private void disableSprintInterruptionOnAttack() {
|
||||
disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index ebc0709eb..d989b065d 100644
|
||||
index 66b637326..f9a7bde0b 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1017,6 +1017,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
@@ -1022,6 +1022,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
|
||||
if (true || i == 0 || this.getAllowNether()) { // CraftBukkit
|
||||
WorldServer worldserver = this.worlds.get(i);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren