mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-29 11:59:24 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@1004374a Add further information to thread check errors PaperMC/Paper@e2f0efd1 Remove nms.Entity#isChunkLoaded PaperMC/Paper@54b2e9d9 Add buffer to CraftWorld#warnUnsafeChunk PaperMC/Paper@d4a95784 Experimental annotation changes (#12028) PaperMC/Paper@5bcfb12a Fix activation range config and water animal status (#12047) PaperMC/Paper@e0711af5 Deprecate UnsafeValues#getSpawnEggLayerColor (#12041) PaperMC/Paper@8927091a Do not record movement for vehicles/players unaffected by blocks PaperMC/Paper@5395ae37 Fix composter block setting bukkit owner twice (#12058) Gale Changes: Dreeam-qwq/Gale@534623a0 Updated Upstream (Paper) Dreeam-qwq/Gale@7274f287 Updated Upstream (Paper) Dreeam-qwq/Gale@e9ffadfd Updated Upstream (Paper) Dreeam-qwq/Gale@9e6d19de Updated Upstream (Paper) Dreeam-qwq/Gale@f35382c4 Updated Upstream (Paper) Purpur Changes: PurpurMC/Purpur@9b575764 Updated Upstream (Paper) PurpurMC/Purpur@88ed7442 Updated Upstream (Paper) PurpurMC/Purpur@79c11927 only initialize the config once, closes #1637 PurpurMC/Purpur@c7bb955e Updated Upstream (Paper) PurpurMC/Purpur@2fe4cf18 [ci/skip] fix indentation PurpurMC/Purpur@65637fa6 fix(mobs/bee): Set `takes-damage-from-water` back to false by default, closes #1639 PurpurMC/Purpur@16cfd04b feat(mobs/bee): Add `can-instantly-start-drowning` option, defaults to `true` PurpurMC/Purpur@4f481858 fix: correctly call force when sending particles
43 lines
2.1 KiB
Diff
43 lines
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
|
|
Date: Wed, 23 Oct 2024 23:54:00 +0800
|
|
Subject: [PATCH] Asynchronous locator
|
|
|
|
Original license: MIT
|
|
Original project: https://github.com/thebrightspark/AsyncLocator
|
|
|
|
diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java b/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java
|
|
index 69cdd304d255d52c9b7dc9b6a33ffdb630b79abe..a4aa2615823d77920ff55b8aa0bcc27a54b8c3e1 100644
|
|
--- a/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java
|
|
+++ b/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java
|
|
@@ -105,6 +105,12 @@ public class TickThread extends Thread {
|
|
this(null, run, name);
|
|
}
|
|
|
|
+ // Leaf start - Asynchronous locator
|
|
+ public TickThread(final Runnable run, final String name, final int id) {
|
|
+ this(null, run, name, id);
|
|
+ }
|
|
+ // Leaf end - Asynchronous locator
|
|
+
|
|
public TickThread(final ThreadGroup group, final Runnable run, final String name) {
|
|
this(group, run, name, ID_GENERATOR.incrementAndGet());
|
|
}
|
|
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
|
index 361f4de9cdf0f7505628a2fed2a3f5366031e04b..548fcd9646dee0c40b6ba9b3dafb9ca157dfe324 100644
|
|
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
|
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
|
@@ -48,6 +48,12 @@ class PaperEventManager {
|
|
return;
|
|
}
|
|
// Leaf end - Multithreaded tracker
|
|
+ // Leaf start - Asynchronous locator
|
|
+ if (org.dreeam.leaf.config.modules.async.AsyncLocator.enabled) {
|
|
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(event::callEvent);
|
|
+ return;
|
|
+ }
|
|
+ // Leaf end - Asynchronous locator
|
|
throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
|
}
|
|
// Leaves start - skip photographer
|