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

[Dev] Async features #109

Merged
merged 27 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
81da5db
init Multithreaded Tracker
Dreeam-qwq Aug 11, 2024
ff72daf
Merge branch 'ver/1.21.1' into dev/async
Dreeam-qwq Aug 20, 2024
9f14afc
Rebase & Clean up
Dreeam-qwq Aug 20, 2024
ed04192
Some clean up
Dreeam-qwq Aug 20, 2024
518b549
Some work
Dreeam-qwq Aug 22, 2024
491a502
[ci skip] Checked some petal issues
Dreeam-qwq Aug 22, 2024
8b555a5
Fix tracker
Dreeam-qwq Aug 23, 2024
ee8d69a
Merge branch 'ver/1.21.1' into dev/async
Dreeam-qwq Aug 24, 2024
16076f4
Unify thread name again
Dreeam-qwq Aug 24, 2024
d346478
Nitori: Async playerdata Save
Dreeam-qwq Aug 24, 2024
15e0ca9
Merge branch 'ver/1.21.1' into dev/async
Dreeam-qwq Aug 28, 2024
a81eca5
Rebase
Dreeam-qwq Aug 28, 2024
a761331
Merge branch 'ver/1.21.1' into dev/async
Dreeam-qwq Aug 29, 2024
bb19f50
Merge branch 'ver/1.21.1' into dev/async
Dreeam-qwq Aug 29, 2024
d169e80
Fix Citizens player type NPC tracking issue (WIP)
Dreeam-qwq Aug 29, 2024
043929e
[ci skip] Drop useless patch
Dreeam-qwq Aug 29, 2024
94578dc
[ci skip] Adjust comments
Dreeam-qwq Aug 30, 2024
c3baa54
Optimize tracker, batch processing sendChanges tasks
Dreeam-qwq Aug 31, 2024
85b44ca
Clean up and fix
Dreeam-qwq Aug 31, 2024
85751d5
Merge branch 'ver/1.21.1' into dev/async
Dreeam-qwq Sep 1, 2024
7b595a0
Rebase
Dreeam-qwq Sep 1, 2024
4617887
Partial update player asynchronously & Fix citizens player type NPC v…
Dreeam-qwq Sep 1, 2024
3cc5aa1
Optimize and update config
Dreeam-qwq Sep 1, 2024
e8e706e
Fix realPlayer detect condition & Made more async & Update patch comment
Dreeam-qwq Sep 1, 2024
3e65a72
Merge branch 'ver/1.21.1' into dev/async
Dreeam-qwq Sep 5, 2024
c0effa6
Add compat mode for tracker
Dreeam-qwq Sep 5, 2024
a6355c2
[ci skip] Update comment
Dreeam-qwq Sep 5, 2024
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ If these excellent projects hadn't appeared, Leaf wouldn't have become great.
• <a href="https://github.com/HaHaWTH/Polpot">Polpot</a><br>
• <a href="https://github.com/plasmoapp/matter">Matter</a><br>
• <a href="https://github.com/LuminolMC/Luminol">Luminol</a><br>
• <a href="https://github.com/Gensokyo-Reimagined/Nitori">Nitori</a><br>
</p>
</details>

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions patches/server/0012-Fix-Pufferfish-and-Purpur-patches.patch
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ index 23609a71a993fc91271578ee0a541a9c6ec7354f..34f7f74b374d319d0d578e498db7663d

@Override
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9d082b3c06281b0cafe455959d6ef20b8891110e..5071828f4ec318ca457d7c29d5ffaa3de2f43e48 100644
index 9d082b3c06281b0cafe455959d6ef20b8891110e..c842bd59cb612a98d261d31a026d4ae8ce4e455b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -300,7 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand All @@ -45,7 +45,7 @@ index 9d082b3c06281b0cafe455959d6ef20b8891110e..5071828f4ec318ca457d7c29d5ffaa3d
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation

- public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("MobSpawning"); // Pufferfish - optimize mob spawning
+ public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("pufferfish-async-mob-spawning"); // Pufferfish - optimize mob spawning // Leaf - Unify thread name
+ public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("Leaf Async Mob Spawn Thread"); // Pufferfish - optimize mob spawning // Leaf - Unify thread name

public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0039-Petal-Async-Pathfinding.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ index 0000000000000000000000000000000000000000..2f5aff1f0e2aca0a8bfeab27c4ab027f
+}
diff --git a/src/main/java/org/dreeam/leaf/async/path/AsyncPathProcessor.java b/src/main/java/org/dreeam/leaf/async/path/AsyncPathProcessor.java
new file mode 100644
index 0000000000000000000000000000000000000000..ccee3723679d3740d34bd13c04018bafafa5da62
index 0000000000000000000000000000000000000000..3eb86fc2e0ea28be18e23dd2c060e043f1fede93
--- /dev/null
+++ b/src/main/java/org/dreeam/leaf/async/path/AsyncPathProcessor.java
@@ -0,0 +1,52 @@
Expand Down Expand Up @@ -1123,7 +1123,7 @@ index 0000000000000000000000000000000000000000..ccee3723679d3740d34bd13c04018baf
+ org.dreeam.leaf.config.modules.async.AsyncPathfinding.asyncPathfindingKeepalive, TimeUnit.SECONDS,
+ new LinkedBlockingQueue<>(),
+ new ThreadFactoryBuilder()
+ .setNameFormat("petal-async-pathfinding-thread-%d")
+ .setNameFormat("Leaf Async Pathfinding Thread - %d")
+ .setPriority(Thread.NORM_PRIORITY - 2)
+ .build()
+ );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ index c03608fec96b51e1867f43d8f42e5aefb1520e46..15b21fa3907db1b77ed5b5d1050a37f4
throw new IllegalStateException("Ticking retired scheduler");
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index efd29f9d2417c9483b0aa2c521109a9e20f6990c..7308c3ae41397338092ab3f7f95baca6b2a515c3 100644
index 55466ff58d724a6254fd6e53c72adb592f2d433a..0255d5a23e2f5a1a67af3ff1588b608521e4c133 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -312,6 +312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation

public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("pufferfish-async-mob-spawning"); // Pufferfish - optimize mob spawning // Leaf - Unify thread name
public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("Leaf Async Mob Spawn Thread"); // Pufferfish - optimize mob spawning // Leaf - Unify thread name
+ public final Set<Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)

public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
Expand Down
Loading