Update Paper

Additionally, fix ActivationRange using global state to store
the AABBs it checks entities against. This fixes an issue where
entities would not be activated when they should be.
This commit is contained in:
Spottedleaf 2024-01-20 20:33:21 -08:00
parent 27561750dd
commit 7bc26ecc74
12 changed files with 506 additions and 454 deletions

View File

@ -2,7 +2,7 @@ group=dev.folia
version=1.20.4-R0.1-SNAPSHOT version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4 mcVersion=1.20.4
paperRef=07b956e3a30d9cd192111829b59bdf4372f128b1 paperRef=4a98986e2881439fc018d847df2808e2f17f3a7d
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 58da26ad2f128ba0b66f86820f60853f4be352f0..38352926640d97449256d50ebdec619ce9e695a0 100644 index 376e8983fdfdbb6c3e5fd8ad0f6a05e655b622bf..959e62d800de05b2dd77a252f442c3daf8438490 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { @@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
@ -23,7 +23,7 @@ index 58da26ad2f128ba0b66f86820f60853f4be352f0..38352926640d97449256d50ebdec619c
// Paper start // Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0") implementation("net.minecrell:terminalconsoleappender:1.3.0")
@@ -70,7 +74,7 @@ tasks.jar { @@ -69,7 +73,7 @@ tasks.jar {
attributes( attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main", "Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit", "Implementation-Title" to "CraftBukkit",
@ -32,7 +32,7 @@ index 58da26ad2f128ba0b66f86820f60853f4be352f0..38352926640d97449256d50ebdec619c
"Implementation-Vendor" to date, // Paper "Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit", "Specification-Title" to "Bukkit",
"Specification-Version" to project.version, "Specification-Version" to project.version,
@@ -154,7 +158,7 @@ fun TaskContainer.registerRunTask( @@ -153,7 +157,7 @@ fun TaskContainer.registerRunTask(
name: String, name: String,
block: JavaExec.() -> Unit block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) { ): TaskProvider<JavaExec> = register<JavaExec>(name) {
@ -93,10 +93,10 @@ index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..e2f704c115fd6e00960bb56bb0779f11
).openBufferedStream()) { ).openBufferedStream()) {
JsonObject json = new Gson().fromJson(reader, JsonObject.class); JsonObject json = new Gson().fromJson(reader, JsonObject.class);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 34f19ac897a30c0c4e3ab406013fcca1c8b7db93..5ed6c8710b78458031ed6b0273fb2f6a5f482ea7 100644 index 24430f9bf1b641a84e79b4b9b2e0ac5d16681ada..c7498b4ec41f0ae56530b948bd04c892a0f6d4a7 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1866,7 +1866,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1852,7 +1852,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate @DontObfuscate
public String getServerModName() { public String getServerModName() {
@ -106,7 +106,7 @@ index 34f19ac897a30c0c4e3ab406013fcca1c8b7db93..5ed6c8710b78458031ed6b0273fb2f6a
public SystemReport fillSystemReport(SystemReport details) { public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 142d2c48239d4ebe3896218536656d116cd24d7c..d0bddf66a8cbf1cd1348cc40ef8bbc125b7483ed 100644 index eb617d659c701e512aac8a1ff822c147b69d3a3b..3b133cd19c0cceeb78f58d36de817b699cc59884 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -264,7 +264,7 @@ import javax.annotation.Nullable; // Paper @@ -264,7 +264,7 @@ import javax.annotation.Nullable; // Paper

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Max pending logins
Should help the floodgates on launch Should help the floodgates on launch
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 5834d5e10c0b9892f29977666e7b168a9463a3d9..5bac302f6aab2c61cba87ea3e32a260eeb0284b4 100644 index 586027a4c97a3c1be42f1c8d5a248e2672bb6489..d809dd5f6aa39fcd7583d7db822450297225eb49 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -89,7 +89,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -89,7 +89,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@ -19,7 +19,7 @@ index 5834d5e10c0b9892f29977666e7b168a9463a3d9..5bac302f6aab2c61cba87ea3e32a260e
if (this.state == ServerLoginPacketListenerImpl.State.WAITING_FOR_DUPE_DISCONNECT && !this.isPlayerAlreadyInWorld((GameProfile) Objects.requireNonNull(this.authenticatedProfile))) { if (this.state == ServerLoginPacketListenerImpl.State.WAITING_FOR_DUPE_DISCONNECT && !this.isPlayerAlreadyInWorld((GameProfile) Objects.requireNonNull(this.authenticatedProfile))) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 184057aae74e8918bf05ab03429cb0419ae9ba06..eb797313a13b5a805f834b2e9f08989e381f0761 100644 index 8284cde1984408a97a933f4299ad8541e7a015ca..739e8966c7326edf47e85f959374cbc8970d7b2a 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -171,6 +171,17 @@ public abstract class PlayerList { @@ -171,6 +171,17 @@ public abstract class PlayerList {

View File

@ -29,10 +29,10 @@ index 41bf71d116ffc5431586ce54abba7f8def6c1dcf..519da6886613b8460e989767b1a21e31
} }
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 630d668dddc6dfc8a3b6dd0b021ad605ef20856f..0a060023da8c1ca1e4a0646e94170c8f489f48b1 100644 index 1ee49570e9c3250d1d3ce0420a0a0c94cda717fe..cc4eb106b3ff1953de11f1faa7c04f3f9982fca2 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
@@ -2917,6 +2917,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2919,6 +2919,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (!force && (!this.canRide(entity) || !entity.canAddPassenger(this))) { if (!force && (!this.canRide(entity) || !entity.canAddPassenger(this))) {
return false; return false;
} else { } else {
@ -40,15 +40,15 @@ index 630d668dddc6dfc8a3b6dd0b021ad605ef20856f..0a060023da8c1ca1e4a0646e94170c8f
// CraftBukkit start // CraftBukkit start
if (entity.getBukkitEntity() instanceof Vehicle && this.getBukkitEntity() instanceof LivingEntity) { if (entity.getBukkitEntity() instanceof Vehicle && this.getBukkitEntity() instanceof LivingEntity) {
VehicleEnterEvent event = new VehicleEnterEvent((Vehicle) entity.getBukkitEntity(), this.getBukkitEntity()); VehicleEnterEvent event = new VehicleEnterEvent((Vehicle) entity.getBukkitEntity(), this.getBukkitEntity());
@@ -2938,6 +2939,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2940,6 +2941,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (event.isCancelled()) {
return false; return false;
} }
// CraftBukkit end
+ } // Folia - region threading - suppress entire event logic during worldgen + } // Folia - region threading - suppress entire event logic during worldgen
// Spigot end
if (this.isPassenger()) { if (this.isPassenger()) {
this.stopRiding(); this.stopRiding();
@@ -3016,6 +3018,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S }
@@ -3017,6 +3019,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else { } else {
// CraftBukkit start // CraftBukkit start
@ -56,16 +56,16 @@ index 630d668dddc6dfc8a3b6dd0b021ad605ef20856f..0a060023da8c1ca1e4a0646e94170c8f
CraftEntity craft = (CraftEntity) entity.getBukkitEntity().getVehicle(); CraftEntity craft = (CraftEntity) entity.getBukkitEntity().getVehicle();
Entity orig = craft == null ? null : craft.getHandle(); Entity orig = craft == null ? null : craft.getHandle();
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
@@ -3043,6 +3046,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3044,6 +3047,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (event.isCancelled()) {
return false; return false;
} }
// CraftBukkit end
+ } // Folia - region threading - suppress entire event logic during worldgen + } // Folia - region threading - suppress entire event logic during worldgen
// Spigot end
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) { if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
this.passengers = ImmutableList.of(); this.passengers = ImmutableList.of();
} else {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java
index 0f7ae4a5c672039828454bf18c770dd99e250212..df182782756f674e2ce5d8c6add5c23cec8be645 100644 index 236f94348ff8da661e23e3e17b7fc1b143680da9..7d4cdb0c5cd24aee4c831e59836c5bdd0b9ea800 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java --- a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -141,7 +141,7 @@ index 5beaa2bb0d58fe477ce8d2de8b77600d3b416d8c..fa1bc80ae320c6d04acc20d6dec7df52
} }
// Paper end // Paper end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
index 8db2c70d3600555bcb419260cafd56409478b227..50a715cf0c4c87b9a26c57c6eb7e133ae443edd3 100644 index 34e4c763c7ec971885147ab2509281fad56e1ca6..a0a83e9111523a8080f30d0fdd35b9c9373ca359 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
@@ -17,8 +17,16 @@ public class CraftAbstractVillager extends CraftAgeable implements AbstractVilla @@ -17,8 +17,16 @@ public class CraftAbstractVillager extends CraftAgeable implements AbstractVilla
@ -414,7 +414,7 @@ index dd91de8f24c27b9318c2a898a49991d74c100bff..d7c34f601ce66a6b090ec431a0503462
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
index 859f233197ebe738511011e36668c4eb5d4b7d8e..c53af70cd12f0378d697398e090f95b1498f69e7 100644 index 8184a2adf889e02b048ceb015edfc04d1b5c21b9..9165bb2458f2440c6a17dff8da985b60f84796db 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
@@ -102,8 +102,16 @@ public class CraftBoat extends CraftVehicle implements Boat { @@ -102,8 +102,16 @@ public class CraftBoat extends CraftVehicle implements Boat {
@ -456,7 +456,7 @@ index 80e571c977db5cdf43bfbfce035f37a3fa325c95..6fafba37dd7128a397ba046be7b33067
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java
index 0ccc20157fb9fdb9c99b942dcb4675db5f928b23..aa9881552e0ba78d844de105184953c487ad426b 100644 index 42342628227742aa7ee6b84caa0e1f13b498babe..8fa5a33a32ea0c9e5e7f941011612060db8ea826 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java
@@ -16,8 +16,16 @@ public class CraftCat extends CraftTameableAnimal implements Cat { @@ -16,8 +16,16 @@ public class CraftCat extends CraftTameableAnimal implements Cat {
@ -771,7 +771,7 @@ index 676dd5331bec75407a74aea2a89e78ab72d69724..b87d6ccd12323f1760d83365c1bdd1d5
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java
index 6eae6efa35a1ccc224e2f311e25ecf13e8647ec8..e26b538b4bc9ff182974a4323313567ffc66223b 100644 index 7b7b89e67d53ed70efae714192c5fa32977f3d9c..00f334e5449f76b735b844fed44c98725e607db3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java
@@ -30,8 +30,16 @@ public class CraftEnderDragon extends CraftMob implements EnderDragon, CraftEnem @@ -30,8 +30,16 @@ public class CraftEnderDragon extends CraftMob implements EnderDragon, CraftEnem
@ -834,7 +834,7 @@ index 3bb8d74f2b59c7f0c7c1cbde47a570d628ceceb2..83308195a3a55abeb4c28b9cc69dc98e
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java
index 1fb5760681bf0c745f9f3517489a83666a6d6805..8fb76a38ce3b1021e17acf1cc166d8dac3c61410 100644 index 27f56fa4b7ef92a9a4dfa6b782350424b88210f2..d0b2f8abba0eb5e29beccfebcf48f840715b7908 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java
@@ -15,8 +15,16 @@ public class CraftEnderSignal extends CraftEntity implements EnderSignal { @@ -15,8 +15,16 @@ public class CraftEnderSignal extends CraftEntity implements EnderSignal {
@ -897,7 +897,7 @@ index d657fd2c507a5b215aeab0a5f3e9c2ee892a27c8..9fc90b162aab15a9cd60b02aba563181
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 56c7eda0dbfbb8987e1e642936b46e2a320466f7..b3faadd991f6885bfcaf4fd6fa895889670a1bb2 100644 index 1d9e123f5c1bc94f6be08f372c94a2c595a789c6..39cb7a0a58ea24f48f7e621f696f0dbfea229ea3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -490,7 +490,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -490,7 +490,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@ -981,7 +981,7 @@ index 5a7d314ec0562e472f5dc45924a7b24841cff126..4708a11935efe5cb6727f8fc6d4a3cd2
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
index 73911b81f4e927026657953a0c68ddda9a8f93c1..b5384f3f60dd6bba96a59fe60f6fb39fa41a71e6 100644 index 1359d25a32b4a5d5e8e68ce737bd19f7b5afaf69..0be7f84a50b7568d0c639f5906b5ca76347d95fe 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
@@ -14,8 +14,16 @@ public class CraftFallingBlock extends CraftEntity implements FallingBlock { @@ -14,8 +14,16 @@ public class CraftFallingBlock extends CraftEntity implements FallingBlock {
@ -1002,12 +1002,12 @@ index 73911b81f4e927026657953a0c68ddda9a8f93c1..b5384f3f60dd6bba96a59fe60f6fb39f
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
index 774ed1fdc909c911bf93a1b720285b43e9f728b8..f4555fb246cccdeae0498b1ce2f9aa1e4c7afd34 100644 index 1d8aab2fda18c6e2bb30f6ba4a6325263267b628..61ad4e93c01ccdae9cdf4efb08f43959af9aafc4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
@@ -58,8 +58,16 @@ public class CraftFireball extends AbstractProjectile implements Fireball { @@ -58,8 +58,16 @@ public class CraftFireball extends AbstractProjectile implements Fireball {
} }
// Paper end // Paper end - set direction without normalizing
+ // Folia start - region threading + // Folia start - region threading
+ @Override + @Override
@ -1023,11 +1023,11 @@ index 774ed1fdc909c911bf93a1b720285b43e9f728b8..f4555fb246cccdeae0498b1ce2f9aa1e
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
index c13cdbaf7abdf120a3969f8e887b4c3b78989c9c..2f6c4fe06405f8efdc42c9ab43ab4d6a2bb4e2b4 100644 index 1309fabd357eb9b8f90f882ec7ff3de9e60f187d..7a98bcdd7c8a8934431cd50335f941ae79bc5763 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
@@ -37,8 +37,16 @@ public class CraftFirework extends CraftProjectile implements Firework { @@ -37,8 +37,16 @@ public class CraftFirework extends CraftProjectile implements Firework {
// Paper End - Expose firework item directly // Paper end - Expose firework item directly
} }
+ // Folia start - region threading + // Folia start - region threading
@ -1359,7 +1359,7 @@ index 8746f80d08df5501b32958eb123aa7d814573ddf..c6c6eb55f4649e18beef9832c2ea7b9d
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index c3dbcb317b7d366feb31f707ad1199c60169f07f..8f32a00e65254acb4752ae55fee86bc05964c13e 100644 index 827fe201a7b74f485abb46b127a28bf0cb479c3b..bc74382c4b62ba14e655d10c261aada61191733a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -291,8 +291,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -291,8 +291,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@ -1464,7 +1464,7 @@ index 63cae1a2e95d8da17c45c4404a8dd0ca6a413c39..f57139f03da9519802ee156f37691d08
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
index 81498941748d646ebe6495f4a7ce6953532144c6..23ff09abb5f99b0cee2375769004c4f709257e39 100644 index 832def3c518be8d6d81e71f6022566e6179e2d17..725e016dcd8177dcee0f0e1bd345c985fc1e95af 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
@@ -18,8 +18,16 @@ public class CraftItem extends CraftEntity implements Item { @@ -18,8 +18,16 @@ public class CraftItem extends CraftEntity implements Item {
@ -1569,7 +1569,7 @@ index 06fa256c5528af9c1d63fbd044f53b63bed324ee..896d34bd55e308fe322865f8cf7fd077
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
index 70b377c03346cb8573827aeb493f3b6eb8efb1f8..b2e8c26162dd5782a0447cd03ca00fb4583fd442 100644 index e9f471e60af0725ec34e2985d63ae9ea9f88590a..6a443f42ecec16abea3ddf7bc2e85bb8a6af726e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
@@ -41,8 +41,16 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike @@ -41,8 +41,16 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike
@ -1590,7 +1590,7 @@ index 70b377c03346cb8573827aeb493f3b6eb8efb1f8..b2e8c26162dd5782a0447cd03ca00fb4
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 1f1ef68a9a449a4a90c284f34a397ab4b6d905f6..9da62ca03e60c8cbe4714c7056c7642cce2c0b9e 100644 index 4afc1c9d2a7638e84a55fe30932dc36db465c31a..b7be4fd0179a26d220819346457ba097f4c7d22d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -416,6 +416,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -416,6 +416,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@ -2046,7 +2046,7 @@ index 49beb836d2801aadf869feefa602616daebe633f..0de7eadb1cac6979ce7cffd38a3b2508
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
index 03e74b29ebf0f9b9a0dbc6ffc872e22a22be20f0..c7411045c4901b6a66c62d68be911a4d7d1f7a9c 100644 index 5124a383b60b2c8de89fa992547d0c61db760c21..2ba9b61a164c6afed15a0919124c8241d2aebf78 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
@@ -75,8 +75,16 @@ public class CraftPiglin extends CraftPiglinAbstract implements Piglin, com.dest @@ -75,8 +75,16 @@ public class CraftPiglin extends CraftPiglinAbstract implements Piglin, com.dest
@ -2130,7 +2130,7 @@ index 2638c341bc02f201f7ab17fdebcdbdf3a7ec05bf..0f5c2d31a2dea13a46ba81e353393633
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 676f81ae2d5b35788bcda1f74aea7b8a1253602c..f02a72c0589960d2c60e4155b3b9e0ddd22067d8 100644 index 9c9b7728122aaaeb92f565f0c9322f0e3aed947b..003684843c2a9fc709619c1de8cf73dbb1b25c42 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -616,7 +616,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -616,7 +616,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -2675,7 +2675,7 @@ index 9472a6f9c9584048abf1f8d11ab6254b7c7a287d..f2daf0fc0f07d90040887b0cee8f1924
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
index 3f32c683ddc6999b89f2e4051eb6ae784b296b8f..c15141d2ffa4638f251681063e7ecae4186972d8 100644 index dac3d34677688ac560bc1be2087a08479ef71b87..b28221a616613698e6a627d461429cb1f91d738b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
@@ -42,8 +42,16 @@ public class CraftTNTPrimed extends CraftEntity implements TNTPrimed { @@ -42,8 +42,16 @@ public class CraftTNTPrimed extends CraftEntity implements TNTPrimed {

View File

@ -10,10 +10,10 @@ the impact from scaling the region threads, but is not a fix
to the underlying issue. to the underlying issue.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ec1c5bf4b2e4a54e9df085331416bac0b42c601d..027d95e0763c6e18380b706fcd7f48c09a7cc17a 100644 index 301ff715b89abbebda83af1e15f8d5d15097002f..7df4935a6c1a631e07dcf9c30341f93f3fba7090 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1469,6 +1469,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1463,6 +1463,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Folia end - region threading // Folia end - region threading
public final void executeMidTickTasks() { public final void executeMidTickTasks() {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Throw UnsupportedOperationException() for broken APIs
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d05fb79f3d34984722f8385417dc496bb97414a7..f66ab15b268712322b277bd251cd40933f862926 100644 index 9dfcdc92d8507dff6a77115de5122b109dce44da..f97f764c70243a57e78b62af9971677d5e49c66d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1266,6 +1266,7 @@ public final class CraftServer implements Server { @@ -1266,6 +1266,7 @@ public final class CraftServer implements Server {
@ -25,7 +25,7 @@ index d05fb79f3d34984722f8385417dc496bb97414a7..f66ab15b268712322b277bd251cd4093
if (world == null) { if (world == null) {
return false; return false;
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
index e7d3637927e92c181ecc2e21a3456918afb30822..942c2dafbf2b6a0df8415fa9c09747ed313ee209 100644 index 253574890a9ed23d38a84680ba1eb221dc72b310..ce8b91f00f925960ad17f381162a11294e8b511d 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
@@ -45,6 +45,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { @@ -45,6 +45,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {

View File

@ -9,7 +9,7 @@ add explicit block update suppression techniques, it's better
than the server crashing. than the server crashing.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index f2597960643a37c79ad189254b7073e22d607347..833f65c7b66a9b87b34118ed12d4d701a54b8e61 100644 index 7334a522956649fdf606b560d52e127c2f500b5d..394ec4f018b676a441e49d7ccbef3f8c56673603 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1763,7 +1763,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1763,7 +1763,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@ -22,7 +22,7 @@ index f2597960643a37c79ad189254b7073e22d607347..833f65c7b66a9b87b34118ed12d4d701
if (iblockdata.is(Blocks.COMPARATOR)) { if (iblockdata.is(Blocks.COMPARATOR)) {
diff --git a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
index 034a3bc5b5e526e28088a9715a41ad8ab843860b..42877ed3c59141072a551d0f0d6db7e0eef919a0 100644 index 9de6503f20396601a270e6eb0b66c40187fca690..f5fb81ebe2ca06cd8e4bf5b28494563f7beb4a7c 100644
--- a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java --- a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
@@ -134,9 +134,9 @@ public class DetectorRailBlock extends BaseRailBlock { @@ -134,9 +134,9 @@ public class DetectorRailBlock extends BaseRailBlock {
@ -54,7 +54,7 @@ index b84c48902ef24fdae17578a304e6c93dc20c5dce..218c1954a7922c9e6bf6f34f9497f89c
} else { } else {
RailShape blockpropertytrackposition1 = (RailShape) iblockdata.getValue(PoweredRailBlock.SHAPE); RailShape blockpropertytrackposition1 = (RailShape) iblockdata.getValue(PoweredRailBlock.SHAPE);
diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
index bf0e67921d96edde46a97543099f9c03634fca11..b64f0a30a0f7aee5ac9838a11756fdc5c93c36f6 100644 index 875a776d5aa1399808e5d5eab1c608dd35011c85..1b34a5beb7f17b25552375d3b8017e26da0239b8 100644
--- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java --- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
@@ -200,8 +200,9 @@ public class RedStoneWireBlock extends Block { @@ -200,8 +200,9 @@ public class RedStoneWireBlock extends Block {
@ -69,7 +69,7 @@ index bf0e67921d96edde46a97543099f9c03634fca11..b64f0a30a0f7aee5ac9838a11756fdc5
BlockState iblockdata1 = world.getBlockState(blockposition_mutableblockposition); BlockState iblockdata1 = world.getBlockState(blockposition_mutableblockposition);
diff --git a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java diff --git a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
index 8a139bcfc9c3de5793b1b590be6cafaae01c86e1..a61672154c4f733cdadd9ac34ca5507355d06c68 100644 index a25c2983a7e0df3292f701fc46487e5e15ec7ac8..8185959e02a82590dcc3f5625494b6f0f38e31b1 100644
--- a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java --- a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
+++ b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java +++ b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
@@ -119,7 +119,8 @@ public class CollectingNeighborUpdater implements NeighborUpdater { @@ -119,7 +119,8 @@ public class CollectingNeighborUpdater implements NeighborUpdater {
@ -79,13 +79,13 @@ index 8a139bcfc9c3de5793b1b590be6cafaae01c86e1..a61672154c4f733cdadd9ac34ca55073
- BlockState blockState = world.getBlockState(blockPos); - BlockState blockState = world.getBlockState(blockPos);
+ BlockState blockState = !io.papermc.paper.util.TickThread.isTickThreadFor((net.minecraft.server.level.ServerLevel)world, blockPos) ? null : world.getBlockStateIfLoaded(blockPos); // Folia - block updates in unloaded chunks + BlockState blockState = !io.papermc.paper.util.TickThread.isTickThreadFor((net.minecraft.server.level.ServerLevel)world, blockPos) ? null : world.getBlockStateIfLoaded(blockPos); // Folia - block updates in unloaded chunks
+ if (blockState != null) { // Folia - block updates in unloaded chunks + if (blockState != null) { // Folia - block updates in unloaded chunks
// Paper start // Paper start - Call BlockPhysicsEvent
try { try {
boolean cancelled = false; boolean cancelled = false;
@@ -141,6 +142,7 @@ public class CollectingNeighborUpdater implements NeighborUpdater { @@ -141,6 +142,7 @@ public class CollectingNeighborUpdater implements NeighborUpdater {
world.lastPhysicsProblem = new BlockPos(blockPos); world.lastPhysicsProblem = new BlockPos(blockPos);
} }
// Paper end // Paper end - Call BlockPhysicsEvent
+ } // Folia - block updates in unloaded chunks + } // Folia - block updates in unloaded chunks
if (this.idx < NeighborUpdater.UPDATE_ORDER.length && NeighborUpdater.UPDATE_ORDER[this.idx] == this.skipDirection) { if (this.idx < NeighborUpdater.UPDATE_ORDER.length && NeighborUpdater.UPDATE_ORDER[this.idx] == this.skipDirection) {
++this.idx; ++this.idx;

View File

@ -9,7 +9,7 @@ data deserialization and is racey even in Vanilla. But in Folia,
some accesses may throw and as such we need to fix this directly. some accesses may throw and as such we need to fix this directly.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index e479129a977721fc8061be968eefab4daa407f5c..3d2b059254fdc08d1e4f9281946028a46884d7c8 100644 index 9a4481da26820f967d38ff582c256361936f957b..bd9edb8271e3111431d45eb908d8336e0e7e23bc 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -644,7 +644,7 @@ public class ServerPlayer extends Player { @@ -644,7 +644,7 @@ public class ServerPlayer extends Player {
@ -22,10 +22,10 @@ index e479129a977721fc8061be968eefab4daa407f5c..3d2b059254fdc08d1e4f9281946028a4
// CraftBukkit start // CraftBukkit start
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 46b835f65ec64720efa54cc524f16a3fa536e90b..abf455d165004240e0b5fd96543f7da7c520e729 100644 index 36ec42505505af86b1a63bd8cfea5a88f4569c74..8d8c80a41e01df4d0fef7d045b9c5d283a8f168d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -4360,6 +4360,11 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -4361,6 +4361,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
}); });

View File

@ -9,18 +9,17 @@ engine compared to the POI access. This should make it safe for
off-region access. off-region access.
diff --git a/src/main/java/net/minecraft/world/item/CompassItem.java b/src/main/java/net/minecraft/world/item/CompassItem.java diff --git a/src/main/java/net/minecraft/world/item/CompassItem.java b/src/main/java/net/minecraft/world/item/CompassItem.java
index 7c4a2f8bb3efd11db2f8711952cc26a067c6d56b..2a60db30bc113039c03ff10b45d5a704a4106b48 100644 index b3c67c954acf7e518d89d6af65a55d6f22dac059..eea1066379805a4bdef9b496a92ad956d0c84ac7 100644
--- a/src/main/java/net/minecraft/world/item/CompassItem.java --- a/src/main/java/net/minecraft/world/item/CompassItem.java
+++ b/src/main/java/net/minecraft/world/item/CompassItem.java +++ b/src/main/java/net/minecraft/world/item/CompassItem.java
@@ -77,7 +77,11 @@ public class CompassItem extends Item implements Vanishable { @@ -77,7 +77,10 @@ public class CompassItem extends Item implements Vanishable {
Optional<ResourceKey<Level>> optional = getLodestoneDimension(compoundTag); Optional<ResourceKey<Level>> optional = getLodestoneDimension(compoundTag);
if (optional.isPresent() && optional.get() == world.dimension() && compoundTag.contains("LodestonePos")) { if (optional.isPresent() && optional.get() == world.dimension() && compoundTag.contains("LodestonePos")) {
BlockPos blockPos = NbtUtils.readBlockPos(compoundTag.getCompound("LodestonePos")); BlockPos blockPos = NbtUtils.readBlockPos(compoundTag.getCompound("LodestonePos"));
- if (!world.isInWorldBounds(blockPos) || (world.hasChunkAt(blockPos) && !((ServerLevel)world).getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos))) { // Paper - if (!world.isInWorldBounds(blockPos) || (world.hasChunkAt(blockPos) && !((ServerLevel)world).getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos))) { // Paper - Prevent compass from loading chunks
+
+ // Folia start - do not access the POI data off-region + // Folia start - do not access the POI data off-region
+ net.minecraft.world.level.chunk.LevelChunk chunk = world.getChunkIfLoaded(blockPos); + net.minecraft.world.level.chunk.LevelChunk chunk = world.getChunkIfLoaded(blockPos);
+ if (!world.isInWorldBounds(blockPos) || chunk != null && chunk.getBlockState(blockPos).getBlock() != Blocks.LODESTONE) { // Paper + if (!world.isInWorldBounds(blockPos) || chunk != null && chunk.getBlockState(blockPos).getBlock() != Blocks.LODESTONE) { // Paper - Prevent compass from loading chunks
+ // Folia end - do not access the POI data off-region + // Folia end - do not access the POI data off-region
compoundTag.remove("LodestonePos"); compoundTag.remove("LodestonePos");
} }

View File

@ -7,7 +7,7 @@ This allows the player to be re-positioned before logging into
the world without causing thread checks to trip on Folia. the world without causing thread checks to trip on Folia.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index eb797313a13b5a805f834b2e9f08989e381f0761..e63ad8ed0318fb99e99a8609ef6a31d16f87e7ff 100644 index 739e8966c7326edf47e85f959374cbc8970d7b2a..8c74ba46920c41f82df7ae066caffd17b333301c 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -514,7 +514,13 @@ public abstract class PlayerList { @@ -514,7 +514,13 @@ public abstract class PlayerList {

View File

@ -1376,10 +1376,10 @@ index 98fb69a9adeb6eaab199aec127692acb07f56808..7cc624505931dcb6696c3ef3ee3bbea7
label25: label25:
{ {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 027d95e0763c6e18380b706fcd7f48c09a7cc17a..9ea861c1531c5f9d8a87e45512336eba3bddf06a 100644 index 7df4935a6c1a631e07dcf9c30341f93f3fba7090..4383528df7627c5eb7cba1218f1b4e524e4fe956 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1585,6 +1585,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1579,6 +1579,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Folia start - region threading // Folia start - region threading
public void tickServer(long startTime, long scheduledEnd, long targetBuffer, public void tickServer(long startTime, long scheduledEnd, long targetBuffer,
io.papermc.paper.threadedregions.TickRegions.TickRegionData region) { io.papermc.paper.threadedregions.TickRegions.TickRegionData region) {
@ -1387,7 +1387,7 @@ index 027d95e0763c6e18380b706fcd7f48c09a7cc17a..9ea861c1531c5f9d8a87e45512336eba
if (region != null) { if (region != null) {
region.world.getCurrentWorldData().updateTickData(); region.world.getCurrentWorldData().updateTickData();
if (region.world.checkInitialised.get() != ServerLevel.WORLD_INIT_CHECKED) { if (region.world.checkInitialised.get() != ServerLevel.WORLD_INIT_CHECKED) {
@@ -1619,10 +1620,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1613,10 +1614,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Folia start - region threading // Folia start - region threading
if (region != null) { if (region != null) {
@ -1404,7 +1404,7 @@ index 027d95e0763c6e18380b706fcd7f48c09a7cc17a..9ea861c1531c5f9d8a87e45512336eba
for (Entity entity : region.world.getCurrentWorldData().getLocalEntitiesCopy()) { for (Entity entity : region.world.getCurrentWorldData().getLocalEntitiesCopy()) {
if (!io.papermc.paper.util.TickThread.isTickThreadFor(entity) || entity.isRemoved()) { if (!io.papermc.paper.util.TickThread.isTickThreadFor(entity) || entity.isRemoved()) {
continue; continue;
@@ -1630,10 +1637,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1624,10 +1631,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
org.bukkit.craftbukkit.entity.CraftEntity bukkit = entity.getBukkitEntityRaw(); org.bukkit.craftbukkit.entity.CraftEntity bukkit = entity.getBukkitEntityRaw();
if (bukkit != null) { if (bukkit != null) {
bukkit.taskScheduler.executeTick(); bukkit.taskScheduler.executeTick();
@ -1420,7 +1420,7 @@ index 027d95e0763c6e18380b706fcd7f48c09a7cc17a..9ea861c1531c5f9d8a87e45512336eba
} }
// Folia end - region threading // Folia end - region threading
@@ -1653,6 +1665,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1647,6 +1659,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
this.profiler.push("save"); this.profiler.push("save");
final boolean fullSave = autosavePeriod > 0 && io.papermc.paper.threadedregions.RegionizedServer.getCurrentTick() % autosavePeriod == 0; // Folia - region threading final boolean fullSave = autosavePeriod > 0 && io.papermc.paper.threadedregions.RegionizedServer.getCurrentTick() % autosavePeriod == 0; // Folia - region threading
@ -1428,7 +1428,7 @@ index 027d95e0763c6e18380b706fcd7f48c09a7cc17a..9ea861c1531c5f9d8a87e45512336eba
try { try {
this.isSaving = true; this.isSaving = true;
if (playerSaveInterval > 0) { if (playerSaveInterval > 0) {
@@ -1666,6 +1679,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1660,6 +1673,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} finally { } finally {
this.isSaving = false; this.isSaving = false;
} }
@ -1436,7 +1436,7 @@ index 027d95e0763c6e18380b706fcd7f48c09a7cc17a..9ea861c1531c5f9d8a87e45512336eba
this.profiler.pop(); this.profiler.pop();
// Paper end // Paper end
io.papermc.paper.util.CachedLists.reset(); // Paper io.papermc.paper.util.CachedLists.reset(); // Paper
@@ -1730,6 +1744,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1724,6 +1738,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public void tickChildren(BooleanSupplier shouldKeepTicking, io.papermc.paper.threadedregions.TickRegions.TickRegionData region) { // Folia - region threading public void tickChildren(BooleanSupplier shouldKeepTicking, io.papermc.paper.threadedregions.TickRegions.TickRegionData region) { // Folia - region threading
@ -1444,7 +1444,7 @@ index 027d95e0763c6e18380b706fcd7f48c09a7cc17a..9ea861c1531c5f9d8a87e45512336eba
final io.papermc.paper.threadedregions.RegionizedWorldData regionizedWorldData = io.papermc.paper.threadedregions.TickRegionScheduler.getCurrentRegionizedWorldData(); // Folia - regionised ticking final io.papermc.paper.threadedregions.RegionizedWorldData regionizedWorldData = io.papermc.paper.threadedregions.TickRegionScheduler.getCurrentRegionizedWorldData(); // Folia - regionised ticking
if (region == null) this.getPlayerList().getPlayers().forEach((entityplayer) -> { // Folia - region threading if (region == null) this.getPlayerList().getPlayers().forEach((entityplayer) -> { // Folia - region threading
entityplayer.connection.suspendFlushing(); entityplayer.connection.suspendFlushing();
@@ -1796,12 +1811,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1790,12 +1805,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try { try {
worldserver.timings.doTick.startTiming(); // Spigot worldserver.timings.doTick.startTiming(); // Spigot
@ -1458,9 +1458,9 @@ index 027d95e0763c6e18380b706fcd7f48c09a7cc17a..9ea861c1531c5f9d8a87e45512336eba
+ } finally { profiler.stopTimer(worldserver.tickTimerId); } // Folia - profiler + } finally { profiler.stopTimer(worldserver.tickTimerId); } // Folia - profiler
worldserver.timings.doTick.stopTiming(); // Spigot worldserver.timings.doTick.stopTiming(); // Spigot
} catch (Throwable throwable) { } catch (Throwable throwable) {
// Spigot Start CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 27513071da19c4c37640a7538fa976d166fb5b09..d7dc0c26b6093455ff32e60f6541f4b8923a35b3 100644 index bc1c0ce0a29654172afdfc30baee190208213216..4c160f62336acdbcd835ebbf7f683205a776ce79 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -470,16 +470,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -470,16 +470,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -1629,10 +1629,10 @@ index a21cc9c7d5981c742f379affe9c1ef4dcb0fa1e1..88db5ada13329a5fe0d0fb652d2c8a8d
// Folia end - region threading // Folia end - region threading
// Paper end - optimise chunk tick iteration // Paper end - optimise chunk tick iteration
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30aa67aaa9 100644 index a04ae14681880897132bd410680d8f69b1593795..653728709b275fee822e55a511e67ec11fdc48f7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -898,6 +898,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -897,6 +897,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void tick(BooleanSupplier shouldKeepTicking, io.papermc.paper.threadedregions.TickRegions.TickRegionData region) { // Folia - regionised ticking public void tick(BooleanSupplier shouldKeepTicking, io.papermc.paper.threadedregions.TickRegions.TickRegionData region) { // Folia - regionised ticking
final io.papermc.paper.threadedregions.RegionizedWorldData regionizedWorldData = this.getCurrentWorldData(); // Folia - regionised ticking final io.papermc.paper.threadedregions.RegionizedWorldData regionizedWorldData = this.getCurrentWorldData(); // Folia - regionised ticking
@ -1640,7 +1640,7 @@ index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30
ProfilerFiller gameprofilerfiller = this.getProfiler(); ProfilerFiller gameprofilerfiller = this.getProfiler();
regionizedWorldData.setHandlingTick(true); // Folia - regionised ticking regionizedWorldData.setHandlingTick(true); // Folia - regionised ticking
@@ -926,9 +927,13 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -925,9 +926,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (!this.isDebug() && flag) { if (!this.isDebug() && flag) {
j = regionizedWorldData.getRedstoneGameTime(); // Folia - region threading j = regionizedWorldData.getRedstoneGameTime(); // Folia - region threading
gameprofilerfiller.push("blockTicks"); gameprofilerfiller.push("blockTicks");
@ -1654,7 +1654,7 @@ index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30
gameprofilerfiller.pop(); gameprofilerfiller.pop();
} }
this.timings.scheduledBlocks.stopTiming(); // Paper this.timings.scheduledBlocks.stopTiming(); // Paper
@@ -936,18 +941,24 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -935,18 +940,24 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.popPush("raid"); gameprofilerfiller.popPush("raid");
if (flag) { if (flag) {
this.timings.raids.startTiming(); // Paper - timings this.timings.raids.startTiming(); // Paper - timings
@ -1679,7 +1679,7 @@ index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30
this.timings.doSounds.stopTiming(); // Spigot this.timings.doSounds.stopTiming(); // Spigot
} }
@@ -963,6 +974,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -962,6 +973,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.push("entities"); gameprofilerfiller.push("entities");
this.timings.tickEntities.startTiming(); // Spigot this.timings.tickEntities.startTiming(); // Spigot
if (this.dragonFight != null && flag) { if (this.dragonFight != null && flag) {
@ -1687,7 +1687,7 @@ index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30
if (io.papermc.paper.util.TickThread.isTickThreadFor(this, this.dragonFight.origin)) { // Folia - region threading if (io.papermc.paper.util.TickThread.isTickThreadFor(this, this.dragonFight.origin)) { // Folia - region threading
gameprofilerfiller.push("dragonFight"); gameprofilerfiller.push("dragonFight");
this.dragonFight.tick(); this.dragonFight.tick();
@@ -975,10 +987,12 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -974,10 +986,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
fightCenter fightCenter
); );
} // Folia end - region threading } // Folia end - region threading
@ -1700,7 +1700,7 @@ index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30
regionizedWorldData.forEachTickingEntity((entity) -> { // Folia - regionised ticking regionizedWorldData.forEachTickingEntity((entity) -> { // Folia - regionised ticking
if (!entity.isRemoved()) { if (!entity.isRemoved()) {
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
@@ -1006,10 +1020,13 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1005,10 +1019,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
} }
}); });
@ -1714,7 +1714,7 @@ index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30
} }
gameprofilerfiller.push("entityManagement"); gameprofilerfiller.push("entityManagement");
@@ -1069,12 +1086,15 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1068,12 +1085,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
public void tickCustomSpawners(boolean spawnMonsters, boolean spawnAnimals) { public void tickCustomSpawners(boolean spawnMonsters, boolean spawnAnimals) {
@ -1730,7 +1730,7 @@ index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30
} }
} }
@@ -1524,6 +1544,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1523,6 +1543,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Paper start- timings // Paper start- timings
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity); final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity);
timer = isActive ? entity.getType().tickTimer.startTiming() : entity.getType().inactiveTickTimer.startTiming(); // Paper timer = isActive ? entity.getType().tickTimer.startTiming() : entity.getType().inactiveTickTimer.startTiming(); // Paper
@ -1742,7 +1742,7 @@ index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30
try { try {
// Paper end - timings // Paper end - timings
entity.setOldPosAndRot(); entity.setOldPosAndRot();
@@ -1549,7 +1574,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1548,7 +1573,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Folia end - region threading // Folia end - region threading
} else { entity.inactiveTick(); } // Paper - EAR 2 } else { entity.inactiveTick(); } // Paper - EAR 2
this.getProfiler().pop(); this.getProfiler().pop();
@ -1751,7 +1751,7 @@ index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30
Iterator iterator = entity.getPassengers().iterator(); Iterator iterator = entity.getPassengers().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -1573,6 +1598,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1572,6 +1597,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Paper - EAR 2 // Paper - EAR 2
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger); final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
co.aikar.timings.Timing timer = isActive ? passenger.getType().passengerTickTimer.startTiming() : passenger.getType().passengerInactiveTickTimer.startTiming(); // Paper co.aikar.timings.Timing timer = isActive ? passenger.getType().passengerTickTimer.startTiming() : passenger.getType().passengerInactiveTickTimer.startTiming(); // Paper
@ -1763,7 +1763,7 @@ index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30
try { try {
// Paper end // Paper end
passenger.setOldPosAndRot(); passenger.setOldPosAndRot();
@@ -1612,7 +1642,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1611,7 +1641,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(passenger, entity2); this.tickPassenger(passenger, entity2);
} }
@ -1773,7 +1773,7 @@ index 8d3dca767e5928756e2767d60ca92fcc4cc760f1..788d6581e5283d6cbdefec158a00cc30
} else { } else {
passenger.stopRiding(); passenger.stopRiding();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index e63ad8ed0318fb99e99a8609ef6a31d16f87e7ff..ded539dd20a2d037fa5d175be06d59dd76660ffe 100644 index 8c74ba46920c41f82df7ae066caffd17b333301c..5d4876fc53eb12ee8e4a0159177e05cee847f077 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1329,6 +1329,7 @@ public abstract class PlayerList { @@ -1329,6 +1329,7 @@ public abstract class PlayerList {
@ -1795,7 +1795,7 @@ index e63ad8ed0318fb99e99a8609ef6a31d16f87e7ff..ded539dd20a2d037fa5d175be06d59dd
if (interval != -1 && max != -1 && ++numSaved >= max) { if (interval != -1 && max != -1 && ++numSaved >= max) {
break; break;
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 6cfce9755dd464a7afb01f9032e567ce3bcd5bc5..d37a7f2ab6a8041d3bfeed600d15f77d253140f6 100644 index e52f3da3b63cc3dba59d3e874a8420dd312b5e96..dc83dc377aff965222006e3eaaceb57692d2604f 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java --- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -326,6 +326,13 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT @@ -326,6 +326,13 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@ -1826,7 +1826,7 @@ index 6cfce9755dd464a7afb01f9032e567ce3bcd5bc5..d37a7f2ab6a8041d3bfeed600d15f77d
this.factory = factory; this.factory = factory;
this.category = spawnGroup; this.category = spawnGroup;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 833f65c7b66a9b87b34118ed12d4d701a54b8e61..9c176121ac708be71726a67ab4da50113ee3f850 100644 index 394ec4f018b676a441e49d7ccbef3f8c56673603..412b764a4911485487c7967ed64b74e97eb8fa8c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -229,6 +229,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -229,6 +229,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@ -1837,7 +1837,7 @@ index 833f65c7b66a9b87b34118ed12d4d701a54b8e61..9c176121ac708be71726a67ab4da5011
+ public final int tickTimerId; + public final int tickTimerId;
+ // Folia end - profiler + // Folia end - profiler
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
@@ -321,6 +324,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -321,6 +324,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.minSection = io.papermc.paper.util.WorldUtil.getMinSection(this); this.minSection = io.papermc.paper.util.WorldUtil.getMinSection(this);
@ -1917,10 +1917,10 @@ index 2e110da3502a7ac5ec4cc20510a3fac933569895..5aac65f37a0190c5d6a7175073fb0cc0
} }
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 744fa3a3a62ffb4b3d1e7831c93fd76dee29fdd0..3c42478dd38d29dedc638e7bbbbd23818e111335 100644 index 562f42d0ccda8dadf9ddc08b1acb67c0e0c22d7e..d6bc8c0dfa8f180ced0ee55d03797411164ad55a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -1182,11 +1182,14 @@ public class LevelChunk extends ChunkAccess { @@ -1181,11 +1181,14 @@ public class LevelChunk extends ChunkAccess {
BlockPos blockposition = this.blockEntity.getBlockPos(); BlockPos blockposition = this.blockEntity.getBlockPos();
if (LevelChunk.this.isTicking(blockposition)) { if (LevelChunk.this.isTicking(blockposition)) {
@ -1935,7 +1935,7 @@ index 744fa3a3a62ffb4b3d1e7831c93fd76dee29fdd0..3c42478dd38d29dedc638e7bbbbd2381
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition); BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
if (this.blockEntity.getType().isValid(iblockdata)) { if (this.blockEntity.getType().isValid(iblockdata)) {
@@ -1196,6 +1199,7 @@ public class LevelChunk extends ChunkAccess { @@ -1195,6 +1198,7 @@ public class LevelChunk extends ChunkAccess {
this.loggedInvalidBlockState = true; this.loggedInvalidBlockState = true;
LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new Object[]{LogUtils.defer(this::getType), LogUtils.defer(this::getPos), iblockdata}); LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new Object[]{LogUtils.defer(this::getType), LogUtils.defer(this::getPos), iblockdata});
} }