mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-06 15:51:31 +00:00
Fix Optimize mob spawning temporarily
This commit is contained in:
@@ -958,7 +958,7 @@ index 9a49f5271ec1d9de17632bfffe8309cb1ba0d8b1..1bf374d482acba25614ae303d1fa72ed
|
||||
} catch (Exception exception) {
|
||||
if (exception instanceof ReportedException) {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47adfe3feac1 100644
|
||||
index 995dd071082e482785448678b9189f0715a75308..233325eab66a856eaa56abc3f0cc8af84d29f25d 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -179,8 +179,6 @@ import org.bukkit.craftbukkit.Main;
|
||||
@@ -970,7 +970,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable {
|
||||
|
||||
public static final int SERVER_THREAD_PRIORITY = Integer.getInteger("gale.thread.priority.server", -1); // Gale - server thread priority environment variable
|
||||
@@ -916,7 +914,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -917,7 +915,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Shutdown and don't bother finishing
|
||||
@@ -978,7 +978,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
// Purpur start
|
||||
if (upnp) {
|
||||
if (dev.omega24.upnp4j.UPnP4J.close(this.getPort(), dev.omega24.upnp4j.util.Protocol.TCP)) {
|
||||
@@ -1280,7 +1277,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1281,7 +1278,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
protected void waitUntilNextTick() {
|
||||
@@ -987,7 +987,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
long tickOversleepStart = System.nanoTime(); // Gale - YAPFA - last tick time
|
||||
this.managedBlock(() -> {
|
||||
return !this.canSleepForTickNoOversleep(); // Paper - move oversleep into full server tick
|
||||
@@ -1376,15 +1373,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1377,15 +1374,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public void onServerExit() {}
|
||||
|
||||
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
||||
@@ -1005,7 +1005,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
// Paper end
|
||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper
|
||||
|
||||
@@ -1416,11 +1412,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1417,11 +1413,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// Paper end
|
||||
io.papermc.paper.util.CachedLists.reset(); // Paper
|
||||
@@ -1017,7 +1017,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
// Paper start
|
||||
long endTime = System.nanoTime();
|
||||
long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
|
||||
@@ -1438,7 +1429,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1439,7 +1430,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end
|
||||
this.logTickTime(k - i);
|
||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||
@@ -1025,7 +1025,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
}
|
||||
|
||||
protected void logTickTime(long nanos) {}
|
||||
@@ -1475,9 +1465,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1476,9 +1466,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
||||
entityplayer.connection.suspendFlushing();
|
||||
});
|
||||
@@ -1035,7 +1035,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
getAllLevels().forEach(level -> {
|
||||
@@ -1493,20 +1481,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1494,20 +1482,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
});
|
||||
// Paper end - Folia scheduler API
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
@@ -1056,7 +1056,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
// Send time updates to everyone, it will get the right time from the world the player is in.
|
||||
// Paper start - optimize time updates
|
||||
for (final ServerLevel level : this.getAllLevels()) {
|
||||
@@ -1526,7 +1509,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1527,7 +1510,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
@@ -1064,7 +1064,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
|
||||
this.isIteratingOverLevels = true; // Paper
|
||||
net.minecraft.network.FriendlyByteBuf.hasItemSerializeEvent = org.purpurmc.purpur.event.packet.NetworkItemSerializeEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
|
||||
@@ -1546,14 +1528,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1547,14 +1529,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// CraftBukkit end */
|
||||
|
||||
try {
|
||||
@@ -1079,7 +1079,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
} catch (Throwable throwable) {
|
||||
// Spigot Start
|
||||
CrashReport crashreport;
|
||||
@@ -1573,21 +1553,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1574,21 +1554,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
this.isIteratingOverLevels = false; // Paper
|
||||
|
||||
@@ -1101,7 +1101,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
|
||||
iterator = this.playerList.getPlayers().iterator();
|
||||
|
||||
@@ -1597,7 +1571,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1598,7 +1572,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
entityplayer.connection.chunkSender.sendNextChunks(entityplayer);
|
||||
entityplayer.connection.resumeFlushing();
|
||||
}
|
||||
@@ -1109,7 +1109,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
}
|
||||
|
||||
private void synchronizeTime(ServerLevel world) {
|
||||
@@ -2663,8 +2636,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2664,8 +2637,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1118,7 +1118,7 @@ index b22ac919761c54b5f466bd35740710445ce3dd8f..07ea151777da3c233177642c56fb47ad
|
||||
for (;;) {
|
||||
boolean moreTasks = this.tickMidTickTasks();
|
||||
long currTime = System.nanoTime();
|
||||
@@ -2689,9 +2660,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2690,9 +2661,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1195,7 +1195,7 @@ index 7b703cd286b3819eb67b6ee95605d95ef9c44af4..2d9bf21bc0e947d221ab237da24d7305
|
||||
// Paper start
|
||||
if (waitableArray[0] != null) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index e7ba192bd8493e273afb36f8c7da374147c337cd..f86a41811e588b3b34a5c7d227ab384d07d62ff7 100644
|
||||
index 1d6b75467166def7f0573f5cabe19aafb18de3c7..727a5120f16c30a0393b25a762f031eb40dd69b4 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
Reference in New Issue
Block a user