9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-19 14:59:25 +00:00

sort classes

This commit is contained in:
NONPLAYT
2025-07-17 18:44:04 +03:00
parent 14bec37171
commit be5a07876c
82 changed files with 370 additions and 391 deletions

View File

@@ -9,7 +9,7 @@ You can find the original code on https://github.com/Bloom-host/Petal
Makes most pathfinding-related work happen asynchronously
diff --git a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
index 67cbf9f5760fae5db6f31e64095cd1b6be6ade8e..327a0414c8723420ffe34597464c1772768e8fa3 100644
index 67cbf9f5760fae5db6f31e64095cd1b6be6ade8e..3e7db8ef9ba48d42e8373296031301308573b154 100644
--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
@@ -94,21 +94,18 @@ public class AcquirePoi {
@@ -29,7 +29,7 @@ index 67cbf9f5760fae5db6f31e64095cd1b6be6ade8e..327a0414c8723420ffe34597464c1772
+ if (org.bxteam.divinemc.config.DivineConfig.AsyncCategory.asyncPathfinding) {
+ Path possiblePath = findPathToPois(mob, set);
+
+ org.bxteam.divinemc.entity.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
+ org.bxteam.divinemc.async.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
+ processPath(acquirablePois, entityEventId, (Long2ObjectMap<JitteredLinearRetry>) map, memoryAccessor, level, mob, time, poiManager, set, path);
});
} else {
@@ -222,7 +222,7 @@ index 621ba76784f2b92790eca62be4d0688834335ab6..92d8899ff7d42ecc987a7bf2035cc724
private boolean tryComputePath(Mob mob, WalkTarget target, long time) {
BlockPos blockPos = target.getTarget().currentBlockPosition();
diff --git a/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java b/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java
index 4f9f3367b1ca3903df03a80fa2b01a3d24e6e77d..87f218cbeda68d2996a354afabb8be70f513920e 100644
index 4f9f3367b1ca3903df03a80fa2b01a3d24e6e77d..48b7e91191192266d57f4d4692d1865cbddae5c0 100644
--- a/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java
+++ b/net/minecraft/world/entity/ai/behavior/SetClosestHomeAsWalkTarget.java
@@ -60,17 +60,18 @@ public class SetClosestHomeAsWalkTarget {
@@ -243,7 +243,7 @@ index 4f9f3367b1ca3903df03a80fa2b01a3d24e6e77d..87f218cbeda68d2996a354afabb8be70
+ if (org.bxteam.divinemc.config.DivineConfig.AsyncCategory.asyncPathfinding) {
+ Path possiblePath = AcquirePoi.findPathToPois(mob, set);
+
+ org.bxteam.divinemc.entity.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
+ org.bxteam.divinemc.async.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
+ processPath(speedModifier, map, mutableLong, walkTarget, level, poiManager, mutableInt, path);
+ });
+ } else {
@@ -295,7 +295,7 @@ index 73bba480f3f017a8aed14562bd82ba33db04391c..b31976b68eec3cd0ab0620a487e99ecd
Node node = path.getNode(i);
this.doorPos = new BlockPos(node.x, node.y + 1, node.z);
diff --git a/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java b/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
index 458ceec68ca138b0aa9b70d6c934473c01d468f4..62e385f40294c2343ce0a3deb95229057539503b 100644
index 458ceec68ca138b0aa9b70d6c934473c01d468f4..ff06ba3ede2f2e40aae8f9a0b997150cfaaeecb7 100644
--- a/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
@@ -12,9 +12,25 @@ public class AmphibiousPathNavigation extends PathNavigation {
@@ -303,7 +303,7 @@ index 458ceec68ca138b0aa9b70d6c934473c01d468f4..62e385f40294c2343ce0a3deb9522905
}
+ // DivineMC start - async path processing
+ private static final org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ private static final org.bxteam.divinemc.async.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.async.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ AmphibiousNodeEvaluator nodeEvaluator = new AmphibiousNodeEvaluator(false);
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
@@ -325,7 +325,7 @@ index 458ceec68ca138b0aa9b70d6c934473c01d468f4..62e385f40294c2343ce0a3deb9522905
}
diff --git a/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java b/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
index 077863b758fbc3e51f25bcf842d00a2cc07c6a2f..4b2cc7fa8848b6cb15cc82090bf37bcdd16f098a 100644
index 077863b758fbc3e51f25bcf842d00a2cc07c6a2f..b544685d191af2dcf3742abe45693b1eab0507e8 100644
--- a/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
@@ -16,9 +16,25 @@ public class FlyingPathNavigation extends PathNavigation {
@@ -333,7 +333,7 @@ index 077863b758fbc3e51f25bcf842d00a2cc07c6a2f..4b2cc7fa8848b6cb15cc82090bf37bcd
}
+ // DivineMC start - async path processing
+ private static final org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ private static final org.bxteam.divinemc.async.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.async.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ FlyNodeEvaluator nodeEvaluator = new FlyNodeEvaluator();
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
@@ -363,7 +363,7 @@ index 077863b758fbc3e51f25bcf842d00a2cc07c6a2f..4b2cc7fa8848b6cb15cc82090bf37bcd
if (!this.isDone()) {
if (this.canUpdatePath()) {
diff --git a/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java b/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
index 86fccf3617a32f3791b03d8067e2eaf6b8d8bebb..2c26d30a7373c6ac8ead22894b63a8d6529ba1f2 100644
index 86fccf3617a32f3791b03d8067e2eaf6b8d8bebb..348fe5b7f8f3d7c87891704115d911a271e8882a 100644
--- a/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
@@ -24,9 +24,25 @@ public class GroundPathNavigation extends PathNavigation {
@@ -371,7 +371,7 @@ index 86fccf3617a32f3791b03d8067e2eaf6b8d8bebb..2c26d30a7373c6ac8ead22894b63a8d6
}
+ // DivineMC start - async path processing
+ protected static final org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ protected static final org.bxteam.divinemc.async.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.async.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ WalkNodeEvaluator nodeEvaluator = new WalkNodeEvaluator();
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
@@ -393,7 +393,7 @@ index 86fccf3617a32f3791b03d8067e2eaf6b8d8bebb..2c26d30a7373c6ac8ead22894b63a8d6
}
diff --git a/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
index 24dd92449f70144c79f25bf24942ebd666655ed2..8d243cac4a0ba0536bd65c39bf3483d056e00116 100644
index 24dd92449f70144c79f25bf24942ebd666655ed2..90035d61f705094507e1738a77bd624bcab3d235 100644
--- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -167,6 +167,10 @@ public abstract class PathNavigation {
@@ -401,7 +401,7 @@ index 24dd92449f70144c79f25bf24942ebd666655ed2..8d243cac4a0ba0536bd65c39bf3483d0
} else if (!this.canUpdatePath()) {
return null;
+ // DivineMC start - catch early if it's still processing these positions let it keep processing
+ } else if (this.path instanceof org.bxteam.divinemc.entity.pathfinding.AsyncPath asyncPath && !asyncPath.isProcessed() && asyncPath.hasSameProcessingPositions(targets)) {
+ } else if (this.path instanceof org.bxteam.divinemc.async.pathfinding.AsyncPath asyncPath && !asyncPath.isProcessed() && asyncPath.hasSameProcessingPositions(targets)) {
+ return this.path;
+ // DivineMC end - catch early if it's still processing these positions let it keep processing
} else if (this.path != null && !this.path.isDone() && targets.contains(this.targetPos)) {
@@ -420,7 +420,7 @@ index 24dd92449f70144c79f25bf24942ebd666655ed2..8d243cac4a0ba0536bd65c39bf3483d0
+ // assign early a target position. most calls will only have 1 position
+ if (!targets.isEmpty()) this.targetPos = targets.iterator().next();
+
+ org.bxteam.divinemc.entity.pathfinding.AsyncPathProcessor.awaitProcessing(path, processedPath -> {
+ org.bxteam.divinemc.async.pathfinding.AsyncPathProcessor.awaitProcessing(path, processedPath -> {
+ // check that processing didn't take so long that we calculated a new path
+ if (processedPath != this.path) return;
+
@@ -478,7 +478,7 @@ index 24dd92449f70144c79f25bf24942ebd666655ed2..8d243cac4a0ba0536bd65c39bf3483d0
Vec3 vec3 = new Vec3((endNode.x + this.mob.getX()) / 2.0, (endNode.y + this.mob.getY()) / 2.0, (endNode.z + this.mob.getZ()) / 2.0);
return pos.closerToCenterThan(vec3, this.path.getNodeCount() - this.path.getNextNodeIndex());
diff --git a/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java b/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
index ea0f6a19e4a79538e68917ba86cbc98be4dbca8d..2c9c16d30ae55e86e00d3b97447c870a66ac8f6e 100644
index ea0f6a19e4a79538e68917ba86cbc98be4dbca8d..030d90f93dbbc07e94d4776198c368650539bf91 100644
--- a/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
@@ -15,11 +15,27 @@ public class WaterBoundPathNavigation extends PathNavigation {
@@ -486,7 +486,7 @@ index ea0f6a19e4a79538e68917ba86cbc98be4dbca8d..2c9c16d30ae55e86e00d3b97447c870a
}
+ // DivineMC start - async path processing
+ private static final org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ private static final org.bxteam.divinemc.async.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.async.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ SwimNodeEvaluator nodeEvaluator = new SwimNodeEvaluator(nodeEvaluatorFeatures.allowBreaching());
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
@@ -510,7 +510,7 @@ index ea0f6a19e4a79538e68917ba86cbc98be4dbca8d..2c9c16d30ae55e86e00d3b97447c870a
}
diff --git a/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java b/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
index 1f96fd5085bacb4c584576c7cb9f51e7898e9b03..e56869b8c700bfd9fa25f7b7db8663c4b8bad006 100644
index 1f96fd5085bacb4c584576c7cb9f51e7898e9b03..d975b89c7bb57562852596751a4ff881d3ecf193 100644
--- a/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
+++ b/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
@@ -57,17 +57,32 @@ public class NearestBedSensor extends Sensor<Mob> {
@@ -530,7 +530,7 @@ index 1f96fd5085bacb4c584576c7cb9f51e7898e9b03..e56869b8c700bfd9fa25f7b7db8663c4
+ // DivineMC start - async pathfinding
+ if (org.bxteam.divinemc.config.DivineConfig.AsyncCategory.asyncPathfinding) {
+ Path possiblePath = AcquirePoi.findPathToPois(entity, new java.util.HashSet<>(poiposes));
+ org.bxteam.divinemc.entity.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
+ org.bxteam.divinemc.async.pathfinding.AsyncPathProcessor.awaitProcessing(possiblePath, path -> {
+ processPath(entity, poiManager, path);
+ });
+ } else {
@@ -579,7 +579,7 @@ index ca5651f15552f91fba650747d28a75c00fa11442..c5883758d11e91f96b4139b3bd8586a8
}
}
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
index 85963b74a533beb7883ea417ceb3c21d834aebe0..1c9f3f0b2a344c026532c89c0db377ab8183c912 100644
index 85963b74a533beb7883ea417ceb3c21d834aebe0..dd2874406ad224393ccf1b45aef88c396597e633 100644
--- a/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
@@ -488,6 +488,17 @@ public class Frog extends Animal {
@@ -587,7 +587,7 @@ index 85963b74a533beb7883ea417ceb3c21d834aebe0..1c9f3f0b2a344c026532c89c0db377ab
}
+ // DivineMC start - async path processing
+ private static final org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ private static final org.bxteam.divinemc.async.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.async.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ Frog.FrogNodeEvaluator nodeEvaluator = new Frog.FrogNodeEvaluator(true);
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
@@ -626,7 +626,7 @@ index 2a13332ebabf2e63a8f51a5d794fab3d66c7a1db..d4e7fc0a5bda4f44bcfed3d1adae7cda
if (target != null) {
double d = this.distanceToSqr(target.getX(), target.getY(), target.getZ());
diff --git a/net/minecraft/world/entity/monster/Strider.java b/net/minecraft/world/entity/monster/Strider.java
index fe31c4a45afd61be8b74efe9d0858ccd0aced075..859c41c3c81b3d3ac05eebdc83c959d196bd5b3e 100644
index fe31c4a45afd61be8b74efe9d0858ccd0aced075..e2e42bbdba1daf6783d10a62aa4c4b1bcf138fe6 100644
--- a/net/minecraft/world/entity/monster/Strider.java
+++ b/net/minecraft/world/entity/monster/Strider.java
@@ -560,9 +560,25 @@ public class Strider extends Animal implements ItemSteerable {
@@ -634,7 +634,7 @@ index fe31c4a45afd61be8b74efe9d0858ccd0aced075..859c41c3c81b3d3ac05eebdc83c959d1
}
+ // DivineMC start - async path processing
+ private static final org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ private static final org.bxteam.divinemc.async.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator = (org.bxteam.divinemc.async.pathfinding.NodeEvaluatorFeatures nodeEvaluatorFeatures) -> {
+ WalkNodeEvaluator nodeEvaluator = new WalkNodeEvaluator();
+ nodeEvaluator.setCanPassDoors(nodeEvaluatorFeatures.canPassDoors());
+ nodeEvaluator.setCanFloat(nodeEvaluatorFeatures.canFloat());
@@ -707,18 +707,18 @@ index d6d3c8f5e5dd4a8cab0d3fcc131c3a59f06130c6..839653a997f1e10970fa2956fadaf493
return false;
} else if (pathentity.nodes.size() != this.nodes.size()) {
diff --git a/net/minecraft/world/level/pathfinder/PathFinder.java b/net/minecraft/world/level/pathfinder/PathFinder.java
index c2baadcdceb1df6a881d6f73aa4eb4dd264bcdfe..8997908508c1dbe839aab25e4f546b9aa664047e 100644
index c2baadcdceb1df6a881d6f73aa4eb4dd264bcdfe..38c8019f3cdfa351c120e80e312219416b157e6d 100644
--- a/net/minecraft/world/level/pathfinder/PathFinder.java
+++ b/net/minecraft/world/level/pathfinder/PathFinder.java
@@ -22,11 +22,19 @@ public class PathFinder {
public final NodeEvaluator nodeEvaluator;
private static final boolean DEBUG = false;
private final BinaryHeap openSet = new BinaryHeap();
+ private final @Nullable org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator; // DivineMC - we use this later to generate an evaluator
+ private final @Nullable org.bxteam.divinemc.async.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator; // DivineMC - we use this later to generate an evaluator
- public PathFinder(NodeEvaluator nodeEvaluator, int maxVisitedNodes) {
+ // DivineMC start - support nodeEvaluatorgenerators
+ public PathFinder(NodeEvaluator nodeEvaluator, int maxVisitedNodes, @Nullable org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator) { // DivineMC - add nodeEvaluatorGenerator
+ public PathFinder(NodeEvaluator nodeEvaluator, int maxVisitedNodes, @Nullable org.bxteam.divinemc.async.pathfinding.NodeEvaluatorGenerator nodeEvaluatorGenerator) { // DivineMC - add nodeEvaluatorGenerator
this.nodeEvaluator = nodeEvaluator;
this.maxVisitedNodes = maxVisitedNodes;
+ this.nodeEvaluatorGenerator = nodeEvaluatorGenerator;
@@ -743,12 +743,12 @@ index c2baadcdceb1df6a881d6f73aa4eb4dd264bcdfe..8997908508c1dbe839aab25e4f546b9a
+ this.openSet.clear(); // it's always cleared in processPath
+ NodeEvaluator nodeEvaluator = this.nodeEvaluatorGenerator == null
+ ? this.nodeEvaluator
+ : org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorCache.takeNodeEvaluator(this.nodeEvaluatorGenerator, this.nodeEvaluator);
+ : org.bxteam.divinemc.async.pathfinding.NodeEvaluatorCache.takeNodeEvaluator(this.nodeEvaluatorGenerator, this.nodeEvaluator);
+ nodeEvaluator.prepare(region, mob);
+ Node start = nodeEvaluator.getStart();
+ // DivineMC end - use a generated evaluator if we have one otherwise run sync
if (start == null) {
+ org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorCache.removeNodeEvaluator(nodeEvaluator); // DivineMC - handle nodeEvaluatorGenerator
+ org.bxteam.divinemc.async.pathfinding.NodeEvaluatorCache.removeNodeEvaluator(nodeEvaluator); // DivineMC - handle nodeEvaluatorGenerator
return null;
} else {
// Paper start - Perf: remove streams and optimize collection
@@ -764,11 +764,11 @@ index c2baadcdceb1df6a881d6f73aa4eb4dd264bcdfe..8997908508c1dbe839aab25e4f546b9a
+ // DivineMC start - async path processing
+ if (this.nodeEvaluatorGenerator == null) {
+ // run sync :(
+ org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorCache.removeNodeEvaluator(nodeEvaluator);
+ org.bxteam.divinemc.async.pathfinding.NodeEvaluatorCache.removeNodeEvaluator(nodeEvaluator);
+ return this.findPath(start, map, maxRange, accuracy, searchDepthMultiplier);
+ }
+
+ return new org.bxteam.divinemc.entity.pathfinding.AsyncPath(Lists.newArrayList(), targetPositions, () -> {
+ return new org.bxteam.divinemc.async.pathfinding.AsyncPath(Lists.newArrayList(), targetPositions, () -> {
+ try {
+ return this.processPath(nodeEvaluator, start, map, maxRange, accuracy, searchDepthMultiplier);
+ } catch (Exception e) {
@@ -776,7 +776,7 @@ index c2baadcdceb1df6a881d6f73aa4eb4dd264bcdfe..8997908508c1dbe839aab25e4f546b9a
+ return null;
+ } finally {
+ nodeEvaluator.done();
+ org.bxteam.divinemc.entity.pathfinding.NodeEvaluatorCache.returnNodeEvaluator(nodeEvaluator);
+ org.bxteam.divinemc.async.pathfinding.NodeEvaluatorCache.returnNodeEvaluator(nodeEvaluator);
+ }
+ });
+ // DivineMC end - async path processing

View File

@@ -66,7 +66,7 @@ index 9c0c99b936b4a82ebfe924866e53ec71f7bbe9ad..01ed1e3572e9c2ccfd19df117cda0d5c
.add(
new ClientboundUpdateAttributesPacket.AttributeSnapshot(
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
index c0d996fb99f053863ce623889add3feb70d7137d..a3290eb416ecb377d240bf334aef4e2b5e3bbefc 100644
index c0d996fb99f053863ce623889add3feb70d7137d..7ca147cf9da67c399806056e5092841f7ca32321 100644
--- a/net/minecraft/server/level/ChunkMap.java
+++ b/net/minecraft/server/level/ChunkMap.java
@@ -255,9 +255,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -98,7 +98,7 @@ index c0d996fb99f053863ce623889add3feb70d7137d..a3290eb416ecb377d240bf334aef4e2b
+ // DivineMC start - Multithreaded tracker
+ if (org.bxteam.divinemc.config.DivineConfig.AsyncCategory.multithreadedEnabled) {
+ final ServerLevel level = this.level;
+ org.bxteam.divinemc.entity.tracking.MultithreadedTracker.tick(level);
+ org.bxteam.divinemc.async.tracking.MultithreadedTracker.tick(level);
+ return;
+ }
+ // DivineMC end - Multithreaded tracker

View File

@@ -9,14 +9,14 @@ Original project: https://github.com/pufferfish-gg/Pufferfish
This patch reduces the main-thread impact of mob spawning by moving spawning work to other threads
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index 4a53105e46e338a52bc5ad22d51688a9a261d9e5..ed4a722c0fa458a0977366b92561d6a16827da56 100644
index 4a53105e46e338a52bc5ad22d51688a9a261d9e5..9bd7cc58cf10489f0e463347cdc2bc537f0509ec 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -289,6 +289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public boolean lagging = false; // Purpur - Lagging threshold
protected boolean upnp = false; // Purpur - UPnP Port Forwarding
public final org.bxteam.divinemc.util.tps.TPSCalculator tpsCalculator = new org.bxteam.divinemc.util.tps.TPSCalculator(); // DivineMC - Lag compensation
+ public org.bxteam.divinemc.util.AsyncProcessor mobSpawnExecutor = new org.bxteam.divinemc.util.AsyncProcessor("Mob Spawning"); // DivineMC - Pufferfish: Optimize mob spawning
+ public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("Mob Spawning"); // DivineMC - Pufferfish: Optimize mob spawning
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.init(); // Paper - rewrite data converter system

View File

@@ -111,7 +111,7 @@ index f36f8f2d49d4eba5c80eb243883749d6f831eb8a..b43b7e242ea0a4f87704853c03201144
}
}
diff --git a/net/minecraft/world/level/levelgen/DensityFunctions.java b/net/minecraft/world/level/levelgen/DensityFunctions.java
index 4c53031cf8f6198825b190955d96f20bbcccd77e..fb3c3c3e837056e2762cf32050440ed7a4142ddc 100644
index 4c53031cf8f6198825b190955d96f20bbcccd77e..2b65f922f802a9dbea56f1bae0d243af1080501f 100644
--- a/net/minecraft/world/level/levelgen/DensityFunctions.java
+++ b/net/minecraft/world/level/levelgen/DensityFunctions.java
@@ -275,38 +275,66 @@ public final class DensityFunctions {
@@ -182,7 +182,7 @@ index 4c53031cf8f6198825b190955d96f20bbcccd77e..fb3c3c3e837056e2762cf32050440ed7
- break;
- case MAX:
- d1 = this.argument2.maxValue();
+ org.bxteam.divinemc.dfc.common.util.ArrayCache arrayCache = contextProvider instanceof org.bxteam.divinemc.dfc.common.ducks.IArrayCacheCapable arrayCacheCapable ? arrayCacheCapable.c2me$getArrayCache() : null;
+ com.ishland.c2me.opts.dfc.common.util.ArrayCache arrayCache = contextProvider instanceof com.ishland.c2me.opts.dfc.common.ducks.IArrayCacheCapable arrayCacheCapable ? arrayCacheCapable.c2me$getArrayCache() : null;
- for (int i2 = 0; i2 < array.length; i2++) {
- double d2 = array[i2];
@@ -216,7 +216,7 @@ index 4c53031cf8f6198825b190955d96f20bbcccd77e..fb3c3c3e837056e2762cf32050440ed7
- protected record Marker(@Override DensityFunctions.Marker.Type type, @Override DensityFunction wrapped) implements DensityFunctions.MarkerOrMarked {
+ // DivineMC start - Density Function Compiler
+ public static final class Marker implements org.bxteam.divinemc.dfc.common.ducks.IFastCacheLike, org.bxteam.divinemc.dfc.common.ducks.IEqualityOverriding, MarkerOrMarked {
+ public static final class Marker implements com.ishland.c2me.opts.dfc.common.ducks.IFastCacheLike, com.ishland.c2me.opts.dfc.common.ducks.IEqualityOverriding, MarkerOrMarked {
+ private final Type type;
+ private final DensityFunction wrapped;
+ private Object c2me$optionalEquality;
@@ -234,7 +234,7 @@ index 4c53031cf8f6198825b190955d96f20bbcccd77e..fb3c3c3e837056e2762cf32050440ed7
+ return original.apply(that);
+ }
+ Object a = this.c2me$getOverriddenEquality();
+ Object b = that instanceof org.bxteam.divinemc.dfc.common.ducks.IEqualityOverriding equalityOverriding ? equalityOverriding.c2me$getOverriddenEquality() : null;
+ Object b = that instanceof com.ishland.c2me.opts.dfc.common.ducks.IEqualityOverriding equalityOverriding ? equalityOverriding.c2me$getOverriddenEquality() : null;
+ if (a == null) {
+ return original.apply(b != null ? b : that);
+ } else {
@@ -259,22 +259,22 @@ index 4c53031cf8f6198825b190955d96f20bbcccd77e..fb3c3c3e837056e2762cf32050440ed7
+ }
+
+ @Override
+ public double c2me$getCached(int x, int y, int z, org.bxteam.divinemc.dfc.common.ast.EvalType evalType) {
+ public double c2me$getCached(int x, int y, int z, com.ishland.c2me.opts.dfc.common.ast.EvalType evalType) {
+ return Double.longBitsToDouble(CACHE_MISS_NAN_BITS);
+ }
+
+ @Override
+ public boolean c2me$getCached(double[] res, int[] x, int[] y, int[] z, org.bxteam.divinemc.dfc.common.ast.EvalType evalType) {
+ public boolean c2me$getCached(double[] res, int[] x, int[] y, int[] z, com.ishland.c2me.opts.dfc.common.ast.EvalType evalType) {
+ return false;
+ }
+
+ @Override
+ public void c2me$cache(int x, int y, int z, org.bxteam.divinemc.dfc.common.ast.EvalType evalType, double cached) {
+ public void c2me$cache(int x, int y, int z, com.ishland.c2me.opts.dfc.common.ast.EvalType evalType, double cached) {
+ // nop
+ }
+
+ @Override
+ public void c2me$cache(double[] res, int[] x, int[] y, int[] z, org.bxteam.divinemc.dfc.common.ast.EvalType evalType) {
+ public void c2me$cache(double[] res, int[] x, int[] y, int[] z, com.ishland.c2me.opts.dfc.common.ast.EvalType evalType) {
+ // nop
+ }
+
@@ -286,7 +286,7 @@ index 4c53031cf8f6198825b190955d96f20bbcccd77e..fb3c3c3e837056e2762cf32050440ed7
+ @Override
+ public DensityFunction c2me$withDelegate(DensityFunction delegate) {
+ DensityFunctions.Marker wrapping = new DensityFunctions.Marker(this.type(), delegate);
+ ((org.bxteam.divinemc.dfc.common.ducks.IEqualityOverriding) (Object) wrapping).c2me$overrideEquality(this);
+ ((com.ishland.c2me.opts.dfc.common.ducks.IEqualityOverriding) (Object) wrapping).c2me$overrideEquality(this);
+ return wrapping;
+ }
+
@@ -294,7 +294,7 @@ index 4c53031cf8f6198825b190955d96f20bbcccd77e..fb3c3c3e837056e2762cf32050440ed7
+ public void c2me$overrideEquality(Object object) {
+ Object inner = object;
+ while (true) {
+ Object inner1 = inner instanceof org.bxteam.divinemc.dfc.common.ducks.IEqualityOverriding e1 ? e1.c2me$getOverriddenEquality() : null;
+ Object inner1 = inner instanceof com.ishland.c2me.opts.dfc.common.ducks.IEqualityOverriding e1 ? e1.c2me$getOverriddenEquality() : null;
+ if (inner1 == null) {
+ this.c2me$optionalEquality = inner;
+ break;
@@ -339,7 +339,7 @@ index 4c53031cf8f6198825b190955d96f20bbcccd77e..fb3c3c3e837056e2762cf32050440ed7
FlatCache("flat_cache"),
Cache2D("cache_2d"),
diff --git a/net/minecraft/world/level/levelgen/NoiseChunk.java b/net/minecraft/world/level/levelgen/NoiseChunk.java
index 977b0d595e5637c80e7d4bb20da8896a0b64b844..840c15e4e2613c20b6d4fbcb44cb096997958bd3 100644
index 977b0d595e5637c80e7d4bb20da8896a0b64b844..1a3da40d668054c92027cfe83d2ddbd803e0a1dd 100644
--- a/net/minecraft/world/level/levelgen/NoiseChunk.java
+++ b/net/minecraft/world/level/levelgen/NoiseChunk.java
@@ -4,9 +4,11 @@ import com.google.common.collect.Lists;
@@ -360,14 +360,14 @@ index 977b0d595e5637c80e7d4bb20da8896a0b64b844..840c15e4e2613c20b6d4fbcb44cb0969
-public class NoiseChunk implements DensityFunction.ContextProvider, DensityFunction.FunctionContext {
+// DivineMC start - Density Function Compiler
+import org.bxteam.divinemc.dfc.common.ast.EvalType;
+import org.bxteam.divinemc.dfc.common.ducks.IArrayCacheCapable;
+import org.bxteam.divinemc.dfc.common.ducks.ICoordinatesFilling;
+import org.bxteam.divinemc.dfc.common.ducks.IFastCacheLike;
+import org.bxteam.divinemc.dfc.common.gen.DelegatingBlendingAwareVisitor;
+import org.bxteam.divinemc.dfc.common.util.ArrayCache;
+import org.bxteam.divinemc.dfc.common.vif.EachApplierVanillaInterface;
+import org.bxteam.divinemc.dfc.common.vif.NoisePosVanillaInterface;
+import com.ishland.c2me.opts.dfc.common.ast.EvalType;
+import com.ishland.c2me.opts.dfc.common.ducks.IArrayCacheCapable;
+import com.ishland.c2me.opts.dfc.common.ducks.ICoordinatesFilling;
+import com.ishland.c2me.opts.dfc.common.ducks.IFastCacheLike;
+import com.ishland.c2me.opts.dfc.common.gen.DelegatingBlendingAwareVisitor;
+import com.ishland.c2me.opts.dfc.common.util.ArrayCache;
+import com.ishland.c2me.opts.dfc.common.vif.EachApplierVanillaInterface;
+import com.ishland.c2me.opts.dfc.common.vif.NoisePosVanillaInterface;
+// DivineMC end - Density Function Compiler
+
+public class NoiseChunk implements DensityFunction.ContextProvider, DensityFunction.FunctionContext, IArrayCacheCapable, ICoordinatesFilling {
@@ -1153,7 +1153,7 @@ index 977b0d595e5637c80e7d4bb20da8896a0b64b844..840c15e4e2613c20b6d4fbcb44cb0969
@Override
diff --git a/net/minecraft/world/level/levelgen/RandomState.java b/net/minecraft/world/level/levelgen/RandomState.java
index f1e089ecfffa40cd794c49db30fcedf138d3fee9..b28221ca337ce8d76bbccdd736a4c5b2c7cd08da 100644
index f1e089ecfffa40cd794c49db30fcedf138d3fee9..3d8bdd7e40c7457c0ad7729162b43cba2043b8b5 100644
--- a/net/minecraft/world/level/levelgen/RandomState.java
+++ b/net/minecraft/world/level/levelgen/RandomState.java
@@ -122,6 +122,41 @@ public final class RandomState {
@@ -1166,29 +1166,29 @@ index f1e089ecfffa40cd794c49db30fcedf138d3fee9..b28221ca337ce8d76bbccdd736a4c5b2
+ com.google.common.base.Stopwatch stopwatch = com.google.common.base.Stopwatch.createStarted();
+ it.unimi.dsi.fastutil.objects.Reference2ReferenceMap<DensityFunction, DensityFunction> tempCache = new it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap<>();
+ this.router = new NoiseRouter(
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.barrierNoise(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.fluidLevelFloodednessNoise(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.fluidLevelSpreadNoise(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.lavaNoise(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.temperature(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.vegetation(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.continents(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.erosion(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.depth(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.ridges(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.initialDensityWithoutJaggedness(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.finalDensity(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.veinToggle(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.veinRidged(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.router.veinGap(), tempCache)
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.barrierNoise(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.fluidLevelFloodednessNoise(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.fluidLevelSpreadNoise(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.lavaNoise(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.temperature(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.vegetation(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.continents(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.erosion(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.depth(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.ridges(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.initialDensityWithoutJaggedness(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.finalDensity(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.veinToggle(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.veinRidged(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.router.veinGap(), tempCache)
+ );
+ this.sampler = new Climate.Sampler(
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.sampler.temperature(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.sampler.humidity(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.sampler.continentalness(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.sampler.erosion(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.sampler.depth(), tempCache),
+ org.bxteam.divinemc.dfc.common.gen.BytecodeGen.compile(this.sampler.weirdness(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.sampler.temperature(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.sampler.humidity(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.sampler.continentalness(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.sampler.erosion(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.sampler.depth(), tempCache),
+ com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.compile(this.sampler.weirdness(), tempCache),
+ this.sampler.spawnTarget()
+ );
+ stopwatch.stop();

View File

@@ -82,13 +82,13 @@ index ac27ff24f018d8798921c5152e679ceed1e88d8d..ec7d1353b19e55b00c558df8981323ef
List<org.bukkit.block.BlockState> states = new java.util.ArrayList<>(level.capturedBlockStates.values());
level.capturedBlockStates.clear();
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index ed4a722c0fa458a0977366b92561d6a16827da56..9f5beb74d8b0198aebf7cad40def52d12a4a9b3d 100644
index 951199cb015694790ea8d81264779a7d294ab6ef..85f0abc2ead2d78a7189abaac8f803b70328a21b 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -290,6 +290,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
protected boolean upnp = false; // Purpur - UPnP Port Forwarding
public final org.bxteam.divinemc.util.tps.TPSCalculator tpsCalculator = new org.bxteam.divinemc.util.tps.TPSCalculator(); // DivineMC - Lag compensation
public org.bxteam.divinemc.util.AsyncProcessor mobSpawnExecutor = new org.bxteam.divinemc.util.AsyncProcessor("Mob Spawning"); // DivineMC - Pufferfish: Optimize mob spawning
public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("Mob Spawning"); // DivineMC - Pufferfish: Optimize mob spawning
+ public java.util.concurrent.Semaphore serverLevelTickingSemaphore = null; // DivineMC - Parallel world ticking
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
@@ -363,7 +363,7 @@ index bf680624bc6c618dfa0eeeb74c103ff6716fd27e..654d03368f06ab9870c11745b0994ea6
}
}
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index 3c1795eb56900cd80cfec38bd1d922d566463ecb..07b9a2529be69bf8158528e996e7ddb95ede9614 100644
index 3c1795eb56900cd80cfec38bd1d922d566463ecb..b752bcc03b558a26f9c592c829efb44a299be8de 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -180,7 +180,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@@ -396,7 +396,7 @@ index 3c1795eb56900cd80cfec38bd1d922d566463ecb..07b9a2529be69bf8158528e996e7ddb9
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
this.preciseTime = this.serverLevelData.getDayTime(); // Purpur - Configurable daylight cycle
this.ominousBanner = Objects.requireNonNullElse(this.registryAccess(), net.minecraft.core.RegistryAccess.EMPTY).lookup(Registries.BANNER_PATTERN).map(Raid::getOminousBannerInstance).orElse(null); // DivineMC - Optimize Raids
+ this.tickExecutor = java.util.concurrent.Executors.newSingleThreadExecutor(new org.bxteam.divinemc.server.ServerLevelTickExecutorThreadFactory(getWorld().getName())); // DivineMC - Parallel world ticking
+ this.tickExecutor = java.util.concurrent.Executors.newSingleThreadExecutor(new org.bxteam.divinemc.async.world.ServerLevelTickThreadFactory(getWorld().getName())); // DivineMC - Parallel world ticking
}
// Paper start
@@ -686,14 +686,14 @@ index bdf9899f960b6cca3529af97ebff738761208439..adea48cfde04df3107341075f414133a
List<Entity> list = new ArrayList<>(passengers.size());
this.ejectPassengers();
diff --git a/net/minecraft/world/entity/PortalProcessor.java b/net/minecraft/world/entity/PortalProcessor.java
index 91f6d43b3785ddad7db8eb529ba3293c45f3588d..fc3ab0881bf9b275beb9b32ca5a7475d50789401 100644
index 91f6d43b3785ddad7db8eb529ba3293c45f3588d..7fd5f40ee928330769bbe0c5e8da17fa65b30db6 100644
--- a/net/minecraft/world/entity/PortalProcessor.java
+++ b/net/minecraft/world/entity/PortalProcessor.java
@@ -11,6 +11,7 @@ public class PortalProcessor {
private BlockPos entryPosition;
private int portalTime;
private boolean insidePortalThisTick;
+ private org.bxteam.divinemc.util.PWTTeleportState teleportState = org.bxteam.divinemc.util.PWTTeleportState.INACTIVE; // DivineMC - Parallel world ticking
+ private org.bxteam.divinemc.async.world.TeleportState teleportState = org.bxteam.divinemc.async.world.TeleportState.INACTIVE; // DivineMC - Parallel world ticking
public PortalProcessor(Portal portal, BlockPos entryPosition) {
this.portal = portal;
@@ -721,27 +721,27 @@ index 91f6d43b3785ddad7db8eb529ba3293c45f3588d..fc3ab0881bf9b275beb9b32ca5a7475d
+
+ // DivineMC start - Parallel world ticking
+ public boolean isParallelTeleportPending() {
+ return this.teleportState == org.bxteam.divinemc.util.PWTTeleportState.PENDING;
+ return this.teleportState == org.bxteam.divinemc.async.world.TeleportState.PENDING;
+ }
+
+ public boolean isParallelTeleportScheduled() {
+ return this.teleportState != org.bxteam.divinemc.util.PWTTeleportState.INACTIVE;
+ return this.teleportState != org.bxteam.divinemc.async.world.TeleportState.INACTIVE;
+ }
+
+ public boolean isParallelCancelledByPlugin() {
+ return this.teleportState == org.bxteam.divinemc.util.PWTTeleportState.CANCELLED;
+ return this.teleportState == org.bxteam.divinemc.async.world.TeleportState.CANCELLED;
+ }
+
+ public void setParallelAsScheduled() {
+ this.teleportState = org.bxteam.divinemc.util.PWTTeleportState.PENDING;
+ this.teleportState = org.bxteam.divinemc.async.world.TeleportState.PENDING;
+ }
+
+ public void confirmParallelAsHandled() {
+ this.teleportState = org.bxteam.divinemc.util.PWTTeleportState.INACTIVE;
+ this.teleportState = org.bxteam.divinemc.async.world.TeleportState.INACTIVE;
+ }
+
+ public void setParallelAsCancelled() {
+ this.teleportState = org.bxteam.divinemc.util.PWTTeleportState.CANCELLED;
+ this.teleportState = org.bxteam.divinemc.async.world.TeleportState.CANCELLED;
+ }
+ // DivineMC end - Parallel world ticking
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] MSPT Tracking for each world
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index 9f5beb74d8b0198aebf7cad40def52d12a4a9b3d..4bbb9b8701e4f5a411a12b8fd977e6de19a22b26 100644
index 85f0abc2ead2d78a7189abaac8f803b70328a21b..432b4b981353fe8427f9675806500e43a080535c 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -1677,7 +1677,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -25,7 +25,7 @@ index 9f5beb74d8b0198aebf7cad40def52d12a4a9b3d..4bbb9b8701e4f5a411a12b8fd977e6de
CrashReport crashReport = CrashReport.forThrowable(levelTickingException, "Exception ticking world");
serverLevel.fillReportDetails(crashReport);
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index 07b9a2529be69bf8158528e996e7ddb95ede9614..07138e724d46ecfd09aa75008428502fa01c05fc 100644
index b752bcc03b558a26f9c592c829efb44a299be8de..f9091b2daf735fd0788f8d6d60e3c812fd6dd4f2 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -569,6 +569,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe

View File

@@ -20,7 +20,7 @@ index 4535858701b2bb232b9d2feb2af6551526232ddc..aa4dd7517e8be167aef1eaf7aa907e3c
if (var4 instanceof ReportedException reportedException && reportedException.getCause() instanceof OutOfMemoryError) {
throw makeReportedException(var4, packet, processor);
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index 4bbb9b8701e4f5a411a12b8fd977e6de19a22b26..b31a4edee0616a63026f7a4335205f2d99d2f641 100644
index 432b4b981353fe8427f9675806500e43a080535c..b6cfd764273a2102525a66955ab2217071d0154d 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -1686,6 +1686,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View File

@@ -11,7 +11,7 @@ As part of: C2ME (https://github.com/RelativityMC/C2ME-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/net/minecraft/world/level/levelgen/Aquifer.java b/net/minecraft/world/level/levelgen/Aquifer.java
index c62a15ea4a1bb22e7bcc2fc544acf8a601892029..2efa0b8bb7189d768cb43e55376b397f4f806374 100644
index c62a15ea4a1bb22e7bcc2fc544acf8a601892029..06419ac3b18365b27b522baba24736c1add5bd9a 100644
--- a/net/minecraft/world/level/levelgen/Aquifer.java
+++ b/net/minecraft/world/level/levelgen/Aquifer.java
@@ -85,6 +85,15 @@ public interface Aquifer {
@@ -41,7 +41,7 @@ index c62a15ea4a1bb22e7bcc2fc544acf8a601892029..2efa0b8bb7189d768cb43e55376b397f
+
+ int sizeY = this.aquiferLocationCache.length / (this.gridSizeX * this.gridSizeZ);
+
+ final RandomSource random = org.bxteam.divinemc.util.RandomUtil.getRandom(this.positionalRandomFactory);
+ final RandomSource random = com.ishland.c2me.opts.worldgen.general.common.random_instances.RandomUtils.getRandom(this.positionalRandomFactory);
+ // index: y, z, x
+ for (int y = 0; y < sizeY; y++) {
+ for (int z = 0; z < this.gridSizeZ; z++) {
@@ -49,7 +49,7 @@ index c62a15ea4a1bb22e7bcc2fc544acf8a601892029..2efa0b8bb7189d768cb43e55376b397f
+ final int x1 = x + this.minGridX;
+ final int y1 = y + this.minGridY;
+ final int z1 = z + this.minGridZ;
+ org.bxteam.divinemc.util.RandomUtil.derive(this.positionalRandomFactory, random, x1, y1, z1);
+ com.ishland.c2me.opts.worldgen.general.common.random_instances.RandomUtils.derive(this.positionalRandomFactory, random, x1, y1, z1);
+ int x2 = x1 * 16 + random.nextInt(10);
+ int y2 = y1 * 12 + random.nextInt(9);
+ int z2 = z1 * 16 + random.nextInt(10);

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Async Join Thread
diff --git a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 443aebb71b2a55ee9dcd2dd4bf9a30fbb8da9e49..cd926f0576d73bc3ef41c9a075a7ac9c54c9dd41 100644
index 443aebb71b2a55ee9dcd2dd4bf9a30fbb8da9e49..6cec77e483d51771c602bbdb537c62c893043c08 100644
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -53,7 +53,6 @@ import org.bukkit.event.player.PlayerPreLoginEvent;
@@ -24,7 +24,7 @@ index 443aebb71b2a55ee9dcd2dd4bf9a30fbb8da9e49..cd926f0576d73bc3ef41c9a075a7ac9c
- // Paper start - Cache authenticator threads
- authenticatorPool.execute(() -> {
+ // DivineMC start - Async Join Thread
+ org.bxteam.divinemc.server.network.AsyncJoinHandler.runAsync(() -> {
+ org.bxteam.divinemc.async.AsyncJoinHandler.runAsync(() -> {
try {
GameProfile gameprofile = ServerLoginPacketListenerImpl.this.createOfflineProfile(ServerLoginPacketListenerImpl.this.requestedUsername); // Spigot
@@ -54,7 +54,7 @@ index 443aebb71b2a55ee9dcd2dd4bf9a30fbb8da9e49..cd926f0576d73bc3ef41c9a075a7ac9c
// Paper start - Cache authenticator threads
- authenticatorPool.execute(new Runnable() {
+ // DivineMC start - Async Join Thread
+ org.bxteam.divinemc.server.network.AsyncJoinHandler.runAsync(new Runnable() {
+ org.bxteam.divinemc.async.AsyncJoinHandler.runAsync(new Runnable() {
@Override
public void run() {
String string1 = Objects.requireNonNull(ServerLoginPacketListenerImpl.this.requestedUsername, "Player name not initialized");
@@ -64,7 +64,7 @@ index 443aebb71b2a55ee9dcd2dd4bf9a30fbb8da9e49..cd926f0576d73bc3ef41c9a075a7ac9c
// Proceed with login
- authenticatorPool.execute(() -> {
+ // DivineMC start - Async Join Thread
+ org.bxteam.divinemc.server.network.AsyncJoinHandler.runAsync(() -> {
+ org.bxteam.divinemc.async.AsyncJoinHandler.runAsync(() -> {
try {
final GameProfile gameprofile = this.callPlayerPreLoginEvents(this.authenticatedProfile);
ServerLoginPacketListenerImpl.LOGGER.info("UUID of player {} is {}", gameprofile.getName(), gameprofile.getId());

View File

@@ -54,7 +54,7 @@ index 62b9d9486c15a1ec6527f786df4e9fc483390bcb..36d8b93182cc44e3bea245800ea9e271
int i = buffer.readableBytes();
if (i >= 0 && i <= maxSize) {
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index b31a4edee0616a63026f7a4335205f2d99d2f641..0072f3f07b1962adc1766930bb9a2f709cb76e6e 100644
index b6cfd764273a2102525a66955ab2217071d0154d..0ccfbee593fc16073484b1d4ed9458406b8cce50 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -1788,6 +1788,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View File

@@ -60,7 +60,7 @@ index 51c126735ace8fdde89ad97b5cab62f244212db0..23f6ed26b531ea570fdf2ae48c1e2710
+ public void moonrise$write(final org.bxteam.divinemc.region.IRegionFile regionFile) throws IOException; // DivineMC - Buffered Linear region format
}
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index 0072f3f07b1962adc1766930bb9a2f709cb76e6e..0bb53e820fbc8891cc9942d375e77bf6f9d5a1aa 100644
index 0ccfbee593fc16073484b1d4ed9458406b8cce50..f1696e8b2143caee9d6e9ce942c9a07c1e5d4998 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -942,10 +942,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View File

@@ -45,7 +45,7 @@ index 4913ac7d0426025689c8aee3790d87f7ac0131fd..d4d3aeae964d9a64805ddc5862e46fff
break;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 67d25c18b1d13da3294572ea4ec17f2d18cba43c..87d9228e7ec8688e7949c4472224c6b920bb83c4 100644
index 67d25c18b1d13da3294572ea4ec17f2d18cba43c..820746afec2d007cc895edcf637622ef4c0d058c 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1808,6 +1808,26 @@ public class CraftEventFactory {
@@ -53,7 +53,7 @@ index 67d25c18b1d13da3294572ea4ec17f2d18cba43c..87d9228e7ec8688e7949c4472224c6b9
public static boolean handleBlockFormEvent(Level world, BlockPos pos, net.minecraft.world.level.block.state.BlockState state, int flags, @Nullable Entity entity, boolean checkSetResult) {
+ // DivineMC start - Multithreaded Tracker
+ if (org.bxteam.divinemc.config.DivineConfig.AsyncCategory.multithreadedEnabled && Thread.currentThread() instanceof org.bxteam.divinemc.entity.tracking.MultithreadedTracker.MultithreadedTrackerThread) {
+ if (org.bxteam.divinemc.config.DivineConfig.AsyncCategory.multithreadedEnabled && Thread.currentThread() instanceof org.bxteam.divinemc.async.tracking.MultithreadedTracker.MultithreadedTrackerThread) {
+ java.util.concurrent.CompletableFuture<Boolean> future = new java.util.concurrent.CompletableFuture<>();
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> {
+ boolean resultFlag = false;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.dfc.common;
package com.ishland.c2me.opts.dfc.common;
import net.minecraft.world.level.levelgen.NoiseRouterData;

View File

@@ -1,6 +1,6 @@
package org.bxteam.divinemc.dfc.common.ast;
package com.ishland.c2me.opts.dfc.common.ast;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import org.objectweb.asm.commons.InstructionAdapter;
public interface AstNode {

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.dfc.common.ast;
package com.ishland.c2me.opts.dfc.common.ast;
public interface AstTransformer {
AstNode transform(AstNode var1);

View File

@@ -1,6 +1,6 @@
package org.bxteam.divinemc.dfc.common.ast;
package com.ishland.c2me.opts.dfc.common.ast;
import org.bxteam.divinemc.dfc.common.vif.EachApplierVanillaInterface;
import com.ishland.c2me.opts.dfc.common.vif.EachApplierVanillaInterface;
import net.minecraft.world.level.levelgen.DensityFunction;
import net.minecraft.world.level.levelgen.NoiseChunk;

View File

@@ -1,31 +1,31 @@
package org.bxteam.divinemc.dfc.common.ast;
package com.ishland.c2me.opts.dfc.common.ast;
import org.bxteam.divinemc.dfc.common.ast.binary.AddNode;
import org.bxteam.divinemc.dfc.common.ast.binary.MaxNode;
import org.bxteam.divinemc.dfc.common.ast.binary.MaxShortNode;
import org.bxteam.divinemc.dfc.common.ast.binary.MinNode;
import org.bxteam.divinemc.dfc.common.ast.binary.MinShortNode;
import org.bxteam.divinemc.dfc.common.ast.binary.MulNode;
import org.bxteam.divinemc.dfc.common.ast.misc.CacheLikeNode;
import org.bxteam.divinemc.dfc.common.ast.misc.ConstantNode;
import org.bxteam.divinemc.dfc.common.ast.misc.DelegateNode;
import org.bxteam.divinemc.dfc.common.ast.misc.RangeChoiceNode;
import org.bxteam.divinemc.dfc.common.ast.misc.YClampedGradientNode;
import org.bxteam.divinemc.dfc.common.ast.noise.DFTNoiseNode;
import org.bxteam.divinemc.dfc.common.ast.noise.DFTShiftANode;
import org.bxteam.divinemc.dfc.common.ast.noise.DFTShiftBNode;
import org.bxteam.divinemc.dfc.common.ast.noise.DFTShiftNode;
import org.bxteam.divinemc.dfc.common.ast.noise.DFTWeirdScaledSamplerNode;
import org.bxteam.divinemc.dfc.common.ast.noise.ShiftedNoiseNode;
import org.bxteam.divinemc.dfc.common.ast.spline.SplineAstNode;
import org.bxteam.divinemc.dfc.common.ast.unary.AbsNode;
import org.bxteam.divinemc.dfc.common.ast.unary.CubeNode;
import org.bxteam.divinemc.dfc.common.ast.unary.NegMulNode;
import org.bxteam.divinemc.dfc.common.ast.unary.SquareNode;
import org.bxteam.divinemc.dfc.common.ast.unary.SqueezeNode;
import org.bxteam.divinemc.dfc.common.ducks.IEqualityOverriding;
import org.bxteam.divinemc.dfc.common.ducks.IFastCacheLike;
import org.bxteam.divinemc.dfc.common.vif.AstVanillaInterface;
import com.ishland.c2me.opts.dfc.common.ast.binary.AddNode;
import com.ishland.c2me.opts.dfc.common.ast.binary.MaxNode;
import com.ishland.c2me.opts.dfc.common.ast.binary.MaxShortNode;
import com.ishland.c2me.opts.dfc.common.ast.binary.MinNode;
import com.ishland.c2me.opts.dfc.common.ast.binary.MinShortNode;
import com.ishland.c2me.opts.dfc.common.ast.binary.MulNode;
import com.ishland.c2me.opts.dfc.common.ast.misc.CacheLikeNode;
import com.ishland.c2me.opts.dfc.common.ast.misc.ConstantNode;
import com.ishland.c2me.opts.dfc.common.ast.misc.DelegateNode;
import com.ishland.c2me.opts.dfc.common.ast.misc.RangeChoiceNode;
import com.ishland.c2me.opts.dfc.common.ast.misc.YClampedGradientNode;
import com.ishland.c2me.opts.dfc.common.ast.noise.DFTNoiseNode;
import com.ishland.c2me.opts.dfc.common.ast.noise.DFTShiftANode;
import com.ishland.c2me.opts.dfc.common.ast.noise.DFTShiftBNode;
import com.ishland.c2me.opts.dfc.common.ast.noise.DFTShiftNode;
import com.ishland.c2me.opts.dfc.common.ast.noise.DFTWeirdScaledSamplerNode;
import com.ishland.c2me.opts.dfc.common.ast.noise.ShiftedNoiseNode;
import com.ishland.c2me.opts.dfc.common.ast.spline.SplineAstNode;
import com.ishland.c2me.opts.dfc.common.ast.unary.AbsNode;
import com.ishland.c2me.opts.dfc.common.ast.unary.CubeNode;
import com.ishland.c2me.opts.dfc.common.ast.unary.NegMulNode;
import com.ishland.c2me.opts.dfc.common.ast.unary.SquareNode;
import com.ishland.c2me.opts.dfc.common.ast.unary.SqueezeNode;
import com.ishland.c2me.opts.dfc.common.ducks.IEqualityOverriding;
import com.ishland.c2me.opts.dfc.common.ducks.IFastCacheLike;
import com.ishland.c2me.opts.dfc.common.vif.AstVanillaInterface;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;
import net.minecraft.world.level.levelgen.DensityFunctions;

View File

@@ -1,9 +1,9 @@
package org.bxteam.divinemc.dfc.common.ast.binary;
package com.ishland.c2me.opts.dfc.common.ast.binary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen.Context;
import org.bxteam.divinemc.dfc.common.util.ArrayCache;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.Context;
import com.ishland.c2me.opts.dfc.common.util.ArrayCache;
import java.util.Objects;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.binary;
package com.ishland.c2me.opts.dfc.common.ast.binary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.binary;
package com.ishland.c2me.opts.dfc.common.ast.binary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.binary;
package com.ishland.c2me.opts.dfc.common.ast.binary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen.Context;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.Context;
import org.objectweb.asm.Label;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.binary;
package com.ishland.c2me.opts.dfc.common.ast.binary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.binary;
package com.ishland.c2me.opts.dfc.common.ast.binary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen.Context;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.Context;
import org.objectweb.asm.Label;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.binary;
package com.ishland.c2me.opts.dfc.common.ast.binary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen.Context;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.Context;
import org.objectweb.asm.Label;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.dfc.common.ast.dfvisitor;
package com.ishland.c2me.opts.dfc.common.ast.dfvisitor;
import net.minecraft.world.level.levelgen.DensityFunction;
import net.minecraft.world.level.levelgen.DensityFunctions;

View File

@@ -1,13 +1,13 @@
package org.bxteam.divinemc.dfc.common.ast.misc;
package com.ishland.c2me.opts.dfc.common.ast.misc;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.ducks.IFastCacheLike;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen.Context;
import org.bxteam.divinemc.dfc.common.gen.IMultiMethod;
import org.bxteam.divinemc.dfc.common.gen.ISingleMethod;
import org.bxteam.divinemc.dfc.common.gen.SubCompiledDensityFunction;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.ducks.IFastCacheLike;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.Context;
import com.ishland.c2me.opts.dfc.common.gen.IMultiMethod;
import com.ishland.c2me.opts.dfc.common.gen.ISingleMethod;
import com.ishland.c2me.opts.dfc.common.gen.SubCompiledDensityFunction;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;
import net.minecraft.world.level.levelgen.DensityFunctions;

View File

@@ -1,9 +1,9 @@
package org.bxteam.divinemc.dfc.common.ast.misc;
package com.ishland.c2me.opts.dfc.common.ast.misc;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import java.util.Arrays;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,12 +1,12 @@
package org.bxteam.divinemc.dfc.common.ast.misc;
package com.ishland.c2me.opts.dfc.common.ast.misc;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import org.bxteam.divinemc.dfc.common.util.ArrayCache;
import org.bxteam.divinemc.dfc.common.vif.EachApplierVanillaInterface;
import org.bxteam.divinemc.dfc.common.vif.NoisePosVanillaInterface;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.util.ArrayCache;
import com.ishland.c2me.opts.dfc.common.vif.EachApplierVanillaInterface;
import com.ishland.c2me.opts.dfc.common.vif.NoisePosVanillaInterface;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;
import org.objectweb.asm.Label;

View File

@@ -1,10 +1,10 @@
package org.bxteam.divinemc.dfc.common.ast.misc;
package com.ishland.c2me.opts.dfc.common.ast.misc;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen.Context;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.Context;
import java.util.Objects;
import org.objectweb.asm.Label;
import org.objectweb.asm.Type;

View File

@@ -1,9 +1,9 @@
package org.bxteam.divinemc.dfc.common.ast.misc;
package com.ishland.c2me.opts.dfc.common.ast.misc;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import java.util.Objects;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,9 +1,9 @@
package org.bxteam.divinemc.dfc.common.ast.misc;
package com.ishland.c2me.opts.dfc.common.ast.misc;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import net.minecraft.util.Mth;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,9 +1,9 @@
package org.bxteam.divinemc.dfc.common.ast.noise;
package com.ishland.c2me.opts.dfc.common.ast.noise;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;
import org.objectweb.asm.Type;

View File

@@ -1,9 +1,9 @@
package org.bxteam.divinemc.dfc.common.ast.noise;
package com.ishland.c2me.opts.dfc.common.ast.noise;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;
import org.objectweb.asm.Type;

View File

@@ -1,9 +1,9 @@
package org.bxteam.divinemc.dfc.common.ast.noise;
package com.ishland.c2me.opts.dfc.common.ast.noise;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;
import org.objectweb.asm.Type;

View File

@@ -1,9 +1,9 @@
package org.bxteam.divinemc.dfc.common.ast.noise;
package com.ishland.c2me.opts.dfc.common.ast.noise;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;
import org.objectweb.asm.Type;

View File

@@ -1,10 +1,10 @@
package org.bxteam.divinemc.dfc.common.ast.noise;
package com.ishland.c2me.opts.dfc.common.ast.noise;
import org.bxteam.divinemc.dfc.common.IDensityFunctionsCaveScaler;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.IDensityFunctionsCaveScaler;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;
import net.minecraft.world.level.levelgen.DensityFunctions;

View File

@@ -1,10 +1,10 @@
package org.bxteam.divinemc.dfc.common.ast.noise;
package com.ishland.c2me.opts.dfc.common.ast.noise;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen.Context;
import org.bxteam.divinemc.dfc.common.util.ArrayCache;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen.Context;
import com.ishland.c2me.opts.dfc.common.util.ArrayCache;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;
import org.objectweb.asm.Type;

View File

@@ -1,11 +1,11 @@
package org.bxteam.divinemc.dfc.common.ast.spline;
package com.ishland.c2me.opts.dfc.common.ast.spline;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.ast.McToAst;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import org.bxteam.divinemc.dfc.common.vif.NoisePosVanillaInterface;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.ast.McToAst;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.vif.NoisePosVanillaInterface;
import it.unimi.dsi.fastutil.Pair;
import it.unimi.dsi.fastutil.ints.IntObjectPair;
import java.util.ArrayList;
@@ -16,7 +16,7 @@ import net.minecraft.util.CubicSpline;
import net.minecraft.util.Mth;
import net.minecraft.world.level.levelgen.DensityFunction;
import net.minecraft.world.level.levelgen.DensityFunctions;
import org.bxteam.divinemc.util.Assertions;
import com.ishland.flowsched.util.Assertions;
import org.objectweb.asm.Label;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.AnalyzerAdapter;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.dfc.common.ast.spline;
package com.ishland.c2me.opts.dfc.common.ast.spline;
public class SplineSupport {
public SplineSupport() {

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.unary;
package com.ishland.c2me.opts.dfc.common.ast.unary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.unary;
package com.ishland.c2me.opts.dfc.common.ast.unary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.AstTransformer;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.AstTransformer;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import java.util.Objects;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.unary;
package com.ishland.c2me.opts.dfc.common.ast.unary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.unary;
package com.ishland.c2me.opts.dfc.common.ast.unary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import org.objectweb.asm.Label;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.unary;
package com.ishland.c2me.opts.dfc.common.ast.unary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.ast.unary;
package com.ishland.c2me.opts.dfc.common.ast.unary;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.gen.BytecodeGen;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
import net.minecraft.util.Mth;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.InstructionAdapter;

View File

@@ -0,0 +1,7 @@
package com.ishland.c2me.opts.dfc.common.ducks;
import com.ishland.c2me.opts.dfc.common.util.ArrayCache;
public interface IArrayCacheCapable {
ArrayCache c2me$getArrayCache();
}

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.dfc.common.ducks;
package com.ishland.c2me.opts.dfc.common.ducks;
public interface IBlendingAwareVisitor {
boolean c2me$isBlendingEnabled();

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.dfc.common.ducks;
package com.ishland.c2me.opts.dfc.common.ducks;
public interface ICoordinatesFilling {
void c2me$fillCoordinates(int[] var1, int[] var2, int[] var3);

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.dfc.common.ducks;
package com.ishland.c2me.opts.dfc.common.ducks;
public interface IEqualityOverriding {
void c2me$overrideEquality(Object var1);

View File

@@ -1,6 +1,6 @@
package org.bxteam.divinemc.dfc.common.ducks;
package com.ishland.c2me.opts.dfc.common.ducks;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import net.minecraft.world.level.levelgen.DensityFunction;
public interface IFastCacheLike extends DensityFunction {

View File

@@ -1,14 +1,14 @@
package org.bxteam.divinemc.dfc.common.gen;
package com.ishland.c2me.opts.dfc.common.gen;
import com.google.common.io.Files;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.ast.McToAst;
import org.bxteam.divinemc.dfc.common.ast.dfvisitor.StripBlending;
import org.bxteam.divinemc.dfc.common.ast.misc.ConstantNode;
import org.bxteam.divinemc.dfc.common.ast.misc.RootNode;
import org.bxteam.divinemc.dfc.common.util.ArrayCache;
import org.bxteam.divinemc.dfc.common.vif.AstVanillaInterface;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.ast.McToAst;
import com.ishland.c2me.opts.dfc.common.ast.dfvisitor.StripBlending;
import com.ishland.c2me.opts.dfc.common.ast.misc.ConstantNode;
import com.ishland.c2me.opts.dfc.common.ast.misc.RootNode;
import com.ishland.c2me.opts.dfc.common.util.ArrayCache;
import com.ishland.c2me.opts.dfc.common.vif.AstVanillaInterface;
import it.unimi.dsi.fastutil.Hash;
import it.unimi.dsi.fastutil.Pair;
import it.unimi.dsi.fastutil.ints.IntObjectPair;
@@ -237,7 +237,7 @@ public class BytecodeGen {
static {
try {
org.bxteam.divinemc.util.Files.deleteRecursively(exportDir);
com.ishland.c2me.opts.dfc.util.Files.deleteRecursively(exportDir);
} catch (IOException var1) {
IOException e = var1;
e.printStackTrace();

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.gen;
package com.ishland.c2me.opts.dfc.common.gen;
import com.google.common.base.Suppliers;
import org.bxteam.divinemc.dfc.common.ducks.IBlendingAwareVisitor;
import org.bxteam.divinemc.dfc.common.ducks.IFastCacheLike;
import com.ishland.c2me.opts.dfc.common.ducks.IBlendingAwareVisitor;
import com.ishland.c2me.opts.dfc.common.ducks.IFastCacheLike;
import java.util.List;
import java.util.ListIterator;
import java.util.Objects;

View File

@@ -1,7 +1,7 @@
package org.bxteam.divinemc.dfc.common.gen;
package com.ishland.c2me.opts.dfc.common.gen;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.util.ArrayCache;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.util.ArrayCache;
import java.util.List;
public interface CompiledEntry extends ISingleMethod, IMultiMethod {

View File

@@ -1,6 +1,6 @@
package org.bxteam.divinemc.dfc.common.gen;
package com.ishland.c2me.opts.dfc.common.gen;
import org.bxteam.divinemc.dfc.common.ducks.IBlendingAwareVisitor;
import com.ishland.c2me.opts.dfc.common.ducks.IBlendingAwareVisitor;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;
import org.jetbrains.annotations.NotNull;

View File

@@ -1,7 +1,7 @@
package org.bxteam.divinemc.dfc.common.gen;
package com.ishland.c2me.opts.dfc.common.gen;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.util.ArrayCache;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.util.ArrayCache;
@FunctionalInterface
public interface IMultiMethod {

View File

@@ -1,6 +1,6 @@
package org.bxteam.divinemc.dfc.common.gen;
package com.ishland.c2me.opts.dfc.common.gen;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
@FunctionalInterface
public interface ISingleMethod {

View File

@@ -1,12 +1,12 @@
package org.bxteam.divinemc.dfc.common.gen;
package com.ishland.c2me.opts.dfc.common.gen;
import com.google.common.base.Suppliers;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.ducks.IArrayCacheCapable;
import org.bxteam.divinemc.dfc.common.ducks.IBlendingAwareVisitor;
import org.bxteam.divinemc.dfc.common.ducks.ICoordinatesFilling;
import org.bxteam.divinemc.dfc.common.util.ArrayCache;
import org.bxteam.divinemc.dfc.common.vif.EachApplierVanillaInterface;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.ducks.IArrayCacheCapable;
import com.ishland.c2me.opts.dfc.common.ducks.IBlendingAwareVisitor;
import com.ishland.c2me.opts.dfc.common.ducks.ICoordinatesFilling;
import com.ishland.c2me.opts.dfc.common.util.ArrayCache;
import com.ishland.c2me.opts.dfc.common.vif.EachApplierVanillaInterface;
import java.util.Objects;
import java.util.function.Supplier;
import net.minecraft.util.KeyDispatchDataCodec;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.dfc.common.util;
package com.ishland.c2me.opts.dfc.common.util;
import it.unimi.dsi.fastutil.ints.Int2ReferenceArrayMap;
import it.unimi.dsi.fastutil.objects.ReferenceArrayList;

View File

@@ -1,10 +1,10 @@
package org.bxteam.divinemc.dfc.common.vif;
package com.ishland.c2me.opts.dfc.common.vif;
import org.bxteam.divinemc.dfc.common.ast.AstNode;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.ast.misc.CacheLikeNode;
import org.bxteam.divinemc.dfc.common.ast.misc.DelegateNode;
import org.bxteam.divinemc.dfc.common.ducks.IFastCacheLike;
import com.ishland.c2me.opts.dfc.common.ast.AstNode;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.ast.misc.CacheLikeNode;
import com.ishland.c2me.opts.dfc.common.ast.misc.DelegateNode;
import com.ishland.c2me.opts.dfc.common.ducks.IFastCacheLike;
import java.util.Objects;
import net.minecraft.util.KeyDispatchDataCodec;
import net.minecraft.world.level.levelgen.DensityFunction;

View File

@@ -1,8 +1,8 @@
package org.bxteam.divinemc.dfc.common.vif;
package com.ishland.c2me.opts.dfc.common.vif;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import org.bxteam.divinemc.dfc.common.ducks.IArrayCacheCapable;
import org.bxteam.divinemc.dfc.common.util.ArrayCache;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.ducks.IArrayCacheCapable;
import com.ishland.c2me.opts.dfc.common.util.ArrayCache;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;

View File

@@ -1,6 +1,6 @@
package org.bxteam.divinemc.dfc.common.vif;
package com.ishland.c2me.opts.dfc.common.vif;
import org.bxteam.divinemc.dfc.common.ast.EvalType;
import com.ishland.c2me.opts.dfc.common.ast.EvalType;
import java.util.Objects;
import net.minecraft.world.level.levelgen.DensityFunction;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.util;
package com.ishland.c2me.opts.dfc.util;
import java.io.File;
import java.io.IOException;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.util;
package com.ishland.c2me.opts.worldgen.general.common.random_instances;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
@@ -7,27 +7,18 @@ import net.minecraft.world.level.levelgen.PositionalRandomFactory;
import net.minecraft.world.level.levelgen.SingleThreadedRandomSource;
import net.minecraft.world.level.levelgen.Xoroshiro128PlusPlus;
import net.minecraft.world.level.levelgen.XoroshiroRandomSource;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
public final class RandomUtil {
public static @NotNull RandomSource getRandom(PositionalRandomFactory deriver) {
if (deriver instanceof XoroshiroRandomSource.XoroshiroPositionalRandomFactory) {
return new XoroshiroRandomSource(0L, 0L);
}
if (deriver instanceof LegacyRandomSource.LegacyPositionalRandomFactory) {
return new SingleThreadedRandomSource(0L);
}
throw new IllegalArgumentException();
}
public class RandomUtils {
private static final ThreadLocal<XoroshiroRandomSource> xoroshiro = ThreadLocal.withInitial(() -> new XoroshiroRandomSource(0L, 0L));
private static final ThreadLocal<SingleThreadedRandomSource> simple = ThreadLocal.withInitial(() -> new SingleThreadedRandomSource(0L));
public static void derive(PositionalRandomFactory deriver, RandomSource random, int x, int y, int z) {
if (deriver instanceof final XoroshiroRandomSource.XoroshiroPositionalRandomFactory deriver1) {
if (deriver instanceof XoroshiroRandomSource.XoroshiroPositionalRandomFactory(long seedLo, long seedHi)) {
final Xoroshiro128PlusPlus implementation = ((XoroshiroRandomSource) random).randomNumberGenerator;
implementation.seedLo = (Mth.getSeed(x, y, z) ^ deriver1.seedLo());
implementation.seedHi = (deriver1.seedHi());
implementation.seedLo = (Mth.getSeed(x, y, z) ^ seedLo);
implementation.seedHi = (seedHi);
return;
}
if (deriver instanceof LegacyRandomSource.LegacyPositionalRandomFactory(long seed)) {
@@ -37,4 +28,15 @@ public final class RandomUtil {
}
throw new IllegalArgumentException();
}
@Contract("null -> fail")
public static @NotNull RandomSource getRandom(PositionalRandomFactory deriver) {
if (deriver instanceof XoroshiroRandomSource.XoroshiroPositionalRandomFactory) {
return new XoroshiroRandomSource(0L, 0L);
}
if (deriver instanceof LegacyRandomSource.LegacyPositionalRandomFactory) {
return new SingleThreadedRandomSource(0L);
}
throw new IllegalArgumentException();
}
}

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.util;
package com.ishland.flowsched.util;
public final class Assertions {
public static void assertTrue(boolean value, String message) {

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.util;
package gg.pufferfish.pufferfish.util;
import it.unimi.dsi.fastutil.PriorityQueue;
import it.unimi.dsi.fastutil.PriorityQueues;
@@ -10,14 +10,14 @@ import org.bxteam.divinemc.spark.ThreadDumperRegistry;
import java.util.NoSuchElementException;
import java.util.concurrent.locks.LockSupport;
public class AsyncProcessor implements Runnable {
private static final Logger LOGGER = LogManager.getLogger(AsyncProcessor.class);
public class AsyncExecutor implements Runnable {
private static final Logger LOGGER = LogManager.getLogger(AsyncExecutor.class);
public final Thread thread;
private final PriorityQueue<Runnable> jobs = PriorityQueues.synchronize(new ObjectArrayFIFOQueue<>());
private volatile boolean killswitch = false;
public AsyncProcessor(String threadName) {
public AsyncExecutor(String threadName) {
this.thread = Thread.ofPlatform()
.name(threadName)
.priority(Thread.NORM_PRIORITY - 1)

View File

@@ -4,7 +4,6 @@ import io.papermc.paper.ServerBuildInfo;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
import net.minecraft.SharedConstants;
import net.minecraft.server.Eula;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.Main;
import org.slf4j.Logger;
@@ -13,11 +12,8 @@ import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
@SuppressWarnings("DuplicatedCode")
public class DivineBootstrap {
private static final Logger LOGGER = LoggerFactory.getLogger("DivineBootstrap");

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.server.network;
package org.bxteam.divinemc.async;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import net.minecraft.server.MinecraftServer;
@@ -19,14 +19,9 @@ public class AsyncJoinHandler {
public static ExecutorService JOIN_EXECUTOR;
private static boolean enabled = false;
private static int threadCount = 2;
/**
* Initialize the AsyncJoinHandler with configuration settings
*/
public static void init(boolean enabled, int threadCount) {
AsyncJoinHandler.enabled = enabled;
AsyncJoinHandler.threadCount = Math.max(1, threadCount);
if (enabled) {
if (JOIN_EXECUTOR != null) {
@@ -50,13 +45,6 @@ public class AsyncJoinHandler {
}
}
/**
* Execute a potentially blocking task asynchronously
*
* @param task The task to run asynchronously
* @param callback The callback to execute on the main thread when the task completes
* @param <T> The return type of the task
*/
public static <T> void runAsync(Supplier<T> task, java.util.function.Consumer<T> callback) {
if (!enabled || JOIN_EXECUTOR == null) {
T result = task.get();
@@ -74,11 +62,6 @@ public class AsyncJoinHandler {
});
}
/**
* Execute a potentially blocking task asynchronously without a result
*
* @param asyncTask The task to run asynchronously
*/
public static void runAsync(Runnable asyncTask) {
if (!enabled || JOIN_EXECUTOR == null) {
asyncTask.run();
@@ -93,9 +76,6 @@ public class AsyncJoinHandler {
});
}
/**
* Get the executor service for async join operations
*/
public static Executor getExecutor() {
return enabled && JOIN_EXECUTOR != null ? JOIN_EXECUTOR : Runnable::run;
}

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.entity.pathfinding;
package org.bxteam.divinemc.async.pathfinding;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.entity.pathfinding;
package org.bxteam.divinemc.async.pathfinding;
import ca.spottedleaf.moonrise.common.util.TickThread;
import net.minecraft.server.MinecraftServer;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.entity.pathfinding;
package org.bxteam.divinemc.async.pathfinding;
import net.minecraft.world.level.pathfinder.NodeEvaluator;
import org.apache.commons.lang3.Validate;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.entity.pathfinding;
package org.bxteam.divinemc.async.pathfinding;
import net.minecraft.world.level.pathfinder.NodeEvaluator;
import net.minecraft.world.level.pathfinder.SwimNodeEvaluator;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.entity.pathfinding;
package org.bxteam.divinemc.async.pathfinding;
import net.minecraft.world.level.pathfinder.NodeEvaluator;
import org.jetbrains.annotations.NotNull;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.entity.pathfinding;
package org.bxteam.divinemc.async.pathfinding;
import net.minecraft.world.level.pathfinder.*;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.entity.pathfinding;
package org.bxteam.divinemc.async.pathfinding;
public enum PathProcessState {
WAITING,

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.entity.pathfinding;
package org.bxteam.divinemc.async.pathfinding;
import org.bxteam.divinemc.config.DivineConfig;
import java.util.Locale;

View File

@@ -1,4 +1,4 @@
package org.bxteam.divinemc.entity.tracking;
package org.bxteam.divinemc.async.tracking;
import ca.spottedleaf.moonrise.common.list.ReferenceList;
import ca.spottedleaf.moonrise.common.misc.NearbyPlayers;

View File

@@ -1,13 +1,14 @@
package org.bxteam.divinemc.server;
package org.bxteam.divinemc.async.world;
import ca.spottedleaf.moonrise.common.util.TickThread;
import org.bxteam.divinemc.spark.ThreadDumperRegistry;
import java.util.concurrent.ThreadFactory;
public class ServerLevelTickExecutorThreadFactory implements ThreadFactory {
public class ServerLevelTickThreadFactory implements ThreadFactory {
private final String worldName;
public ServerLevelTickExecutorThreadFactory(String worldName) {
public ServerLevelTickThreadFactory(String worldName) {
this.worldName = worldName;
ThreadDumperRegistry.REGISTRY.add(worldName + " - ServerLevel Tick Worker");
}

View File

@@ -0,0 +1,7 @@
package org.bxteam.divinemc.async.world;
public enum TeleportState {
INACTIVE,
PENDING,
CANCELLED
}

View File

@@ -10,10 +10,10 @@ import org.apache.logging.log4j.Logger;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.MemoryConfiguration;
import org.bxteam.divinemc.config.annotations.Experimental;
import org.bxteam.divinemc.entity.pathfinding.PathfindTaskRejectPolicy;
import org.bxteam.divinemc.async.pathfinding.PathfindTaskRejectPolicy;
import org.bxteam.divinemc.region.EnumRegionFileExtension;
import org.bxteam.divinemc.region.type.LinearRegionFile;
import org.bxteam.divinemc.server.network.AsyncJoinHandler;
import org.bxteam.divinemc.async.AsyncJoinHandler;
import org.jetbrains.annotations.Nullable;
import org.simpleyaml.configuration.comments.CommentType;
import org.simpleyaml.configuration.file.YamlFile;

View File

@@ -1,7 +0,0 @@
package org.bxteam.divinemc.dfc.common.ducks;
import org.bxteam.divinemc.dfc.common.util.ArrayCache;
public interface IArrayCacheCapable {
ArrayCache c2me$getArrayCache();
}

View File

@@ -3,9 +3,9 @@ package org.bxteam.divinemc.util;
import net.minecraft.server.MinecraftServer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bxteam.divinemc.entity.pathfinding.AsyncPathProcessor;
import org.bxteam.divinemc.entity.tracking.MultithreadedTracker;
import org.bxteam.divinemc.server.network.AsyncJoinHandler;
import org.bxteam.divinemc.async.pathfinding.AsyncPathProcessor;
import org.bxteam.divinemc.async.tracking.MultithreadedTracker;
import org.bxteam.divinemc.async.AsyncJoinHandler;
import java.util.concurrent.TimeUnit;
@SuppressWarnings("ConstantValue")

View File

@@ -1,7 +0,0 @@
package org.bxteam.divinemc.util;
public enum PWTTeleportState {
INACTIVE,
PENDING,
CANCELLED
}