9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-28 03:09:11 +00:00
Files
DivineMC/patches/server/0048-Fix-MC-183518.patch
2024-12-05 00:25:45 +03:00

32 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Mon, 17 Jun 2024 17:15:13 +0300
Subject: [PATCH] Fix MC-183518
Issue on Mojira: https://bugs.mojang.com/browse/MC-183518
P.S. Btw, I took this fix from this PR - https://github.com/Winds-Studio/Leaf/pull/69
diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
index 9b706276dc5b5f55b966c5472c6c4e864342b916..e9f2b88058bea5841fa648dad32903af19293328 100644
--- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
+++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
@@ -22,7 +22,7 @@ import net.minecraft.util.profiling.metrics.ProfilerMeasured;
import org.slf4j.Logger;
public abstract class BlockableEventLoop<R extends Runnable> implements ProfilerMeasured, TaskScheduler<R>, Executor {
- public static final long BLOCK_TIME_NANOS = 100000L;
+ public static final long BLOCK_TIME_NANOS = 2000000L; // DivineMC - Fix MC-183518
private final String name;
private static final Logger LOGGER = LogUtils.getLogger();
private final Queue<R> pendingRunnables = Queues.newConcurrentLinkedQueue();
@@ -145,8 +145,7 @@ public abstract class BlockableEventLoop<R extends Runnable> implements Profiler
}
protected void waitForTasks() {
- Thread.yield();
- LockSupport.parkNanos("waiting for tasks", 100000L);
+ LockSupport.parkNanos("waiting for tasks", 2000000L); // DivineMC - Fix MC-183518
}
protected void doRunTask(R task) {