Compare commits

..

19 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
10 changed files with 1344 additions and 67 deletions

View File

@@ -11,14 +11,13 @@
## Features
### Notable
- **Xymb Linear Format**: A Region file format that reduces disk space usage by about 50%.
- **Async Pathfinding**: Petal async pathfinding fixed & reworked.
- **Technical Minecraft**: Enable Vanilla exploits such as sand duping, RNG manipulation...
### Primary
- **Xymb Linear Format**: Saves about 50% of disk space in OW/Nether and 95% in The End.
- **Auto update**: Automatic upstream updates.
### Other
- **Small optimizations**: Increase server efficiency by disabling unnecessary features.
- **Commands**: Restore few commands that were previously removed by Folia.
### Notable
- **Entity throttling & removal**: Tweak entity tick frequency & max entity per region.
- **Technical Minecraft**: Enable Vanilla exploits such as sand duping, RNG manipulation...
### Configuration
@@ -26,50 +25,42 @@
network:
send-null-entity-packets: true
alternate-keepalive: false
kick-player-on-bad-packet: true
gameplay:
server-mod-name: Kaiiju
shared-random-for-players: true
optimization:
disable-vanish-api: false
disable-player-stats: false
disable-arm-swing-event: false
disable-ensure-tick-thread-checks: false
async-path-processing: false
region-format:
debug: false
gameplay:
server-mod-name: Kaiiju
shared-random-for-players: true
world-settings:
default:
gameplay:
fix-void-trading: true
break-redstone-on-top-of-trap-doors-early: true
fix-tripwire-state-inconsistency: true
safe-teleportation: true
sand-duplication: false
teleport-async-on-high-velocity: false
optimization:
shulker-box-drop-contents-when-destroyed: true
optimize-hoppers: true
tick-when-empty: true
enable-entity-throttling: false
disable-achievements: false
disable-creatures-spawn-events: false
disable-dolphin-swim-to-treasure: false
region-format:
format: ANVIL
linear:
compression-level: 1
crash-on-broken-symlink: true
optimization:
shulker-box-drop-contents-when-destroyed: true
enable-entity-throttling: false
disable-achievements: false
disable-creatures-spawn-events: false
disable-dolphin-swim-to-treasure: false
gameplay:
fix-void-trading: true
optimize-hoppers: true
tick-when-empty: true
break-redstone-on-top-of-trap-doors-early: true
fix-tripwire-state-inconsistency: true
safe-teleportation: true
sand-duplication: false
```
Documentation: [Kaiiju Wiki](https://github.com/KaiijuMC/Kaiiju/wiki/Configuration)
### Roadmap
- **Stash deduplication**: Make giant dupe stashes possible and lagless.
- **Multithreaded Tracker**: Rework Petal multithreaded tracker.
## Open to contributions
- **Static view distance**: Reduce RAM usage / Region size with a "static" view distance.
- **Native world conversion**: Convert region file format at startup.
- **Performance patch**: Any significative performance patch.
- **Stash deduplication**: Make giant dupe stashes possible and lagless.
## Building

View File

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

View File

@@ -587,10 +587,10 @@ index 25fe439c8d1e88a86e85ac9a4761425d98ee6c4f..c4d28d887b4cc71dc713b1e3f46bc80f
regionFile.setStatus(chunkPos.x, chunkPos.z, ChunkSerializer.getStatus(compound));
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index cf8f93734121e5c1959959f0ba13ee4e6db31959..4c587f783f4c2207e4e1a1f4596c8f50e997d541 100644
index 042ca6b3faae5249210567f2c26dff404974e1ff..7099a44a2322ab390c21e74668c8657dcc9e5e87 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -453,8 +453,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -426,8 +426,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
private static final class EntityRegionFileStorage extends net.minecraft.world.level.chunk.storage.RegionFileStorage {
@@ -601,7 +601,7 @@ index cf8f93734121e5c1959959f0ba13ee4e6db31959..4c587f783f4c2207e4e1a1f4596c8f50
}
protected void write(ChunkPos pos, net.minecraft.nbt.CompoundTag nbt) throws IOException {
@@ -693,7 +693,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -666,7 +666,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit end
boolean flag2 = minecraftserver.forceSynchronousWrites();
DataFixer datafixer = minecraftserver.getFixerUpper();

View File

@@ -42,7 +42,7 @@ index abf5e2a06af9853b58ac9107cd6e9787c4185c66..389c68c0becd2f69dc1004d0b383f1a8
long expectedChunks = (long)regionFiles.length * (32L * 32L);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index c4d28d887b4cc71dc713b1e3f46bc80f4484a95d..f50507ab85282d261985ce9b186581f5a7a50f79 100644
index 61c6bc2859235874aefac71e9e55162f0a89f29f..24bd63c596c9f61f1e89ec5b001b7cb7a29a09ff 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -269,7 +269,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -64,10 +64,10 @@ index c4d28d887b4cc71dc713b1e3f46bc80f4484a95d..f50507ab85282d261985ce9b186581f5
// Paper start
this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 4c587f783f4c2207e4e1a1f4596c8f50e997d541..ad896c8a3060f5c8d85a8b5707317de646bf9cae 100644
index 4774d3f357d62b0818b4713f8085d05be09eaa5c..1bbd8b475cdc57fb15ca05ffe122220a5539da10 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -453,8 +453,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -426,8 +426,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
private static final class EntityRegionFileStorage extends net.minecraft.world.level.chunk.storage.RegionFileStorage {
@@ -78,7 +78,7 @@ index 4c587f783f4c2207e4e1a1f4596c8f50e997d541..ad896c8a3060f5c8d85a8b5707317de6
}
protected void write(ChunkPos pos, net.minecraft.nbt.CompoundTag nbt) throws IOException {
@@ -693,7 +693,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -666,7 +666,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit end
boolean flag2 = minecraftserver.forceSynchronousWrites();
DataFixer datafixer = minecraftserver.getFixerUpper();

View File

@@ -22,10 +22,10 @@ index f3f824d0ab1a2a72825c40b67192386479a0b34c..95ed6cb7b94797187d1011cab344e187
}
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index ad896c8a3060f5c8d85a8b5707317de646bf9cae..0df4672abb5e87587da8712b6febf6312e241cda 100644
index 1bbd8b475cdc57fb15ca05ffe122220a5539da10..7f39e36037d55278d15399196459e51b885c5d1e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2865,7 +2865,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2838,7 +2838,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
// Paper start

View File

@@ -22,10 +22,10 @@ index 6d7356cc07da58b1cef8d8963e790251d765de2c..601b9867d839f4928ba993ee8f00df9c
public boolean fixVoidTrading = true;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 0df4672abb5e87587da8712b6febf6312e241cda..1818c5ae88c331fb900470436f72049165c9e9f4 100644
index 7f39e36037d55278d15399196459e51b885c5d1e..66509fa23bfcde70abd3917eb774cf48d5d6da93 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -825,7 +825,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -798,7 +798,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
timings.doSounds.stopTiming(); // Spigot
regionizedWorldData.setHandlingTick(false); // Folia - regionised ticking
gameprofilerfiller.pop();

View File

@@ -319,10 +319,10 @@ index 991e4c19763a34a6fead88363e007c2d11aad836..24a2d3f496727790f63cb66a2534d442
dev.kaiijumc.kaiiju.KaiijuConfig.registerCommands();
// Kaiiju end
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 1818c5ae88c331fb900470436f72049165c9e9f4..7938ce423422c1a2cb72a9b2e45c7bbb6f20ec91 100644
index 245c3e63588379f51780963ba91bc6bf0a3feda6..761019f86983daaea4fface519e052f8fb6de1cd 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -849,6 +849,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -822,6 +822,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} // Folia end - region threading
}
@@ -330,7 +330,7 @@ index 1818c5ae88c331fb900470436f72049165c9e9f4..7938ce423422c1a2cb72a9b2e45c7bbb
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
timings.entityTick.startTiming(); // Spigot
regionizedWorldData.forEachTickingEntity((entity) -> { // Folia - regionised ticking
@@ -871,6 +872,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -844,6 +845,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.stopRiding();
}
@@ -344,7 +344,7 @@ index 1818c5ae88c331fb900470436f72049165c9e9f4..7938ce423422c1a2cb72a9b2e45c7bbb
gameprofilerfiller.push("tick");
this.guardEntityTick(this::tickNonPassenger, entity);
gameprofilerfiller.pop();
@@ -878,6 +886,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -851,6 +859,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
});

View File

@@ -21,10 +21,10 @@ index f49510c999ce5241f26dc9ba90a6148bf31467c7..b23f2df433d7ebc871f4009081c28ed9
public static String serverModName = "Kaiiju";
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index febd0ba72922462364eb65243640dcb693129e21..428da29b343eea9df25e5d719d5162faf0d9d7e5 100644
index 817f79bfca1aec161cb4635b9c7a8e21b14db7eb..bba90683202b47284208416a37724e9d54266ffa 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2139,6 +2139,7 @@ public class ServerPlayer extends Player {
@@ -2081,6 +2081,7 @@ public class ServerPlayer extends Player {
@Override
public void awardStat(Stat<?> stat, int amount) {

View File

@@ -24,10 +24,10 @@ index 9f0095f2196133a8bcffd5306aa9ac0b99b2f8d7..31d66bb2fcf4bb7262df2d8006e307fe
public boolean fixVoidTrading = true;
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b970de567aa 100644
index bba90683202b47284208416a37724e9d54266ffa..6bbbd7d4a409140df65f52f36e413c67ebac5561 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -792,7 +792,7 @@ public class ServerPlayer extends Player {
@@ -734,7 +734,7 @@ public class ServerPlayer extends Player {
@Override
protected void onInsideBlock(BlockState state) {
@@ -36,7 +36,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
}
@Override
@@ -839,9 +839,9 @@ public class ServerPlayer extends Player {
@@ -781,9 +781,9 @@ public class ServerPlayer extends Player {
}
}
@@ -48,7 +48,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
}
this.trackStartFallingPosition();
@@ -916,7 +916,7 @@ public class ServerPlayer extends Player {
@@ -858,7 +858,7 @@ public class ServerPlayer extends Player {
}
if (this.tickCount % 20 == 0) {
@@ -57,7 +57,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
}
// CraftBukkit start - initialize oldLevel, fire PlayerLevelChangeEvent, and tick client-sided world border
@@ -945,7 +945,7 @@ public class ServerPlayer extends Player {
@@ -887,7 +887,7 @@ public class ServerPlayer extends Player {
@Override
public void resetFallDistance() {
if (this.getHealth() > 0.0F && this.startingToFallPosition != null) {
@@ -66,7 +66,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
}
this.startingToFallPosition = null;
@@ -964,7 +964,7 @@ public class ServerPlayer extends Player {
@@ -906,7 +906,7 @@ public class ServerPlayer extends Player {
if (this.enteredLavaOnVehiclePosition == null) {
this.enteredLavaOnVehiclePosition = this.position();
} else {
@@ -75,7 +75,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
}
}
@@ -1168,7 +1168,7 @@ public class ServerPlayer extends Player {
@@ -1110,7 +1110,7 @@ public class ServerPlayer extends Player {
this.handleTeamKill(s, s1, ObjectiveCriteria.TEAM_KILL);
this.handleTeamKill(s1, s, ObjectiveCriteria.KILLED_BY_TEAM);
@@ -84,7 +84,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
}
}
@@ -1286,7 +1286,7 @@ public class ServerPlayer extends Player {
@@ -1228,7 +1228,7 @@ public class ServerPlayer extends Player {
this.wonGame = false;
this.respawn((player) -> {
@@ -93,7 +93,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
}, true);
}
@@ -1788,14 +1788,14 @@ public class ServerPlayer extends Player {
@@ -1730,14 +1730,14 @@ public class ServerPlayer extends Player {
maindimensionkey1 = resourcekey1;
}
// Paper end
@@ -111,7 +111,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
}
if (maindimensionkey1 != Level.NETHER) { // CraftBukkit
@@ -1873,7 +1873,7 @@ public class ServerPlayer extends Player {
@@ -1815,7 +1815,7 @@ public class ServerPlayer extends Player {
{
Either<Player.BedSleepingProblem, Unit> either = super.startSleepInBed(blockposition, force).ifRight((unit) -> {
this.awardStat(Stats.SLEEP_IN_BED);
@@ -120,7 +120,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
});
if (!this.serverLevel().canSleepThroughNights()) {
@@ -2159,7 +2159,7 @@ public class ServerPlayer extends Player {
@@ -2101,7 +2101,7 @@ public class ServerPlayer extends Player {
@Override
public void triggerRecipeCrafted(Recipe<?> recipe, List<ItemStack> ingredients) {
@@ -129,7 +129,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
}
@Override
@@ -2288,14 +2288,14 @@ public class ServerPlayer extends Player {
@@ -2230,14 +2230,14 @@ public class ServerPlayer extends Player {
this.levitationStartPos = this.position();
}
@@ -146,7 +146,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
}
@Override
@@ -2306,7 +2306,7 @@ public class ServerPlayer extends Player {
@@ -2248,7 +2248,7 @@ public class ServerPlayer extends Player {
this.levitationStartPos = null;
}
@@ -155,7 +155,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
}
@Override
@@ -2866,7 +2866,7 @@ public class ServerPlayer extends Player {
@@ -2808,7 +2808,7 @@ public class ServerPlayer extends Player {
@Override
protected void updateUsingItem(ItemStack stack) {
@@ -164,7 +164,7 @@ index 428da29b343eea9df25e5d719d5162faf0d9d7e5..ad5830f419321e0f901d58a18bba7b97
super.updateUsingItem(stack);
}
@@ -2895,7 +2895,7 @@ public class ServerPlayer extends Player {
@@ -2837,7 +2837,7 @@ public class ServerPlayer extends Player {
Entity entity = item.getOwner();
if (entity != null) {

File diff suppressed because it is too large Load Diff