aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/1002-Anti-Xray.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2024-07-03 19:22:00 -0700
committerSpottedleaf <[email protected]>2024-07-03 19:22:43 -0700
commit8c8b227547fa78b8f3295e4ac8ee066777e04e98 (patch)
tree75de944d628f7c26af3f5752549a745c24d6f810 /patches/server/1002-Anti-Xray.patch
parent7eec21e80da15cb4b6fcb445910006e115729682 (diff)
downloadPaper-8c8b227547fa78b8f3295e4ac8ee066777e04e98.tar.gz
Paper-8c8b227547fa78b8f3295e4ac8ee066777e04e98.zip
Execute chunk tasks mid-tick
If the server tick length is high, then the amount of time available to process chunk tasks inbetween ticks is low. As a result, chunk loading and generation may appear to slow down. To ensure that chunk tasks are always processed, we add logic to execute chunk tasks during tile entity tick, entity tick, chunk random ticking, and scheduled block/fluid ticking. The mid-tick task execution is timed so that it is not prioritised over the server tick.
Diffstat (limited to 'patches/server/1002-Anti-Xray.patch')
-rw-r--r--patches/server/1002-Anti-Xray.patch12
1 files changed, 6 insertions, 6 deletions
diff --git a/patches/server/1002-Anti-Xray.patch b/patches/server/1002-Anti-Xray.patch
index 249d9e10fd..f4b57bf98b 100644
--- a/patches/server/1002-Anti-Xray.patch
+++ b/patches/server/1002-Anti-Xray.patch
@@ -1104,10 +1104,10 @@ index 183b2191fa1c1b27adedf39593e1b5a223fb1279..8ead66c134688b11dca15f6509147e72
private ClientboundLevelChunkWithLightPacket(RegistryFriendlyByteBuf buf) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 19de709c25cfb5a7d1ed810f93d100226d83758f..a463cdd3b9dbda64d52c86223e1f2e1164deac80 100644
+index 975174a2f20e1597ffd2f9d840c77eec3c353b88..8daa490817367391cac5c9852e0755b280fb9054 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -501,7 +501,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -518,7 +518,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
@@ -1168,7 +1168,7 @@ index 9b1a6d8351fb473eec75a2fd08fb892b770e3586..0d0b07c9199be9ca0d5ac3feb1d44f14
}
// Paper end - Send empty chunk
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 3fa8ae3a9afd81bf757ee1e183684442444376f4..392032d749b8a9077b61f4e1c5e413de048c7067 100644
+index c64bb7858345d93e4b2e65404ffdaffde8458c0f..4994b964819600604cb123d4cf7ec27978796bb8 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -171,6 +171,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1179,7 +1179,7 @@ index 3fa8ae3a9afd81bf757ee1e183684442444376f4..392032d749b8a9077b61f4e1c5e413de
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPos lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter;
-@@ -257,7 +258,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
+@@ -262,7 +263,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
// Paper end - rewrite chunk system
@@ -1188,7 +1188,7 @@ index 3fa8ae3a9afd81bf757ee1e183684442444376f4..392032d749b8a9077b61f4e1c5e413de
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
this.generator = gen;
-@@ -340,6 +341,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
+@@ -345,6 +346,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
this.entityLookup = new ca.spottedleaf.moonrise.patches.chunk_system.level.entity.dfl.DefaultEntityLookup(this); // Paper - rewrite chunk system
@@ -1196,7 +1196,7 @@ index 3fa8ae3a9afd81bf757ee1e183684442444376f4..392032d749b8a9077b61f4e1c5e413de
}
// Paper start - Cancel hit for vanished players
-@@ -617,6 +619,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
+@@ -622,6 +624,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
// CraftBukkit end
BlockState iblockdata1 = chunk.setBlockState(pos, state, (flags & 64) != 0, (flags & 1024) == 0); // CraftBukkit custom NO_PLACE flag