more runtime errors

This commit is contained in:
Jake Potrebic 2024-12-15 15:16:33 -08:00
parent b40c4e2179
commit e3b23b59f3
No known key found for this signature in database
GPG Key ID: ECE0B3C133C016C5
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/network/protocol/common/custom/DiscardedPayload.java
+++ b/net/minecraft/network/protocol/common/custom/DiscardedPayload.java
@@ -4,13 +_,15 @@
@@ -4,13 +_,14 @@
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.resources.ResourceLocation;
@ -13,7 +13,7 @@
+ }, buffer -> {
int i = buffer.readableBytes();
if (i >= 0 && i <= maxSize) {
buffer.skipBytes(i);
- buffer.skipBytes(i);
- return new DiscardedPayload(id);
+ return new DiscardedPayload(id, buffer.readBytes(i)); // CraftBukkit
} else {

View File

@ -69,7 +69,8 @@
+
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
AtomicReference<S> atomicReference = new AtomicReference<>();
Thread thread = new Thread(() -> atomicReference.get().runServer(), "Server thread");
- Thread thread = new Thread(() -> atomicReference.get().runServer(), "Server thread");
+ Thread thread = new ca.spottedleaf.moonrise.common.util.TickThread(() -> atomicReference.get().runServer(), "Server thread");
thread.setUncaughtExceptionHandler((thread1, exception) -> LOGGER.error("Uncaught exception in server thread", exception));
+ thread.setPriority(Thread.NORM_PRIORITY+2); // Paper - Perf: Boost priority
if (Runtime.getRuntime().availableProcessors() > 4) {