mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@d22f66f2 Updated Upstream (Paper)
This commit is contained in:
@@ -77,6 +77,9 @@
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
- implementation(project(":purpur-api")) // Purpur
|
- implementation(project(":purpur-api")) // Purpur
|
||||||
|
- implementation("ca.spottedleaf:concurrentutil:0.0.5")
|
||||||
|
- implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
||||||
|
- implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
|
||||||
+ implementation(project(":divinemc-api")) // DivineMC - Rebrand
|
+ implementation(project(":divinemc-api")) // DivineMC - Rebrand
|
||||||
+
|
+
|
||||||
+ // DivineMC start - Dependencies
|
+ // DivineMC start - Dependencies
|
||||||
@@ -91,9 +94,7 @@
|
|||||||
+ implementation("net.objecthunter:exp4j:0.4.8")
|
+ implementation("net.objecthunter:exp4j:0.4.8")
|
||||||
+ // DivineMC end - Dependencies
|
+ // DivineMC end - Dependencies
|
||||||
+
|
+
|
||||||
implementation("ca.spottedleaf:concurrentutil:0.0.5")
|
+ implementation("ca.spottedleaf:concurrentutil:0.0.7") // DivineMC - Bump dependencies - temporary
|
||||||
- implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
|
||||||
- implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
|
|
||||||
+ implementation("org.jline:jline-terminal-ffm:3.29.0") // use ffm on java 22+ // DivineMC - Bump dependencies
|
+ implementation("org.jline:jline-terminal-ffm:3.29.0") // use ffm on java 22+ // DivineMC - Bump dependencies
|
||||||
+ implementation("org.jline:jline-terminal-jni:3.29.0") // fall back to jni on java 21 // DivineMC - Bump dependencies
|
+ implementation("org.jline:jline-terminal-jni:3.29.0") // fall back to jni on java 21 // DivineMC - Bump dependencies
|
||||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||||
|
|||||||
@@ -2826,7 +2826,7 @@ index c0c87b7c8e0b6b941fe8a63dc361504e94459d86..3c4de8b43a5658e02ddce7db9f453bfd
|
|||||||
|
|
||||||
if (this.fire) {
|
if (this.fire) {
|
||||||
diff --git a/net/minecraft/world/level/pathfinder/PathFinder.java b/net/minecraft/world/level/pathfinder/PathFinder.java
|
diff --git a/net/minecraft/world/level/pathfinder/PathFinder.java b/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
index f90c2bb95e304bd6b9b8539d89f38d2d718893d0..f41f6c0be37f89c54cee3e02494c1412f309266f 100644
|
index 5894260481ea395c26a5b506e38530f7b2032b33..477446a1bf38efb1e5b5b4513dd85808a5cd8cdb 100644
|
||||||
--- a/net/minecraft/world/level/pathfinder/PathFinder.java
|
--- a/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
+++ b/net/minecraft/world/level/pathfinder/PathFinder.java
|
+++ b/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
@@ -13,9 +13,6 @@ import java.util.function.Function;
|
@@ -13,9 +13,6 @@ import java.util.function.Function;
|
||||||
@@ -2849,14 +2849,14 @@ index f90c2bb95e304bd6b9b8539d89f38d2d718893d0..f41f6c0be37f89c54cee3e02494c1412
|
|||||||
// Set<Target> set = targetPositions.keySet(); // Paper - unused
|
// Set<Target> set = targetPositions.keySet(); // Paper - unused
|
||||||
node.g = 0.0F;
|
node.g = 0.0F;
|
||||||
node.h = this.getBestH(node, positions); // Paper - optimize collection
|
node.h = this.getBestH(node, positions); // Paper - optimize collection
|
||||||
@@ -136,7 +130,6 @@ public class PathFinder {
|
@@ -139,7 +133,6 @@ public class PathFinder {
|
||||||
best = path;
|
best = path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- profilerFiller.pop();
|
- profilerFiller.pop();
|
||||||
return best;
|
if(asBoolean && best != null) {
|
||||||
// Paper end - Perf: remove streams and optimize collection
|
Set<Target> set = Sets.newHashSet();
|
||||||
}
|
for(Map.Entry<Target, BlockPos> entry : positions) {
|
||||||
diff --git a/net/minecraft/world/ticks/LevelTicks.java b/net/minecraft/world/ticks/LevelTicks.java
|
diff --git a/net/minecraft/world/ticks/LevelTicks.java b/net/minecraft/world/ticks/LevelTicks.java
|
||||||
index 7ea0273018b1a364a5e2b7bf57da840383c8ffa5..c7f9485191dc797de78e6524c5c2c737581ed838 100644
|
index 7ea0273018b1a364a5e2b7bf57da840383c8ffa5..c7f9485191dc797de78e6524c5c2c737581ed838 100644
|
||||||
--- a/net/minecraft/world/ticks/LevelTicks.java
|
--- a/net/minecraft/world/ticks/LevelTicks.java
|
||||||
|
|||||||
@@ -716,7 +716,7 @@ index 4a17d60e09bc2a73c50a1c981e4b50ae3eabe9ee..7f4fd1bfb26651a0c61728479b4827c3
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/pathfinder/PathFinder.java b/net/minecraft/world/level/pathfinder/PathFinder.java
|
diff --git a/net/minecraft/world/level/pathfinder/PathFinder.java b/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
index f41f6c0be37f89c54cee3e02494c1412f309266f..57d9a53b75826472e24e2760046fe44a6fd7258c 100644
|
index 477446a1bf38efb1e5b5b4513dd85808a5cd8cdb..b1849e431a8e22065c7f9c46412409148fa0df73 100644
|
||||||
--- a/net/minecraft/world/level/pathfinder/PathFinder.java
|
--- a/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
+++ b/net/minecraft/world/level/pathfinder/PathFinder.java
|
+++ b/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||||
@@ -23,11 +23,19 @@ public class PathFinder {
|
@@ -23,11 +23,19 @@ public class PathFinder {
|
||||||
@@ -810,8 +810,8 @@ index f41f6c0be37f89c54cee3e02494c1412f309266f..57d9a53b75826472e24e2760046fe44a
|
|||||||
// Set<Target> set = targetPositions.keySet(); // Paper - unused
|
// Set<Target> set = targetPositions.keySet(); // Paper - unused
|
||||||
node.g = 0.0F;
|
node.g = 0.0F;
|
||||||
node.h = this.getBestH(node, positions); // Paper - optimize collection
|
node.h = this.getBestH(node, positions); // Paper - optimize collection
|
||||||
@@ -96,7 +140,7 @@ public class PathFinder {
|
@@ -99,7 +143,7 @@ public class PathFinder {
|
||||||
|
}
|
||||||
|
|
||||||
if (!(node1.distanceTo(node) >= maxRange)) {
|
if (!(node1.distanceTo(node) >= maxRange)) {
|
||||||
- int neighbors = this.nodeEvaluator.getNeighbors(this.neighbors, node1);
|
- int neighbors = this.nodeEvaluator.getNeighbors(this.neighbors, node1);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|||||||
Date: Mon, 11 Aug 2025 02:42:19 +0300
|
Date: Mon, 11 Aug 2025 02:42:19 +0300
|
||||||
Subject: [PATCH] Optimize Moonrise
|
Subject: [PATCH] Optimize Moonrise
|
||||||
|
|
||||||
TODO: Recheck this patch
|
|
||||||
|
|
||||||
diff --git a/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java b/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
|
diff --git a/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java b/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
|
||||||
index 93272808d94e81d31af728ebe85df9a2bc7aedab..b47be4b838f4c7f6c3fb62e4e18105c6b4972016 100644
|
index 93272808d94e81d31af728ebe85df9a2bc7aedab..b47be4b838f4c7f6c3fb62e4e18105c6b4972016 100644
|
||||||
@@ -393,17 +392,18 @@ index 9a9a599ef178f851ee5c783631a724013a693586..7f8e7d0aac516489dbbc10da68161f3f
|
|||||||
void addFullStatusConsumer(final FullChunkStatus status, final Consumer<LevelChunk> consumer) {
|
void addFullStatusConsumer(final FullChunkStatus status, final Consumer<LevelChunk> consumer) {
|
||||||
this.fullStatusWaiters.computeIfAbsent(status, (final FullChunkStatus keyInMap) -> {
|
this.fullStatusWaiters.computeIfAbsent(status, (final FullChunkStatus keyInMap) -> {
|
||||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/util/ParallelSearchRadiusIteration.java b/ca/spottedleaf/moonrise/patches/chunk_system/util/ParallelSearchRadiusIteration.java
|
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/util/ParallelSearchRadiusIteration.java b/ca/spottedleaf/moonrise/patches/chunk_system/util/ParallelSearchRadiusIteration.java
|
||||||
index 93fd23027c00cef76562098306737272fda1350a..10c9aecb99bc3055104f50266542e249dc842ee7 100644
|
index 93fd23027c00cef76562098306737272fda1350a..40856bf4148ce59cf34a470df9fc7e64088b793a 100644
|
||||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/util/ParallelSearchRadiusIteration.java
|
--- a/ca/spottedleaf/moonrise/patches/chunk_system/util/ParallelSearchRadiusIteration.java
|
||||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/util/ParallelSearchRadiusIteration.java
|
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/util/ParallelSearchRadiusIteration.java
|
||||||
@@ -23,6 +23,7 @@ public final class ParallelSearchRadiusIteration {
|
@@ -23,7 +23,7 @@ public final class ParallelSearchRadiusIteration {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long[] getSearchIteration(final int radius) {
|
public static long[] getSearchIteration(final int radius) {
|
||||||
+ if (radius >= SEARCH_RADIUS_ITERATION_LIST.length) return SEARCH_RADIUS_ITERATION_LIST[SEARCH_RADIUS_ITERATION_LIST.length - 1]; // DivineMC - Optimize Moonrise
|
- return SEARCH_RADIUS_ITERATION_LIST[radius];
|
||||||
return SEARCH_RADIUS_ITERATION_LIST[radius];
|
+ return SEARCH_RADIUS_ITERATION_LIST[Math.min(SEARCH_RADIUS_ITERATION_LIST.length - 1, radius)]; // DivineMC - Optimize Moonrise - Fix #130
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static class CustomLongArray extends LongArrayList {
|
||||||
diff --git a/ca/spottedleaf/moonrise/patches/starlight/light/SWMRNibbleArray.java b/ca/spottedleaf/moonrise/patches/starlight/light/SWMRNibbleArray.java
|
diff --git a/ca/spottedleaf/moonrise/patches/starlight/light/SWMRNibbleArray.java b/ca/spottedleaf/moonrise/patches/starlight/light/SWMRNibbleArray.java
|
||||||
index 5c7b3804cdbcb0a873a0d195325c2658760a8914..4bb64bc5a31951a83d29d0c88919b1fa96e994a3 100644
|
index 5c7b3804cdbcb0a873a0d195325c2658760a8914..4bb64bc5a31951a83d29d0c88919b1fa96e994a3 100644
|
||||||
--- a/ca/spottedleaf/moonrise/patches/starlight/light/SWMRNibbleArray.java
|
--- a/ca/spottedleaf/moonrise/patches/starlight/light/SWMRNibbleArray.java
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ This seems stupid, but it does seem that it improves the performance a bit, and
|
|||||||
We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) because the CraftPlayer's `equals()` check is a *bit* expensive compared to only checking the object's identity, and because the identity has already been check, we don't need to check it twice.
|
We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) because the CraftPlayer's `equals()` check is a *bit* expensive compared to only checking the object's identity, and because the identity has already been check, we don't need to check it twice.
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index 56bbaab57432a78e85bc0013cd7f991f662f0cd2..c84acf874d6a9c99bdb5e0e1237130a0ae771be2 100644
|
index b615c03d73071c923e0a3d1123810e110419318b..db51871ccad36e0af25478d1b9ab01cb81c4ef19 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -226,7 +226,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
@@ -234,7 +234,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||||
private long lastPlayed = 0;
|
private long lastPlayed = 0;
|
||||||
private boolean hasPlayedBefore = false;
|
private boolean hasPlayedBefore = false;
|
||||||
private final ConversationTracker conversationTracker = new ConversationTracker();
|
private final ConversationTracker conversationTracker = new ConversationTracker();
|
||||||
@@ -26,7 +26,7 @@ index 56bbaab57432a78e85bc0013cd7f991f662f0cd2..c84acf874d6a9c99bdb5e0e1237130a0
|
|||||||
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
|
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
|
||||||
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
|
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
|
||||||
private int hash = 0;
|
private int hash = 0;
|
||||||
@@ -2123,9 +2123,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
@@ -2131,9 +2131,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSee(org.bukkit.entity.Entity entity) {
|
public boolean canSee(org.bukkit.entity.Entity entity) {
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ index d7398b1ecf2660c29fb7d106b48fe02d3736603e..ab499a7eaccdc1578ec64f90f54f79b0
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index c84acf874d6a9c99bdb5e0e1237130a0ae771be2..f0fa7b90efbfc23c0c68307da7a95a6c0b114665 100644
|
index db51871ccad36e0af25478d1b9ab01cb81c4ef19..55bd24eff0106383e8e68c7f48c1967267603e97 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -2698,7 +2698,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
@@ -2706,7 +2706,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||||
Iterator<AttributeInstance> iterator = collection.iterator();
|
Iterator<AttributeInstance> iterator = collection.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
AttributeInstance genericInstance = iterator.next();
|
AttributeInstance genericInstance = iterator.next();
|
||||||
|
|||||||
@@ -506,3 +506,16 @@ index ab2fa1563d5e32a5313dfcc1da411cab45fb5ca0..f568fcf85667cd3fe53f59e08451096d
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/SingleUserAreaMap.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/SingleUserAreaMap.java
|
||||||
|
index 7e85bb58b8a5de17fdab9ad3c574f2f80952e1ca..cd442923c3f52e6ab00b9e8d805095929446fad5 100644
|
||||||
|
--- a/src/main/java/ca/spottedleaf/moonrise/common/misc/SingleUserAreaMap.java
|
||||||
|
+++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/SingleUserAreaMap.java
|
||||||
|
@@ -87,6 +87,8 @@ public abstract class SingleUserAreaMap<T> {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (fromX == toX && fromZ == toZ && oldViewDistance == newViewDistance) return true; // DivineMC - Optimize Moonrise - by Leaf
|
||||||
|
+
|
||||||
|
this.lastChunkX = toX;
|
||||||
|
this.lastChunkZ = toZ;
|
||||||
|
this.distance = newViewDistance;
|
||||||
|
|||||||
@@ -87,7 +87,9 @@ public final class RegionizedChunkTicking extends ServerChunkCache {
|
|||||||
level.tickChunk(chunk, randomTickSpeed);
|
level.tickChunk(chunk, randomTickSpeed);
|
||||||
}
|
}
|
||||||
for (Entity entity : region.entities()) {
|
for (Entity entity : region.entities()) {
|
||||||
tickEntity(entity);
|
if (!entity.moonrise$isUpdatingSectionStatus()) {
|
||||||
|
tickEntity(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return regionChunksIDs;
|
return regionChunksIDs;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ group = org.bxteam.divinemc
|
|||||||
version=1.21.10-R0.1-SNAPSHOT
|
version=1.21.10-R0.1-SNAPSHOT
|
||||||
|
|
||||||
mcVersion=1.21.10
|
mcVersion=1.21.10
|
||||||
purpurRef=56ac4ded5a36554d23f61c85c78391698cab5c48
|
purpurRef=d22f66f2ad204f7bd5ef007adace7a5381aa5dd3
|
||||||
experimental=true
|
experimental=false
|
||||||
|
|
||||||
org.gradle.configuration-cache=true
|
org.gradle.configuration-cache=true
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
|
|||||||
Reference in New Issue
Block a user