Compare commits

...

22 Commits

Author SHA1 Message Date
Sofiane H. Djerbi
7278888017 Avoid manipulating null paths 2023-08-01 01:58:54 +02:00
Sofiane H. Djerbi
d1a9c55403 Final changes 2023-08-01 00:03:12 +02:00
Sofiane H. Djerbi
29fabdd8f3 Set default queue to 1000 2023-07-31 20:05:22 +02:00
Sofiane H. Djerbi
ae1f11a394 Log async threads for pathfinding 2023-07-31 19:39:12 +02:00
Sofiane H. Djerbi
b45f3843c2 Add NodeEvaluatorType and use it in cache 2023-07-31 18:05:48 +02:00
Sofiane H. Djerbi
8e31fc9945 0 threads if not enabled 2023-07-31 05:12:28 +02:00
Sofiane H. Djerbi
ccd629843c Add thread options & improve thread control 2023-07-31 01:09:51 +02:00
Sofiane H. Djerbi
ada5265608 Fix TargetGoal autism 2023-07-30 23:05:19 +02:00
Sofiane H. Djerbi
f508c9cd84 Remove redundant isDone call (Raise exception) 2023-07-30 20:20:35 +02:00
Sofiane H. Djerbi
e6c765ef71 Add async pathfinding to warden 2023-07-30 18:19:31 +02:00
Sofiane H. Djerbi
cb1b2a78ac Add processing check back 2023-07-30 02:22:58 +02:00
Sofiane H. Djerbi
ad43ef6000 Add async pathfinding to WaterBound mobs & Strider 2023-07-29 22:57:38 +02:00
Sofiane H. Djerbi
eb571af123 Rework nodeEvaluatorGenerator cache 2023-07-29 22:24:44 +02:00
Sofiane H. Djerbi
9925aa59c7 Rebase nodeEvaluatorGenerator 2023-07-29 16:28:11 +02:00
Sofiane H. Djerbi
2dc38b4f88 [skip ci] credit peaches94 2023-07-25 02:51:21 +03:00
Sofiane H. Djerbi
4401555131 Fix mob in the water issue 2023-07-25 02:39:58 +03:00
Sofiane H. Djerbi
6da53043d4 Use the correct thread context to postprocess path 2023-07-25 02:28:47 +03:00
Sofiane H. Djerbi
ea1493dd8f Use local pool 2023-07-24 23:30:21 +03:00
Sofiane H. Djerbi
e18e9091fb Base asyncpathprocessing patch from petal 2023-07-24 21:08:06 +03:00
kugge
40d552627b Update Upstream (Folia) 2023-07-13 20:04:49 +02:00
Sofiane H. Djerbi
6b0aab7b0b Keep velocity on high velocity teleport async 2023-07-13 03:07:29 +03:00
Sofiane H. Djerbi
3ca4adc05e Simple toggle for pog cannons
Don't touch that unless you know what is a pog cannon!
2023-07-10 16:10:03 +03:00
3 changed files with 1312 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ group = dev.kaiijumc.kaiiju
version = 1.20.1-R0.1-SNAPSHOT version = 1.20.1-R0.1-SNAPSHOT
mcVersion = 1.20.1 mcVersion = 1.20.1
foliaRef = b5fc6d0a12b44dafff126c1a52af727bbb9cf1eb foliaRef = daacd4255022f3a1bf74dd3e84f751be838678ac
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

View File

@@ -6,11 +6,30 @@ Subject: [PATCH] Teleport async if we cannot move entity off-main
Entities with huge velocity (100k+ velocity anarchy travel exploit) might disappear / crash the server because they travel a region each tick. Entities with huge velocity (100k+ velocity anarchy travel exploit) might disappear / crash the server because they travel a region each tick.
TODO: Entities with huge velocity still throw stacktraces because they are ticked in "null" regions. TODO: Entities with huge velocity still throw stacktraces because they are ticked in "null" regions.
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index e2fb7d7a7b3126d386b46442c115085d1974ac4e..44f5540a6a5733cf6f10f6b04fc9611ac4e53685 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -169,6 +169,7 @@ public class KaiijuWorldConfig {
public boolean fixTripWireStateInconsistency = true;
public boolean safeTeleporting = true;
public boolean sandDuplication = false;
+ public boolean teleportAsyncOnHighVelocity = false;
private void gameplaySettings() {
fixVoidTrading = getBoolean("gameplay.fix-void-trading", fixVoidTrading);
@@ -176,5 +177,6 @@ public class KaiijuWorldConfig {
fixTripWireStateInconsistency = getBoolean("gameplay.fix-tripwire-state-inconsistency", fixTripWireStateInconsistency);
safeTeleporting = getBoolean("gameplay.safe-teleportation", safeTeleporting);
sandDuplication = getBoolean("gameplay.sand-duplication", sandDuplication);
+ teleportAsyncOnHighVelocity = getBoolean("gameplay.teleport-async-on-high-velocity", teleportAsyncOnHighVelocity);
}
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 135573308662845ecc73fde1c620345e1f372538..3a8684ce5820dd766237ead4ba030f735e1484df 100644 index 135573308662845ecc73fde1c620345e1f372538..812b2c216003b8decedef1353acab1b44d146e08 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1126,7 +1126,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1126,7 +1126,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
} }
@@ -18,18 +37,20 @@ index 135573308662845ecc73fde1c620345e1f372538..3a8684ce5820dd766237ead4ba030f73
this.setPos(this.getX() + vec3d1.x, this.getY() + vec3d1.y, this.getZ() + vec3d1.z); this.setPos(this.getX() + vec3d1.x, this.getY() + vec3d1.y, this.getZ() + vec3d1.z);
+ // Kaiiju start - Teleport async if we cannot move entity off-main + // Kaiiju start - Teleport async if we cannot move entity off-main
+ } catch (IllegalStateException e) { + } catch (IllegalStateException e) {
+ if (this.level().kaiijuConfig.teleportAsyncOnHighVelocity)
+ this.teleportAsync((ServerLevel) this.level(), this.position().add(vec3d1), + this.teleportAsync((ServerLevel) this.level(), this.position().add(vec3d1),
+ this.getYRot(), this.getXRot(), + this.getYRot(), this.getXRot(),
+ Vec3.ZERO, PlayerTeleportEvent.TeleportCause.UNKNOWN, + null, PlayerTeleportEvent.TeleportCause.UNKNOWN,
+ Entity.TELEPORT_FLAG_LOAD_CHUNK | Entity.TELEPORT_FLAG_TELEPORT_PASSENGERS, + Entity.TELEPORT_FLAG_LOAD_CHUNK | Entity.TELEPORT_FLAG_TELEPORT_PASSENGERS,
+ null + null
+ ); + );
+ else LOGGER.error("High velocity entity caused off-main setPos: ", e);
+ } + }
+ // Kaiiju end + // Kaiiju end
} }
this.level().getProfiler().pop(); this.level().getProfiler().pop();
@@ -3868,13 +3879,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -3868,13 +3881,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
// check for same region // check for same region
if (destination == this.level()) { if (destination == this.level()) {
Vec3 currPos = this.position(); Vec3 currPos = this.position();

File diff suppressed because it is too large Load Diff