More more more more more more more more more more more more more more more more more more work

This commit is contained in:
Nassim Jahnke 2021-11-25 12:20:13 +01:00 committed by MiniDigger | Martin
parent e85e1f4e49
commit 5a90a2033d
373 changed files with 217 additions and 194 deletions

View File

@ -17,10 +17,10 @@ This allows servers with smaller worlds who do less long distance exploring to s
wasting cpu cycles on saving/unloading/reloading chunks repeatedly. wasting cpu cycles on saving/unloading/reloading chunks repeatedly.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index a5361e1dba7c025667c7627b8851655bba2c9c6a..ef50517fa00fd219e05c4a725350a78635604b2f 100644 index 7b3d3b3c6c73fb146c3be29aaaac77fee5824f91..845f105457d659a4bd88d4a8ce91b20d6abb7865 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -545,6 +545,15 @@ public class PaperWorldConfig { @@ -550,6 +550,15 @@ public class PaperWorldConfig {
lightQueueSize = getInt("light-queue-size", lightQueueSize); lightQueueSize = getInt("light-queue-size", lightQueueSize);
} }
@ -37,10 +37,10 @@ index a5361e1dba7c025667c7627b8851655bba2c9c6a..ef50517fa00fd219e05c4a725350a786
public java.util.Map<org.bukkit.Material, Integer> altItemDespawnRateMap; public java.util.Map<org.bukkit.Material, Integer> altItemDespawnRateMap;
private void altItemDespawnRate() { private void altItemDespawnRate() {
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
index 1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c..fb570511f2e12cb3794d32fa72b6fb886e6f1199 100644 index 95f195980e28bb59f43e5ca1d5e79ebe8c3ddaea..84dc1e94b4f7b8315d8422634dd49b1f85044d18 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java --- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java +++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
@@ -195,6 +195,27 @@ public abstract class DistanceManager { @@ -197,6 +197,27 @@ public abstract class DistanceManager {
boolean removed = false; // CraftBukkit boolean removed = false; // CraftBukkit
if (arraysetsorted.remove(ticket)) { if (arraysetsorted.remove(ticket)) {
removed = true; // CraftBukkit removed = true; // CraftBukkit

View File

@ -529,7 +529,7 @@ index 0bd55c5a43bfed7d5c80f6859b2827b7da3d0804..373ac9909666302fd6b9c6891866a9ba
} }
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
index 95f195980e28bb59f43e5ca1d5e79ebe8c3ddaea..bf18dbe5dc137dc40f67aa9ae4cb35e7c8358f0d 100644 index 84dc1e94b4f7b8315d8422634dd49b1f85044d18..451d5e9b5906e662a0c2e04b407068ea49d1089e 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java --- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java +++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
@@ -113,6 +113,7 @@ public abstract class DistanceManager { @@ -113,6 +113,7 @@ public abstract class DistanceManager {
@ -583,7 +583,7 @@ index 95f195980e28bb59f43e5ca1d5e79ebe8c3ddaea..bf18dbe5dc137dc40f67aa9ae4cb35e7
boolean removed = false; // CraftBukkit boolean removed = false; // CraftBukkit
if (arraysetsorted.remove(ticket)) { if (arraysetsorted.remove(ticket)) {
@@ -203,7 +211,12 @@ public abstract class DistanceManager { @@ -224,7 +232,12 @@ public abstract class DistanceManager {
this.tickets.remove(i); this.tickets.remove(i);
} }
@ -597,7 +597,7 @@ index 95f195980e28bb59f43e5ca1d5e79ebe8c3ddaea..bf18dbe5dc137dc40f67aa9ae4cb35e7
return removed; // CraftBukkit return removed; // CraftBukkit
} }
@@ -251,6 +264,112 @@ public abstract class DistanceManager { @@ -272,6 +285,112 @@ public abstract class DistanceManager {
}); });
} }
@ -711,7 +711,7 @@ index 95f195980e28bb59f43e5ca1d5e79ebe8c3ddaea..bf18dbe5dc137dc40f67aa9ae4cb35e7
Ticket<ChunkPos> ticket = new Ticket<>(TicketType.FORCED, 31, pos); Ticket<ChunkPos> ticket = new Ticket<>(TicketType.FORCED, 31, pos);
long i = pos.toLong(); long i = pos.toLong();
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 00305a06885b2457615b6bd35bb1a84721ca1d77..93b8c5c21a6a6c2475f4589014852a5178dfc13f 100644 index c3875acfad91c50a7fec4b1f8e06e8a32e2ea037..ca3ccf2631587a896f6b909d63889708e6f72f27 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -601,6 +601,26 @@ public class ServerChunkCache extends ChunkSource { @@ -601,6 +601,26 @@ public class ServerChunkCache extends ChunkSource {
@ -1103,19 +1103,19 @@ index c0ef95f83f2d13025bedd4bcc7e177cee66b5470..fec2a2a9f958492eefbbffcaf8179a2f
public void setTaskPerBatch(int taskBatchSize) { public void setTaskPerBatch(int taskBatchSize) {
diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java
index ffc43e5d3d0563c9e9c171064511b2c65ddf67e1..85f41e94b555eba1c8f887ca130a7cdba7bdb056 100644 index f1128f0d4a9a0241ac6c9bc18dd13b431c616bb1..2b2b7851d5f68bcdb41d58bcc64740ba58bf1ef4 100644
--- a/src/main/java/net/minecraft/server/level/Ticket.java --- a/src/main/java/net/minecraft/server/level/Ticket.java
+++ b/src/main/java/net/minecraft/server/level/Ticket.java +++ b/src/main/java/net/minecraft/server/level/Ticket.java
@@ -7,6 +7,7 @@ public final class Ticket<T> implements Comparable<Ticket<?>> { @@ -8,6 +8,7 @@ public final class Ticket<T> implements Comparable<Ticket<?>> {
private final int ticketLevel;
public final T key; public final T key;
public long createdTick; public long createdTick;
public long delayUnloadBy; // Paper
+ public int priority; // Paper - Chunk priority + public int priority; // Paper - Chunk priority
protected Ticket(TicketType<T> type, int level, T argument) { protected Ticket(TicketType<T> type, int level, T argument) {
this.type = type; this.type = type;
diff --git a/src/main/java/net/minecraft/server/level/TicketType.java b/src/main/java/net/minecraft/server/level/TicketType.java diff --git a/src/main/java/net/minecraft/server/level/TicketType.java b/src/main/java/net/minecraft/server/level/TicketType.java
index 78fbb4c3e52e900956ae0811aaf934c81ee5ea48..23d13600d6925f6746dfde08e17ba578e274010e 100644 index 8770fe0db46b01e8b608637df4f1a669a3f4cdde..3c1698ba0d3bc412ab957777d9b5211dbc555208 100644
--- a/src/main/java/net/minecraft/server/level/TicketType.java --- a/src/main/java/net/minecraft/server/level/TicketType.java
+++ b/src/main/java/net/minecraft/server/level/TicketType.java +++ b/src/main/java/net/minecraft/server/level/TicketType.java
@@ -9,6 +9,8 @@ import net.minecraft.world.level.ChunkPos; @@ -9,6 +9,8 @@ import net.minecraft.world.level.ChunkPos;

View File

@ -36,13 +36,13 @@ scenario / path:
Previously would have hopped to SERVER around 12+ times there extra. Previously would have hopped to SERVER around 12+ times there extra.
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index e317c73b430105052cbf28502916adc3bd60846b..96759f349e10c8ef634a11a6b48f9affae77d65a 100644 index 64fa9affc32057f09268a6f92dbc88c9decd6ed8..6782e2b100b1619016c637a9e71f9e880ff974e1 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -244,6 +244,13 @@ public class ChunkHolder { @@ -85,6 +85,13 @@ public class ChunkHolder {
this.playersInChunkTickRange = this.chunkMap.playerChunkTickRangeMap.getObjectsInRange(key);
}
// Paper end - optimise isOutsideOfRange // Paper end - optimise isOutsideOfRange
long lastAutoSaveTime; // Paper - incremental autosave
long inactiveTimeStart; // Paper - incremental autosave
+ // Paper start - optimize chunk status progression without jumping through thread pool + // Paper start - optimize chunk status progression without jumping through thread pool
+ public boolean canAdvanceStatus() { + public boolean canAdvanceStatus() {
+ ChunkStatus status = getChunkHolderStatus(); + ChunkStatus status = getChunkHolderStatus();
@ -54,10 +54,10 @@ index e317c73b430105052cbf28502916adc3bd60846b..96759f349e10c8ef634a11a6b48f9aff
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) { public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size()); this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index f43e8bb6b1c6c204b35ea64b47f6d6f558d0f7a5..047f1772c8f9346ba4541d46af8e144141865cfb 100644 index 373ac9909666302fd6b9c6891866a9baf3977316..c637a9b0a978700a0cd941be22208ae3c01f6eb2 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -786,7 +786,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -662,7 +662,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return either.mapLeft((list) -> { return either.mapLeft((list) -> {
return (LevelChunk) list.get(list.size() / 2); return (LevelChunk) list.get(list.size() / 2);
}); });
@ -66,7 +66,7 @@ index f43e8bb6b1c6c204b35ea64b47f6d6f558d0f7a5..047f1772c8f9346ba4541d46af8e1441
} }
@Nullable @Nullable
@@ -1237,6 +1237,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1013,6 +1013,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return "chunkGenerate " + requiredStatus.getName(); return "chunkGenerate " + requiredStatus.getName();
}); });
Executor executor = (runnable) -> { Executor executor = (runnable) -> {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add zombie targets turtle egg config
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 7b3d3b3c6c73fb146c3be29aaaac77fee5824f91..563cad1d7a4943648fe1f7e9b57fa7fe485e4a72 100644 index 845f105457d659a4bd88d4a8ce91b20d6abb7865..0521d5f9eba13ade77b578dd4eb5addd267dd4b9 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -56,6 +56,11 @@ public class PaperWorldConfig { @@ -56,6 +56,11 @@ public class PaperWorldConfig {

View File

@ -19,7 +19,7 @@ Aside from making the obvious class/function renames and obfhelpers I didn't nee
Just added Bukkit's event system and took a few liberties with dead code and comment misspellings. Just added Bukkit's event system and took a few liberties with dead code and comment misspellings.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 563cad1d7a4943648fe1f7e9b57fa7fe485e4a72..0535b24f5c9ff192ec2a6f5a1734f144251d9876 100644 index 0521d5f9eba13ade77b578dd4eb5addd267dd4b9..bc93318246eab1da5462aa3fa0cde4c100622f4e 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -61,6 +61,16 @@ public class PaperWorldConfig { @@ -61,6 +61,16 @@ public class PaperWorldConfig {

View File

@ -5,13 +5,14 @@ Subject: [PATCH] Incremental player saving
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 4b02a035cec0aa260e67f77c7025d2fb0e85f2eb..0b23250cbbfd947568afcb8c4510b7dea4468380 100644 index 9a66cddbf9863aa6ff566a337153883c07c08e41..b6c7aec1516a4db4fde8c9ec2772cd982ed5e304 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -465,4 +465,14 @@ public class PaperConfig { @@ -468,4 +468,15 @@ public class PaperConfig {
set("settings.unsupported-settings.allow-tnt-duplication", null); config.set("settings.unsupported-settings.allow-headless-pistons-readme", "This setting controls if players should be able to create headless pistons.");
allowHeadlessPistons = getBoolean("settings.unsupported-settings.allow-headless-pistons", false);
} }
+
+ public static int playerAutoSaveRate = -1; + public static int playerAutoSaveRate = -1;
+ public static int maxPlayerAutoSavePerTick = 10; + public static int maxPlayerAutoSavePerTick = 10;
+ private static void playerAutoSaveRate() { + private static void playerAutoSaveRate() {
@ -24,40 +25,63 @@ index 4b02a035cec0aa260e67f77c7025d2fb0e85f2eb..0b23250cbbfd947568afcb8c4510b7de
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 335d42592d99d91ae1d99fe1b99122a3bac97a49..968476493bcea8b4d961e838b142912d3eac91cd 100644 index 4351dd9c293d1db48c87c5df28bcb2b9a59583f7..7f733bd666e42f8ba80bfda233f662564bfc0e24 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -982,7 +982,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -896,12 +896,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return flag3;
}
+ // Paper start
public boolean saveEverything(boolean suppressLogs, boolean flush, boolean force) {
+ return saveEverything(suppressLogs, flush, force, -1);
+ }
+ public boolean saveEverything(boolean suppressLogs, boolean flush, boolean force, int playerSaveInterval) {
+ // Paper end
boolean flag3;
try {
this.isSaving = true;
- this.getPlayerList().saveAll();
+ this.getPlayerList().saveAll(playerSaveInterval); // Paper
flag3 = this.saveAllChunks(suppressLogs, flush, force);
} finally {
this.isSaving = false;
@@ -963,7 +968,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.isSaving = true;
if (this.playerList != null) { if (this.playerList != null) {
MinecraftServer.LOGGER.info("Saving players"); MinecraftServer.LOGGER.info("Saving players");
- this.playerList.saveAll(); - this.playerList.saveAll();
this.playerList.removeAll(this.isRestarting); // Paper this.playerList.removeAll(this.isRestarting); // Paper
try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets
} }
@@ -1420,9 +1419,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1408,13 +1412,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit // Paper - move down }
// MinecraftServer.LOGGER.debug("Autosave started"); // Paper }
serverAutoSave = (autosavePeriod > 0 && this.tickCount % autosavePeriod == 0); // Paper
+ // Paper start + // Paper start
+ int playerSaveInterval = com.destroystokyo.paper.PaperConfig.playerAutoSaveRate; + int playerSaveInterval = com.destroystokyo.paper.PaperConfig.playerAutoSaveRate;
+ if (playerSaveInterval < 0) { + if (playerSaveInterval < 0) {
+ playerSaveInterval = autosavePeriod; + playerSaveInterval = autosavePeriod;
+ } + }
+ // Paper end + // Paper end
if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit
MinecraftServer.LOGGER.debug("Autosave started");
this.profiler.push("save"); this.profiler.push("save");
- if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // Paper - moved from above - this.saveEverything(true, false, false);
- this.playerList.saveAll(); + this.saveEverything(true, false, false, playerSaveInterval); // Paper
+ if (playerSaveInterval > 0) { // Paper this.profiler.pop();
+ this.playerList.savePlayers(playerSaveInterval); // Paper MinecraftServer.LOGGER.debug("Autosave finished");
// this.saveAllChunks(true, false, false); // Paper - saved incrementally below - }
} // Paper start + } else this.getPlayerList().saveAll(playerSaveInterval); // Paper
for (ServerLevel level : this.getAllLevels()) { io.papermc.paper.util.CachedLists.reset(); // Paper
// Paper start - move executeAll() into full server tick timing
try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 74b68679d311017246d49c37f3cd17f938f3b57f..d8df3bcf6ddd87e9fa932f01a41a48a641328f9d 100644 index 84f78e2b3bf51eae1d486852464df032861c5a0b..968b8180f92066a43f06bff8dd1d49b03bd08f5b 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -175,6 +175,7 @@ public class ServerPlayer extends Player { @@ -171,6 +171,7 @@ public class ServerPlayer extends Player {
public final int getViewDistance() { return this.getLevel().getChunkSource().chunkMap.viewDistance - 1; } // Paper - placeholder public final int getViewDistance() { return this.getLevel().getChunkSource().chunkMap.viewDistance - 1; } // Paper - placeholder
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
@ -66,10 +90,10 @@ index 74b68679d311017246d49c37f3cd17f938f3b57f..d8df3bcf6ddd87e9fa932f01a41a48a6
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
public ServerGamePacketListenerImpl connection; public ServerGamePacketListenerImpl connection;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 34f56db51e2c6a1c451f95d0fa3cb5c368b1ecf7..2c7dcf5eabc8fe99f78e71493ac96b7f065110a2 100644 index 310bed27c04ef812aa8607c9dca789db13341d25..b1f93551ce3e4d12e5cbe424c1ceaf3da20d0ffd 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -570,6 +570,7 @@ public abstract class PlayerList { @@ -569,6 +569,7 @@ public abstract class PlayerList {
protected void save(ServerPlayer player) { protected void save(ServerPlayer player) {
if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit
if (!player.didPlayerJoinEvent) return; // Paper - If we never fired PJE, we disconnected during login. Data has not changed, and additionally, our saved vehicle is not loaded! If we save now, we will lose our vehicle (CraftBukkit bug) if (!player.didPlayerJoinEvent) return; // Paper - If we never fired PJE, we disconnected during login. Data has not changed, and additionally, our saved vehicle is not loaded! If we save now, we will lose our vehicle (CraftBukkit bug)
@ -77,25 +101,24 @@ index 34f56db51e2c6a1c451f95d0fa3cb5c368b1ecf7..2c7dcf5eabc8fe99f78e71493ac96b7f
this.playerIo.save(player); this.playerIo.save(player);
ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit
@@ -1209,10 +1210,21 @@ public abstract class PlayerList { @@ -1181,10 +1182,21 @@ public abstract class PlayerList {
} }
public void saveAll() { public void saveAll() {
- net.minecraft.server.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
+ // Paper start - incremental player saving + // Paper start - incremental player saving
+ savePlayers(null); + saveAll(-1);
+ } + }
+ public void savePlayers(Integer interval) { + public void saveAll(int interval) {
+ MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main net.minecraft.server.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
MinecraftTimings.savePlayers.startTiming(); // Paper MinecraftTimings.savePlayers.startTiming(); // Paper
+ int numSaved = 0; + int numSaved = 0;
+ long now = MinecraftServer.currentTick; + long now = MinecraftServer.currentTick;
for (int i = 0; i < this.players.size(); ++i) { for (int i = 0; i < this.players.size(); ++i) {
- this.save(this.players.get(i)); - this.save(this.players.get(i));
+ ServerPlayer entityplayer = this.players.get(i); + ServerPlayer entityplayer = this.players.get(i);
+ if (interval == null || now - entityplayer.lastSave >= interval) { + if (interval != -1 || now - entityplayer.lastSave >= interval) {
+ this.save(entityplayer); + this.save(entityplayer);
+ if (interval != null && ++numSaved <= com.destroystokyo.paper.PaperConfig.maxPlayerAutoSavePerTick) { break; } + if (interval != -1 && ++numSaved <= com.destroystokyo.paper.PaperConfig.maxPlayerAutoSavePerTick) { break; }
+ } + }
+ // Paper end + // Paper end
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4351dd9c293d1db48c87c5df28bcb2b9a59583f7..fe8b825adfa3f7ed5c85e238ef93e46908ca88ae 100644 index 7f733bd666e42f8ba80bfda233f662564bfc0e24..4d90ebf13e8ad2dd77175fcdc15a0e84a58ff081 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1963,6 +1963,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1973,6 +1973,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().reloadResources(); this.getPlayerList().reloadResources();
this.functionManager.replaceLibrary(this.resources.getFunctionLibrary()); this.functionManager.replaceLibrary(this.resources.getFunctionLibrary());
this.structureManager.onResourceManagerReload(this.resources.getResourceManager()); this.structureManager.onResourceManagerReload(this.resources.getResourceManager());

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't mark dirty in invalid locations (SPIGOT-6086)
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index 64fa9affc32057f09268a6f92dbc88c9decd6ed8..04fe3432216c9a1e4d3dbfa159faf2332de422fb 100644 index 6782e2b100b1619016c637a9e71f9e880ff974e1..41333234cdda8127a239f591d8d2cd304e341852 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -220,6 +220,7 @@ public class ChunkHolder { @@ -227,6 +227,7 @@ public class ChunkHolder {
} }
public void blockChanged(BlockPos pos) { public void blockChanged(BlockPos pos) {

View File

@ -14,7 +14,7 @@ this breaks your workflow you can always force all scoreboards to be tracked wit
settings.track-plugin-scoreboards in paper.yml. settings.track-plugin-scoreboards in paper.yml.
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 9a66cddbf9863aa6ff566a337153883c07c08e41..c0c807522aaa82ca74c47849b47e6b6b48b9a6f8 100644 index b6c7aec1516a4db4fde8c9ec2772cd982ed5e304..dbfd840f2f64fa7eec5523aa2ba9e1018f4bb19d 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -96,6 +96,11 @@ public class PaperConfig { @@ -96,6 +96,11 @@ public class PaperConfig {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fe8b825adfa3f7ed5c85e238ef93e46908ca88ae..d12c154f6110854c8ca9268edadab14b97c46d51 100644 index 4d90ebf13e8ad2dd77175fcdc15a0e84a58ff081..d8c1bb347608eaea3741525602613bebd5f54c6b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2029,13 +2029,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2039,13 +2039,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.isEnforceWhitelist()) { if (this.isEnforceWhitelist()) {
PlayerList playerlist = source.getServer().getPlayerList(); PlayerList playerlist = source.getServer().getPlayerList();
UserWhiteList whitelist = playerlist.getWhiteList(); UserWhiteList whitelist = playerlist.getWhiteList();

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Toggle for removing existing dragon
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 0535b24f5c9ff192ec2a6f5a1734f144251d9876..d99ddd769b381b2f9a59352971c6faeee7b6387e 100644 index bc93318246eab1da5462aa3fa0cde4c100622f4e..62e60057a362ad7c3e96b3167f78ba154cfefdc3 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -71,6 +71,14 @@ public class PaperWorldConfig { @@ -71,6 +71,14 @@ public class PaperWorldConfig {

View File

@ -25,10 +25,10 @@ index d30bc3f1da336b421d9a42070184e07169dd14e4..a6eadf71957b37e2acc5d09f0ce4ee96
Connection.LOGGER.debug("Failed to sent packet", throwable); Connection.LOGGER.debug("Failed to sent packet", throwable);
ConnectionProtocol enumprotocol = this.getCurrentProtocol(); ConnectionProtocol enumprotocol = this.getCurrentProtocol();
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 84f78e2b3bf51eae1d486852464df032861c5a0b..a32551253f12bd6f4a9008dd5d99fece6464effe 100644 index 968b8180f92066a43f06bff8dd1d49b03bd08f5b..257942084d988cac5f87ff998ea637fa263a3fe9 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -256,6 +256,7 @@ public class ServerPlayer extends Player { @@ -257,6 +257,7 @@ public class ServerPlayer extends Player {
public double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks public double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
@ -49,10 +49,10 @@ index 2dd47eab63cf9322a5844e748709e220272a8cfe..c0a685cfe62aeda3583763ecc1e4fa12
this.connection.disconnect(ichatbasecomponent); this.connection.disconnect(ichatbasecomponent);
}); });
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 310bed27c04ef812aa8607c9dca789db13341d25..6aaa5174bb0eff3216667b4c8d3912d02e1c66e2 100644 index b1f93551ce3e4d12e5cbe424c1ceaf3da20d0ffd..5bbf5c83a5052df07392cd17236469b2d3ddecdc 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -595,7 +595,7 @@ public abstract class PlayerList { @@ -596,7 +596,7 @@ public abstract class PlayerList {
entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper
} }

View File

@ -11,7 +11,7 @@ in IWorldServerData are removed as they were only used in certain places, with h
values used in other places. values used in other places.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index d99ddd769b381b2f9a59352971c6faeee7b6387e..5c22b8993385c1e6c72fe1fbd5f14c76253eec74 100644 index 62e60057a362ad7c3e96b3167f78ba154cfefdc3..ab6ade77a7be2b0d67effcacbf74ed64a1beccff 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -79,6 +79,19 @@ public class PaperWorldConfig { @@ -79,6 +79,19 @@ public class PaperWorldConfig {

Some files were not shown because too many files have changed in this diff Show More