Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AsyncLocator #137

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions patches/server/0116-Asynchronous-locator.patch
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ index 00ed0d5ad535faa36111ab28bb0cf1317eb067ec..477aa4f069ab18de2c764f74dc26db52
skipReferencedStructures = event.shouldFindUnexplored();
diff --git a/src/main/java/org/dreeam/leaf/async/locate/AsyncLocator.java b/src/main/java/org/dreeam/leaf/async/locate/AsyncLocator.java
new file mode 100644
index 0000000000000000000000000000000000000000..b03c908d1e630d08ba91279886d244977e9de4b6
index 0000000000000000000000000000000000000000..0eaa9b60ac139db47a028970557c3a84166efc49
--- /dev/null
+++ b/src/main/java/org/dreeam/leaf/async/locate/AsyncLocator.java
@@ -0,0 +1,161 @@
@@ -0,0 +1,160 @@
+package org.dreeam.leaf.async.locate;
+
+import ca.spottedleaf.moonrise.common.util.TickThread;
Expand Down Expand Up @@ -429,8 +429,7 @@ index 0000000000000000000000000000000000000000..b03c908d1e630d08ba91279886d24497
+ * thread.
+ */
+ public LocateTask<T> thenOnServerThread(Consumer<T> action) {
+ // noinspection ResultOfMethodCallIgnored
+ completableFuture.thenAccept(pos -> server.submit(() -> action.accept(pos)));
+ completableFuture.thenAccept(pos -> server.scheduleOnMain(() -> action.accept(pos)));
+ return this;
+ }
+
Expand Down