mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@56ac4ded Updated Upstream (Paper)
This commit is contained in:
@@ -120,10 +120,10 @@ index 42841fdc7e64311ba9217789a3dc758a351cf674..036c3931f4c1e453892f32e59085be70
|
||||
String awtException = io.papermc.paper.util.ServerEnvironment.awtDependencyCheck();
|
||||
if (awtException != null) {
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index f3fc79b93efdd6cade9d2a49999f55031049da1d..247f2eb2414e15c56ee17c7f7efc21dfc6641ec9 100644
|
||||
index 8a9e97f3b92def14f40c246ca0ff713ed8192b08..f29cee41258a8220256bf6b3b5b04f79c142cc19 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1282,6 +1282,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1277,6 +1277,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
protected void runServer() {
|
||||
try {
|
||||
|
||||
@@ -203,7 +203,7 @@ index 18071dcc69cc28471dddb7de94e803ec1e5fc2e4..aa25f5ebaf7d1b22825b962b02dcae02
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb73817aa9 100644
|
||||
index f29cee41258a8220256bf6b3b5b04f79c142cc19..9180e8cdd4bfad33f8dcda0ac8785defff4a1dad 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -117,20 +117,9 @@ import net.minecraft.util.TimeUtil;
|
||||
@@ -241,7 +241,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
private ServerConnectionListener connection;
|
||||
// Paper - per world load listener - moved LevelLoadListener to ServerLevel
|
||||
@Nullable
|
||||
@@ -1017,9 +999,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1018,9 +1000,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
org.spigotmc.WatchdogThread.doStop(); // Paper - Improved watchdog support
|
||||
// CraftBukkit end
|
||||
this.packetProcessor.close();
|
||||
@@ -251,7 +251,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
|
||||
LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
@@ -1188,10 +1167,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1191,10 +1170,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
// note: To avoid possibly spinning forever, only execute tasks that are roughly available at the beginning
|
||||
// of this call. Packet processing and chunk system tasks are possibly always being queued.
|
||||
@@ -262,7 +262,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
// avoid calling MinecraftServer#pollTask - we just want to execute queued tasks
|
||||
while (super.pollTask()) {
|
||||
// execute small amounts of other tasks just in case the number of tasks we are
|
||||
@@ -1200,38 +1175,23 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1203,38 +1178,23 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
((ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer)this).moonrise$executeMidTickTasks(); // Paper - rewrite chunk system
|
||||
this.packetProcessor.executeSinglePacket();
|
||||
}
|
||||
@@ -301,7 +301,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
this.waitingForNextTick = true;
|
||||
// implement waitForTasks
|
||||
final boolean isLoggingEnabled = this.isTickTimeLoggingEnabled();
|
||||
@@ -1276,7 +1236,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1271,7 +1231,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
} finally {
|
||||
this.waitingForNextTick = false;
|
||||
}
|
||||
@@ -309,7 +309,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
}
|
||||
// Paper end - improve tick loop
|
||||
|
||||
@@ -1364,44 +1323,32 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1359,44 +1318,32 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end - improve tick loop
|
||||
|
||||
boolean flag = l == 0L;
|
||||
@@ -375,7 +375,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
this.isReady = true;
|
||||
JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis);
|
||||
}
|
||||
@@ -1509,7 +1456,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1504,7 +1451,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
protected void waitUntilNextTick() {
|
||||
@@ -383,7 +383,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
// Paper - improve tick loop - moved to start of tick
|
||||
this.waitingForNextTick = true;
|
||||
|
||||
@@ -1574,7 +1520,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1569,7 +1515,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@Override
|
||||
public void doRunTask(TickTask task) {
|
||||
@@ -391,7 +391,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
super.doRunTask(task);
|
||||
}
|
||||
|
||||
@@ -1664,12 +1609,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1659,12 +1604,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
this.ticksUntilAutosave--;
|
||||
// Paper start - Incremental chunk and player saving
|
||||
@@ -404,7 +404,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
|
||||
try {
|
||||
this.isSaving = true;
|
||||
@@ -1684,10 +1627,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1679,10 +1622,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
} finally {
|
||||
this.isSaving = false;
|
||||
}
|
||||
@@ -416,7 +416,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
this.server.spark.executeMainThreadTasks(); // Paper - spark
|
||||
// Paper start - Server Tick Events
|
||||
long endTime = System.nanoTime();
|
||||
@@ -1695,7 +1637,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1690,7 +1632,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - this.currentTickStart) / 1000000D), remaining).callEvent();
|
||||
// Paper end - Server Tick Events
|
||||
this.server.spark.tickEnd(((double)(endTime - this.currentTickStart) / 1000000D)); // Paper - spark
|
||||
@@ -424,7 +424,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
long l = Util.getNanos() - nanos;
|
||||
int i1 = this.tickCount % 100;
|
||||
this.aggregatedTickTimesNanos = this.aggregatedTickTimesNanos - this.tickTimesNanos[i1];
|
||||
@@ -1703,16 +1644,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1698,16 +1639,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.tickTimesNanos[i1] = l;
|
||||
this.smoothedTickTimeMillis = this.smoothedTickTimeMillis * 0.8F + (float)l / (float)TimeUtil.NANOSECONDS_PER_MILLISECOND * 0.19999999F;
|
||||
this.logTickMethodTime(nanos);
|
||||
@@ -441,7 +441,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
LOGGER.debug("Autosave finished");
|
||||
}
|
||||
|
||||
@@ -1780,7 +1717,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1775,7 +1712,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public final io.papermc.paper.threadedregions.EntityScheduler.EntitySchedulerTickList entitySchedulerTickList = new io.papermc.paper.threadedregions.EntityScheduler.EntitySchedulerTickList(); // Paper - optimise Folia entity scheduler
|
||||
|
||||
protected void tickChildren(BooleanSupplier hasTimeLeft) {
|
||||
@@ -449,7 +449,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
this.getPlayerList().getPlayers().forEach(serverPlayer1 -> serverPlayer1.connection.suspendFlushing());
|
||||
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
||||
// Paper start - optimise Folia entity scheduler
|
||||
@@ -1795,9 +1731,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1790,9 +1726,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end - optimise Folia entity scheduler
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.ADVENTURE_CLICK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.DIALOG_CLICK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
@@ -459,7 +459,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
this.updateEffectiveRespawnData();
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1834,17 +1768,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1829,17 +1763,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
serverLevel.updateLagCompensationTick(); // Paper - lag compensation
|
||||
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = serverLevel.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
|
||||
serverLevel.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur - Ridables
|
||||
@@ -477,7 +477,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
try {
|
||||
serverLevel.tick(hasTimeLeft);
|
||||
} catch (Throwable var7) {
|
||||
@@ -1853,37 +1782,25 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1848,37 +1777,25 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
throw new ReportedException(crashReport);
|
||||
}
|
||||
|
||||
@@ -515,7 +515,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
}
|
||||
|
||||
// Paper start - per world respawn data - read "server global" respawn data from overworld dimension reference
|
||||
@@ -1908,14 +1825,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1903,14 +1820,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public void forceTimeSynchronization() {
|
||||
@@ -530,7 +530,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
}
|
||||
|
||||
public boolean isAllowedToEnterPortal(Level level) {
|
||||
@@ -2760,55 +2672,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2755,55 +2667,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -586,7 +586,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
public Path getWorldPath(LevelResource levelResource) {
|
||||
return this.storageSource.getLevelPath(levelResource);
|
||||
}
|
||||
@@ -2858,24 +2721,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2853,24 +2716,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
return this.isSaving;
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ index 247f2eb2414e15c56ee17c7f7efc21dfc6641ec9..f9d60a28763e2c45b5dcf9687b8999fb
|
||||
public int getMaxChainedNeighborUpdates() {
|
||||
return 1000000;
|
||||
}
|
||||
@@ -3023,55 +2868,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -3018,55 +2863,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public record ServerResourcePackInfo(UUID id, String url, String hash, boolean isRequired, @Nullable Component prompt) {
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Lag compensation
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index f9d60a28763e2c45b5dcf9687b8999fb73817aa9..3de2d76bf118750932a56d02233e4e6aff0b2728 100644
|
||||
index 9180e8cdd4bfad33f8dcda0ac8785defff4a1dad..9a3bd9f646889f43393c3cf54f5bcfa33ec6bbd1 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -287,6 +287,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -16,7 +16,7 @@ index f9d60a28763e2c45b5dcf9687b8999fb73817aa9..3de2d76bf118750932a56d02233e4e6a
|
||||
// Paper start - improve tick loop
|
||||
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes1s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(1L));
|
||||
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes5s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(5L));
|
||||
@@ -1598,6 +1599,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1593,6 +1594,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
this.server.spark.tickStart(); // Paper - spark
|
||||
|
||||
@@ -18,10 +18,10 @@ index 9a7a40c1dcea57ba674d8431077d2477104a456f..8e41097f978800039e6e057c5bbcfcf0
|
||||
new java.util.concurrent.LinkedBlockingQueue<>(),
|
||||
new com.google.common.util.concurrent.ThreadFactoryBuilder()
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 3de2d76bf118750932a56d02233e4e6aff0b2728..690c67f2051996d0888a946b8c089d39dcb004f6 100644
|
||||
index 9a3bd9f646889f43393c3cf54f5bcfa33ec6bbd1..21043f7ccc4a26ae5e016dd4e72092a032c3bddf 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2738,8 +2738,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2733,8 +2733,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Command block parse results caching
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/BaseCommandBlock.java b/net/minecraft/world/level/BaseCommandBlock.java
|
||||
index b6cebd8f5741cd3058d4ab3996d15d9e1e0fc3b4..a0e2ec323b07a85a91c36bc222df671ae491955e 100644
|
||||
index 390d9cbe8050b90e4bd9327cf4d80571fbd8ece4..1398fb38edfc975dc716a5147159e9da0443ca83 100644
|
||||
--- a/net/minecraft/world/level/BaseCommandBlock.java
|
||||
+++ b/net/minecraft/world/level/BaseCommandBlock.java
|
||||
@@ -35,6 +35,10 @@ public abstract class BaseCommandBlock {
|
||||
@@ -78,6 +78,6 @@ index b6cebd8f5741cd3058d4ab3996d15d9e1e0fc3b4..a0e2ec323b07a85a91c36bc222df671a
|
||||
+ }
|
||||
+ // DivineMC end - Command block parse results caching
|
||||
+
|
||||
@Nullable
|
||||
private BaseCommandBlock.CloseableCommandBlockSource createSource() {
|
||||
return this.trackOutput ? new BaseCommandBlock.CloseableCommandBlockSource() : null;
|
||||
public BaseCommandBlock.CloseableCommandBlockSource createSource() { // Paper - public, remove nullable
|
||||
return new BaseCommandBlock.CloseableCommandBlockSource(this.trackOutput); // Paper - add back source when output disabled
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ index 077ccddb7d358be352b6d497ed8b4e97b7d09262..7197434fdd304d0608b1d0bf2b1d6c6e
|
||||
List<org.bukkit.block.BlockState> states = new java.util.ArrayList<>(level.capturedBlockStates.values());
|
||||
level.capturedBlockStates.clear();
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 698460d2dc19a0bdf6cf2a528a702d6dbc625eb2..311aa4ea612c706032d8d3b7ec8fba5b7714a6db 100644
|
||||
index 76fb33ddc89c699db5d0e423106f5bbbee17c958..c4c4c0c76a1763fa4c7dadffc89376f796b2d93b 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -289,6 +289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -122,7 +122,7 @@ index 698460d2dc19a0bdf6cf2a528a702d6dbc625eb2..311aa4ea612c706032d8d3b7ec8fba5b
|
||||
// Paper start - improve tick loop
|
||||
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes1s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(1L));
|
||||
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes5s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(5L));
|
||||
@@ -396,24 +397,36 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -397,24 +398,36 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
private long lastMidTickExecute;
|
||||
private long lastMidTickExecuteFailure;
|
||||
|
||||
@@ -172,7 +172,7 @@ index 698460d2dc19a0bdf6cf2a528a702d6dbc625eb2..311aa4ea612c706032d8d3b7ec8fba5b
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1719,6 +1732,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1714,6 +1727,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
public final io.papermc.paper.threadedregions.EntityScheduler.EntitySchedulerTickList entitySchedulerTickList = new io.papermc.paper.threadedregions.EntityScheduler.EntitySchedulerTickList(); // Paper - optimise Folia entity scheduler
|
||||
|
||||
@@ -191,7 +191,7 @@ index 698460d2dc19a0bdf6cf2a528a702d6dbc625eb2..311aa4ea612c706032d8d3b7ec8fba5b
|
||||
protected void tickChildren(BooleanSupplier hasTimeLeft) {
|
||||
this.getPlayerList().getPlayers().forEach(serverPlayer1 -> serverPlayer1.connection.suspendFlushing());
|
||||
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
||||
@@ -1765,28 +1790,43 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1760,28 +1785,43 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
|
||||
@@ -253,7 +253,7 @@ index 698460d2dc19a0bdf6cf2a528a702d6dbc625eb2..311aa4ea612c706032d8d3b7ec8fba5b
|
||||
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||
|
||||
this.tickConnection();
|
||||
@@ -1874,6 +1914,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1869,6 +1909,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
Map<ResourceKey<Level>, ServerLevel> oldLevels = this.levels;
|
||||
Map<ResourceKey<Level>, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels);
|
||||
newLevels.remove(level.dimension());
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] MSPT Tracking for each world
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index fd9ef48ac8b23e8b409c00d154dbea27b701e3bc..6a714d59d01eafcd833f05208a948bf33b797392 100644
|
||||
index c4c4c0c76a1763fa4c7dadffc89376f796b2d93b..01a75f0a3692b954f43993b586945e26163e91e0 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1735,7 +1735,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1730,7 +1730,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// DivineMC start - Parallel world ticking
|
||||
private void tickLevel(ServerLevel serverLevel, BooleanSupplier hasTimeLeft) {
|
||||
try {
|
||||
@@ -25,7 +25,7 @@ index fd9ef48ac8b23e8b409c00d154dbea27b701e3bc..6a714d59d01eafcd833f05208a948bf3
|
||||
CrashReport crashReport = CrashReport.forThrowable(levelTickingException, "Exception ticking world");
|
||||
serverLevel.fillReportDetails(crashReport);
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index aa6d923d5e14aa0b2e920a7ae5c89dd151ad2c3c..8bd2e419791f0dffbcbc43edd93178dead0c9620 100644
|
||||
index 27a63526c4fde0a716eb9ac3f8f4d0fd84b550dc..ca9883277c0f036c94e861f7917ca42facd3c47b 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -596,6 +596,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
|
||||
@@ -20,10 +20,10 @@ index 3e4241976fdfe65bc0aae90a9097770745c0ddf1..98b101fde04fbf5507f021bb8d8e6bed
|
||||
if (var3 instanceof ReportedException reportedException && reportedException.getCause() instanceof OutOfMemoryError) {
|
||||
throw PacketUtils.makeReportedException(var3, this.packet, this.listener);
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index e3c7065cd4832e0c533f70d444c0a7beff53e423..d73546a9f086f67bafb3ce3a2a8ed5c227abc355 100644
|
||||
index 01a75f0a3692b954f43993b586945e26163e91e0..dbb3a32da66472b3b075d155938e2b6fa4fb53f2 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1744,6 +1744,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1739,6 +1739,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
serverLevel.tickTimes10s.add(this.tickCount, j);
|
||||
serverLevel.tickTimes60s.add(this.tickCount, j);
|
||||
// DivineMC end - MSPT Tracking for each world
|
||||
|
||||
@@ -35,10 +35,10 @@ index fb263fa1f30a7dfcb7ec2656abfb38e5fe88eac9..c3be4c2fd4a544967322a45d3b8c0fe7
|
||||
};
|
||||
}
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index d73546a9f086f67bafb3ce3a2a8ed5c227abc355..5feb76f4cd7274943f1b763c5eb7071c4bf2b809 100644
|
||||
index dbb3a32da66472b3b075d155938e2b6fa4fb53f2..30f6b89227af4f78f447ae4c61fc33b4ac6202f2 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1848,6 +1848,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1843,6 +1843,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
GameTestTicker.SINGLETON.tick();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ index a814512fcfb85312474ae2c2c21443843bf57831..215d4444fbd9821811fbd4724de088db
|
||||
public MoonriseRegionFileIO.RegionDataController.WriteData moonrise$startWrite(
|
||||
final int chunkX, final int chunkZ, final CompoundTag compound
|
||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
||||
index b83ccf7bbd134e97e14bfe8331cc9d2a26b9ec9c..a9ddee8c77ad653cd7875dc96797191750cc2781 100644
|
||||
index aa3d5a6ea59ac77665f2cfaa56a7d383016d08d0..e3c99b70f026261cff01629d0f9250929d215a70 100644
|
||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
||||
@@ -1261,7 +1261,7 @@ public final class MoonriseRegionFileIO {
|
||||
@@ -1274,7 +1274,7 @@ public final class MoonriseRegionFileIO {
|
||||
this.regionDataController.finishWrite(this.chunkX, this.chunkZ, writeData);
|
||||
// Paper start - flush regionfiles on save
|
||||
if (this.world.paperConfig().chunks.flushRegionsOnSave) {
|
||||
@@ -33,7 +33,7 @@ index b83ccf7bbd134e97e14bfe8331cc9d2a26b9ec9c..a9ddee8c77ad653cd7875dc967971917
|
||||
if (regionFile != null) {
|
||||
regionFile.flush();
|
||||
} // else: evicted from cache, which should have called flush
|
||||
@@ -1477,7 +1477,7 @@ public final class MoonriseRegionFileIO {
|
||||
@@ -1490,7 +1490,7 @@ public final class MoonriseRegionFileIO {
|
||||
|
||||
public static interface IORunnable {
|
||||
|
||||
@@ -60,10 +60,10 @@ index 51c126735ace8fdde89ad97b5cab62f244212db0..23f6ed26b531ea570fdf2ae48c1e2710
|
||||
+ public void moonrise$write(final org.bxteam.divinemc.region.IRegionFile regionFile) throws IOException; // DivineMC - Buffered Linear region format
|
||||
}
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 5feb76f4cd7274943f1b763c5eb7071c4bf2b809..c574bb4a1cce4af4e3cda1f76e789b7c1660fc21 100644
|
||||
index 30f6b89227af4f78f447ae4c61fc33b4ac6202f2..fff6dac8b37a26dfacb1a0a40152518c5c227504 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -958,10 +958,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -959,10 +959,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// CraftBukkit end
|
||||
if (flush) {
|
||||
for (ServerLevel serverLevel : this.getAllLevels()) {
|
||||
|
||||
@@ -3,6 +3,7 @@ From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||
Date: Mon, 11 Aug 2025 02:42:19 +0300
|
||||
Subject: [PATCH] Optimize Moonrise
|
||||
|
||||
TODO: Recheck this patch
|
||||
|
||||
diff --git a/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java b/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
|
||||
index 93272808d94e81d31af728ebe85df9a2bc7aedab..b47be4b838f4c7f6c3fb62e4e18105c6b4972016 100644
|
||||
@@ -306,10 +307,10 @@ index 18822bed7986348bbbed1712db7dac65884d39a9..906c0019cae2529962d1221939ce276f
|
||||
boolean ret = false;
|
||||
|
||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java b/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
|
||||
index 2409c83b03cfa1f0285f6f7c3508dbdf53750316..6318aedb621134d4f3e33480a2e97ddf7be6b433 100644
|
||||
index 9a9a599ef178f851ee5c783631a724013a693586..7f8e7d0aac516489dbbc10da68161f3ff3b2908d 100644
|
||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
|
||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
|
||||
@@ -645,12 +645,20 @@ public final class NewChunkHolder {
|
||||
@@ -646,12 +646,20 @@ public final class NewChunkHolder {
|
||||
}
|
||||
|
||||
public final ChunkHolder vanillaChunkHolder;
|
||||
@@ -330,7 +331,7 @@ index 2409c83b03cfa1f0285f6f7c3508dbdf53750316..6318aedb621134d4f3e33480a2e97ddf
|
||||
this.vanillaChunkHolder = new ChunkHolder(
|
||||
new ChunkPos(chunkX, chunkZ), ChunkHolderManager.MAX_TICKET_LEVEL, world,
|
||||
world.getLightEngine(), null, world.getChunkSource().chunkMap
|
||||
@@ -791,9 +799,11 @@ public final class NewChunkHolder {
|
||||
@@ -792,9 +800,11 @@ public final class NewChunkHolder {
|
||||
|
||||
// note: these are completed with null to indicate that no write occurred
|
||||
// they are also completed with null to indicate a null write occurred
|
||||
@@ -345,20 +346,7 @@ index 2409c83b03cfa1f0285f6f7c3508dbdf53750316..6318aedb621134d4f3e33480a2e97ddf
|
||||
|
||||
public static final record UnloadTask(CallbackCompletable<CompoundTag> completable, PrioritisedExecutor.PrioritisedTask task,
|
||||
LazyRunnable toRun) {}
|
||||
@@ -878,7 +888,11 @@ public final class NewChunkHolder {
|
||||
MoonriseRegionFileIO.scheduleSave(this.world, this.chunkX, this.chunkZ, data, type);
|
||||
}
|
||||
|
||||
- this.getUnloadTask(type).completable().complete(data);
|
||||
+ // DivineMC start - Optimize Moonrise
|
||||
+ UnloadTask task = this.getUnloadTask(type);
|
||||
+ if (task == null) return;
|
||||
+ task.completable().complete(data);
|
||||
+ // DivineMC end - Optimize Moonrise
|
||||
final ReentrantAreaLock.Node schedulingLock = this.scheduler.schedulingLockArea.lock(this.chunkX, this.chunkZ);
|
||||
try {
|
||||
// can only write to these fields while holding the schedule lock
|
||||
@@ -1191,6 +1205,7 @@ public final class NewChunkHolder {
|
||||
@@ -1168,6 +1178,7 @@ public final class NewChunkHolder {
|
||||
for (int dz = -NEIGHBOUR_RADIUS; dz <= NEIGHBOUR_RADIUS; ++dz) {
|
||||
for (int dx = -NEIGHBOUR_RADIUS; dx <= NEIGHBOUR_RADIUS; ++dx) {
|
||||
final NewChunkHolder holder = (dx | dz) == 0 ? this : this.scheduler.chunkHolderManager.getChunkHolder(dx + this.chunkX, dz + this.chunkZ);
|
||||
@@ -366,7 +354,7 @@ index 2409c83b03cfa1f0285f6f7c3508dbdf53750316..6318aedb621134d4f3e33480a2e97ddf
|
||||
if (loaded) {
|
||||
if (holder.setNeighbourFullLoaded(-dx, -dz)) {
|
||||
changedFullStatus.add(holder);
|
||||
@@ -1215,6 +1230,19 @@ public final class NewChunkHolder {
|
||||
@@ -1192,6 +1203,19 @@ public final class NewChunkHolder {
|
||||
|
||||
private void updateCurrentState(final FullChunkStatus to) {
|
||||
this.currentFullChunkStatus = to;
|
||||
@@ -386,7 +374,7 @@ index 2409c83b03cfa1f0285f6f7c3508dbdf53750316..6318aedb621134d4f3e33480a2e97ddf
|
||||
}
|
||||
|
||||
// only to be called on the main thread, no locks need to be held
|
||||
@@ -1349,7 +1377,7 @@ public final class NewChunkHolder {
|
||||
@@ -1326,7 +1350,7 @@ public final class NewChunkHolder {
|
||||
return this.requestedGenStatus;
|
||||
}
|
||||
|
||||
@@ -395,7 +383,7 @@ index 2409c83b03cfa1f0285f6f7c3508dbdf53750316..6318aedb621134d4f3e33480a2e97ddf
|
||||
|
||||
void addStatusConsumer(final ChunkStatus status, final Consumer<ChunkAccess> consumer) {
|
||||
this.statusWaiters.computeIfAbsent(status, (final ChunkStatus keyInMap) -> {
|
||||
@@ -1384,7 +1412,7 @@ public final class NewChunkHolder {
|
||||
@@ -1361,7 +1385,7 @@ public final class NewChunkHolder {
|
||||
}, Priority.HIGHEST);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1005,6 +_,13 @@
|
||||
@@ -1006,6 +_,13 @@
|
||||
if (this.hasStopped) return;
|
||||
this.hasStopped = true;
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
if (!hasLoggedStop && isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
||||
shutdownThread = Thread.currentThread(); // Paper - Improved watchdog support
|
||||
org.spigotmc.WatchdogThread.doStop(); // Paper - Improved watchdog support
|
||||
@@ -1097,6 +_,7 @@
|
||||
@@ -1098,6 +_,7 @@
|
||||
// Paper end - rewrite chunk system
|
||||
// Paper start - Improved watchdog support - move final shutdown items here
|
||||
Util.shutdownExecutors();
|
||||
|
||||
@@ -2,7 +2,7 @@ group = org.bxteam.divinemc
|
||||
version=1.21.10-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion=1.21.10
|
||||
purpurRef=fc89fde56b69a3c0955cc0d6fb8e5470de0969fc
|
||||
purpurRef=56ac4ded5a36554d23f61c85c78391698cab5c48
|
||||
experimental=true
|
||||
|
||||
org.gradle.configuration-cache=true
|
||||
|
||||
Reference in New Issue
Block a user