9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-04 15:41:40 +00:00

Drop ShreddedPaper: Don't block main thread in Connection#syncAfterConfigurationChange & Move to TODO

This commit is contained in:
Dreeam
2025-04-14 21:28:16 -04:00
parent 14813809e7
commit 502701329c
36 changed files with 4 additions and 4 deletions

View File

@@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Author: PureGero" <puregero@gmail.com>
Date: Thu, 1 Aug 2024 00:43:05 +0900
Subject: [PATCH] ShreddedPaper: Don't block main thread in
Connection#syncAfterConfigurationChange
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
index 00a82873d226f113278632a53c0faca420dd67d4..5b46036868b6c9d082e35591e58735e16adaae62 100644
--- a/net/minecraft/network/Connection.java
+++ b/net/minecraft/network/Connection.java
@@ -325,6 +325,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
private static void syncAfterConfigurationChange(ChannelFuture future) {
try {
+ if (ca.spottedleaf.moonrise.common.util.TickThread.isTickThread()) net.minecraft.server.MinecraftServer.getServer().managedBlock(future::isDone); // ShreddedPaper - Don't block main thread in Connection#syncAfterConfigurationChange
future.syncUninterruptibly();
} catch (Exception var2) {
if (var2 instanceof ClosedChannelException) {

View File

@@ -27,7 +27,7 @@ index ac751d460ae0c8dbb858c4047c459a11b57ae175..24926aa7ed5c78b235659daf18b224b1
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 4ecb9a4125233f91379fd2792112aca6bbb3e33f..b5a61261083ddab70582c1a1d5cac0b9ced9b652 100644
index 31abf2da10bc9b4b7825ed4b3d4e9da52feb2e39..9ba1c29b75ba0eb545097eef4fe568c53ebd885c 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -573,6 +573,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Micro optimizations for random tick
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index b5a61261083ddab70582c1a1d5cac0b9ced9b652..ab84d6a07c094b9fb23cd63504d7652342fd6974 100644
index 9ba1c29b75ba0eb545097eef4fe568c53ebd885c..90bdcd168ad5b1a940f81b191bd59a34d3a33070 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -924,7 +924,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe

View File

@@ -26,7 +26,7 @@ Locally this patch drops the entity tracker tick by a full 1.5x.
Co-authored-by: Quang Tran <3d7777456@gmail.com>
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
index 5b46036868b6c9d082e35591e58735e16adaae62..9563165c945757996da11f55e2221e620dd93327 100644
index 00a82873d226f113278632a53c0faca420dd67d4..f3e9de8716f5e1a72ec465ee897c8f0413f7b1c3 100644
--- a/net/minecraft/network/Connection.java
+++ b/net/minecraft/network/Connection.java
@@ -147,6 +147,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -45,7 +45,7 @@ index 5b46036868b6c9d082e35591e58735e16adaae62..9563165c945757996da11f55e2221e62
this.address = this.channel.remoteAddress();
this.preparing = false; // Spigot
if (this.delayedDisconnect != null) {
@@ -477,6 +479,11 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -476,6 +478,11 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
if (this.channel.eventLoop().inEventLoop()) {
this.doSendPacket(packet, sendListener, flush);
} else {