aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/1000-Entity-Activation-Range-2.0.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/1000-Entity-Activation-Range-2.0.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/1000-Entity-Activation-Range-2.0.patch')
-rw-r--r--patches/server/1000-Entity-Activation-Range-2.0.patch14
1 files changed, 7 insertions, 7 deletions
diff --git a/patches/server/1000-Entity-Activation-Range-2.0.patch b/patches/server/1000-Entity-Activation-Range-2.0.patch
index 19faab4d73..321482ab1f 100644
--- a/patches/server/1000-Entity-Activation-Range-2.0.patch
+++ b/patches/server/1000-Entity-Activation-Range-2.0.patch
@@ -17,7 +17,7 @@ Adds villagers as separate config
public net.minecraft.world.entity.Entity isInsidePortal
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index b65927095e36451c53cdae770701a33470eaadbc..19de709c25cfb5a7d1ed810f93d100226d83758f 100644
+index fc011c30628d77d55defe421db6ac194217e8def..975174a2f20e1597ffd2f9d840c77eec3c353b88 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2,7 +2,6 @@ package net.minecraft.server.level;
@@ -28,7 +28,7 @@ index b65927095e36451c53cdae770701a33470eaadbc..19de709c25cfb5a7d1ed810f93d10022
import com.google.common.collect.Lists;
import com.mojang.datafixers.DataFixer;
import com.mojang.datafixers.util.Pair;
-@@ -1163,17 +1162,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1190,17 +1189,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
++TimingHistory.entityTicks; // Paper - timings
// Spigot start
co.aikar.timings.Timing timer; // Paper
@@ -50,7 +50,7 @@ index b65927095e36451c53cdae770701a33470eaadbc..19de709c25cfb5a7d1ed810f93d10022
try {
// Paper end - timings
entity.setOldPosAndRot();
-@@ -1184,9 +1183,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1211,9 +1210,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString();
});
gameprofilerfiller.incrementCounter("tickNonPassenger");
@@ -64,7 +64,7 @@ index b65927095e36451c53cdae770701a33470eaadbc..19de709c25cfb5a7d1ed810f93d10022
Iterator iterator = entity.getPassengers().iterator();
while (iterator.hasNext()) {
-@@ -1194,13 +1197,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1221,13 +1224,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.tickPassenger(entity, entity1);
}
@@ -84,7 +84,7 @@ index b65927095e36451c53cdae770701a33470eaadbc..19de709c25cfb5a7d1ed810f93d10022
passenger.setOldPosAndRot();
++passenger.tickCount;
ProfilerFiller gameprofilerfiller = this.getProfiler();
-@@ -1209,8 +1217,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1236,8 +1244,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
return BuiltInRegistries.ENTITY_TYPE.getKey(passenger.getType()).toString();
});
gameprofilerfiller.incrementCounter("tickPassenger");
@@ -102,7 +102,7 @@ index b65927095e36451c53cdae770701a33470eaadbc..19de709c25cfb5a7d1ed810f93d10022
gameprofilerfiller.pop();
Iterator iterator = passenger.getPassengers().iterator();
-@@ -1220,6 +1237,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1247,6 +1264,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.tickPassenger(passenger, entity2);
}
@@ -340,7 +340,7 @@ index 0b7f52021441d633c37543e8ae485e81c292b747..d7f8464bf3eed0e42a5fc7f14a5b243d
+
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 5ea8f51accdda2387b640d2cff1d6a8baa673bee..3fa8ae3a9afd81bf757ee1e183684442444376f4 100644
+index ea81c6e924091bf86ddbc001f9ecdb58c9c3e5b2..c64bb7858345d93e4b2e65404ffdaffde8458c0f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -156,6 +156,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl