Update Paper

This commit is contained in:
Spottedleaf 2024-03-24 13:44:25 -07:00
parent 035f8e33c5
commit ad2ef004b9
14 changed files with 302 additions and 286 deletions

View File

@ -17,7 +17,7 @@ repositories {
}
dependencies {
remapper("net.fabricmc:tiny-remapper:0.8.10:fat")
remapper("net.fabricmc:tiny-remapper:0.10.1:fat")
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
paperclip("io.papermc:paperclip:3.0.3")
}

View File

@ -2,7 +2,7 @@ group=dev.folia
version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4
paperRef=4939f8711884901ddf1c56337f606de71cdae78d
paperRef=b6001403e9703cadaa6e8c8558e732b91c3c6d6e
org.gradle.caching=true
org.gradle.parallel=true

View File

@ -11,10 +11,10 @@ the schedulers depending on the result of the ownership
check.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index ca27559cf4aa1c2e44fdca2022e213b1b1c80f4e..3fae7b21353d18ff1e8005fbbe83be783de8a953 100644
index db46e3233edf18bd91a6da8612ccc9f0080d5c17..4d6de4f2c67b1f122768806443766bd20c5ae617 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2857,6 +2857,14 @@ public final class Bukkit {
@@ -2873,6 +2873,14 @@ public final class Bukkit {
return server.isOwnedByCurrentRegion(entity);
}
// Paper end - Folia region threading API
@ -30,10 +30,10 @@ index ca27559cf4aa1c2e44fdca2022e213b1b1c80f4e..3fae7b21353d18ff1e8005fbbe83be78
@NotNull
public static Server.Spigot spigot() {
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index b4f8281d3797ec825a7671f38077cd65d5a1d76e..fe3d89c2c319c4f4b2b3e4a121d6626a898f501b 100644
index 0eb61b090d6f8fa6d99735ff3680dac774c52c1f..d46f932b595495816ea038cf161bc7f2d85f177e 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2497,4 +2497,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2512,4 +2512,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
// Paper end - Folia region threading API

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
diff --git a/build.gradle.kts b/build.gradle.kts
index ce3747d8d2a8f4327766cf23d5aaa72cfcb380bc..08d434023226af0d2c469055a3b2188fe8a4ed38 100644
index 241808d8619e17c0681f79acbbc98af5bf52dd89..905262067dabc7cbe5b08639fcefd3a996a937e0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
@ -23,7 +23,7 @@ index ce3747d8d2a8f4327766cf23d5aaa72cfcb380bc..08d434023226af0d2c469055a3b2188f
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
@@ -70,7 +74,7 @@ tasks.jar {
@@ -71,7 +75,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
@ -32,7 +32,7 @@ index ce3747d8d2a8f4327766cf23d5aaa72cfcb380bc..08d434023226af0d2c469055a3b2188f
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
@@ -154,7 +158,7 @@ fun TaskContainer.registerRunTask(
@@ -155,7 +159,7 @@ fun TaskContainer.registerRunTask(
name: String,
block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) {
@ -93,10 +93,10 @@ index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..e2f704c115fd6e00960bb56bb0779f11
).openBufferedStream()) {
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
index d06185566b447c432d4dc2e3ba04d121bcdbc71b..680919045310be7e50e2d503a23d265f2e9b2bc6 100644
index 93b661e9cb7743aeff7da3972942cb73049a5e4c..c220b116b62e783d42364bae3d499e66a52241d1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1855,7 +1855,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1865,7 +1865,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {
@ -106,7 +106,7 @@ index d06185566b447c432d4dc2e3ba04d121bcdbc71b..680919045310be7e50e2d503a23d265f
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
index 9f7ed337463cc9bb370a5541d9de5cd8f9c1a78a..c4144c239a5d91bc0faec84fe49829337aa339dc 100644
index c490a29bcf7410bc54959ee71375605964379ed5..b63effd92be5a8a75db6c37e5a1b91541020ec75 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -266,7 +266,7 @@ import javax.annotation.Nullable; // Paper

File diff suppressed because it is too large Load Diff

View File

@ -19,10 +19,10 @@ index 58cdb65083134680230d7070f9f6209f2d32873b..aa4b461bbb2c8c4753f7c9057bab1740
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
index fa36e892b019877a770a618fe8d4cda118fe137d..93e192ea1a0cda2d7aae983980a6fead013c8b90 100644
index 12502d9db5bae29ed642e179f3a19d433ac7df25..ebbe5dda644a06bfd4769934e33402b2c009c7e2 100644
--- a/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 {
@@ -172,6 +172,17 @@ public abstract class PlayerList {
conflictingId = this.connectionById.get(byId);
if (conflictingName == null && conflictingId == null) {

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
index b8e77755a1706e60e9dfa1310aa2449ee0dbc6ad..0725386d7ef47171012671725ceddfe92b43b203 100644
index 39434804e84418e44d595012e8f2191176347e25..edb4ffe78e28755e061c46c6834bbc9b7a23ff16 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2911,6 +2911,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -2927,6 +2927,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (!force && (!this.canRide(entity) || !entity.canAddPassenger(this))) {
return false;
} else {
@ -40,7 +40,7 @@ index b8e77755a1706e60e9dfa1310aa2449ee0dbc6ad..0725386d7ef47171012671725ceddfe9
// CraftBukkit start
if (entity.getBukkitEntity() instanceof Vehicle && this.getBukkitEntity() instanceof LivingEntity) {
VehicleEnterEvent event = new VehicleEnterEvent((Vehicle) entity.getBukkitEntity(), this.getBukkitEntity());
@@ -2932,6 +2933,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -2948,6 +2949,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return false;
}
// CraftBukkit end
@ -48,7 +48,7 @@ index b8e77755a1706e60e9dfa1310aa2449ee0dbc6ad..0725386d7ef47171012671725ceddfe9
if (this.isPassenger()) {
this.stopRiding();
}
@@ -3009,6 +3011,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3025,6 +3027,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else {
// CraftBukkit start
@ -56,7 +56,7 @@ index b8e77755a1706e60e9dfa1310aa2449ee0dbc6ad..0725386d7ef47171012671725ceddfe9
CraftEntity craft = (CraftEntity) entity.getBukkitEntity().getVehicle();
Entity orig = craft == null ? null : craft.getHandle();
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
@@ -3036,6 +3039,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3052,6 +3055,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return false;
}
// CraftBukkit end
@ -288,10 +288,10 @@ index ccda0d7a96c201905f0f62dcb0e5b278a51dee9f..3ba6c46e0f5bc5f6b5994d41aaa9c4dd
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
index 6d2fe30742f8b41d53dd2cbff120fcc042ea0e0c..ed236cf2b405d954e69390c6f6fa4e79369058ee 100644
index 3a749f78be3968e499e096196eaaa0b433a53c06..6b2907f9fb74e5a5bbc7084d22318794b97dd1b7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
@@ -142,8 +142,16 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow {
@@ -133,8 +133,16 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow {
this.getHandle().setShotFromCrossbow(shotFromCrossbow);
}
@ -897,10 +897,10 @@ 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
index ac91fe913b4f6a6148955e7181e5abda13f15820..5adbfb278aed3c32b6d4992b8932cc3dafd8f9cc 100644
index 55ed79a802efa7a28cd487770a689119c64b7f40..73316307666674f9f6e7ddb964e2ec2583743c79 100644
--- a/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 {
@@ -491,7 +491,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@Override
public UUID getUniqueId() {
@ -909,7 +909,7 @@ index ac91fe913b4f6a6148955e7181e5abda13f15820..5adbfb278aed3c32b6d4992b8932cc3d
}
@Override
@@ -505,6 +505,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -506,6 +506,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
public Entity getHandle() {
@ -1002,12 +1002,12 @@ index 1359d25a32b4a5d5e8e68ce737bd19f7b5afaf69..0be7f84a50b7568d0c639f5906b5ca76
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
index 1d8aab2fda18c6e2bb30f6ba4a6325263267b628..61ad4e93c01ccdae9cdf4efb08f43959af9aafc4 100644
index a8699b274b51c5f6691557c3c3db88436f05e304..45e900cd12c5615149c99a5dc85e8f78edb5483b 100644
--- a/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 {
@@ -60,8 +60,16 @@ public class CraftFireball extends AbstractProjectile implements Fireball {
}
// Paper end - set direction without normalizing
// Paper end - Expose power on fireball projectiles
+ // Folia start - region threading
+ @Override
@ -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
index 832def3c518be8d6d81e71f6022566e6179e2d17..725e016dcd8177dcee0f0e1bd345c985fc1e95af 100644
index 30d62ee4d5cd2ddacb8783b5bbbf475d592b3e02..c78498010a01b7d4c0b5c7350a11d0e1cf8ab013 100644
--- a/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 {
@ -1590,7 +1590,7 @@ index e9f471e60af0725ec34e2985d63ae9ea9f88590a..6a443f42ecec16abea3ddf7bc2e85bb8
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index f1e4dfd203d455ec089cd2b5679c4083400dbc7f..6abb7ee0f5d32613b2ff7da09810ae407e293838 100644
index 993844ee3d76591be38e8d27eba37ff8723443b1..ac46baf473a9cf366b9b1ab3d59e8ab7097bc656 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -454,6 +454,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@ -1878,7 +1878,7 @@ index 706c74c832f6893df3797023f68add31139c7d57..80a612f16669e571e336dd6369a968b4
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java
index 1d78ae1db211a452a42fb4a7bef4cca4b7c71a1f..e4e8d7561036ab04d069cfe54f1fba61b478c5d8 100644
index 983e0cdbd1bd950807967a36cba49859fb956f31..7dc7e382d63cd5c42bb0ef72d4766d24be99c3a6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java
@@ -19,6 +19,13 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow, io.paperm
@ -1895,7 +1895,7 @@ index 1d78ae1db211a452a42fb4a7bef4cca4b7c71a1f..e4e8d7561036ab04d069cfe54f1fba61
@Override
public boolean hasEffectsForNextStew() {
return this.getHandle().stewEffects != null && !this.getHandle().stewEffects.isEmpty();
@@ -74,6 +81,7 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow, io.paperm
@@ -100,6 +107,7 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow, io.paperm
@Override
public net.minecraft.world.entity.animal.MushroomCow getHandle() {
@ -2135,7 +2135,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
index 3d47913cb590463b636cbdc052fb54778951ba61..8fc071a6249193af5e1795cc19f50996ea22d96f 100644
index 14a5eda367dd46fe7c9b5f76df80840f938c06ea..d2902fc7f3b7af59f181bd1e12435d946db7ad23 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -580,7 +580,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -10,10 +10,10 @@ the impact from scaling the region threads, but is not a fix
to the underlying issue.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 11eb550cba3a8eee1deb2f00e5514863e255ea07..39cbb724820a07778191b0421c9ded6a9af1ad04 100644
index 1e658114879ad9bdb679b9230ac3eab643375f8b..6b07179212ec0bdb6b68294c996b9dfee8fc81cb 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1466,6 +1466,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1476,6 +1476,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Folia end - region threading
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
index a4e47391105366e52b949f39ba4a1ebed94b2188..853afba9d0a814acc001ba5db5ef3653f8b16392 100644
index 350fc61fd709453a86c9f7f6e4bccc434065cc35..9dd9e86a5f7f30ce37b906ebfe4bccad0e52577f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1283,6 +1283,7 @@ public final class CraftServer implements Server {

View File

@ -9,10 +9,10 @@ add explicit block update suppression techniques, it's better
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
index 2b8674034979e3f8d45362f7cbae3c1b453834ee..de7c06785e3914fe7181bcb836b70a96a4900011 100644
index 52a7775e7aa375a043438d23204acd030ad35372..55f4fc731b5bde0bbac681a0902af1506ad87762 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1753,7 +1753,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1762,7 +1762,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
Direction enumdirection = (Direction) iterator.next();
BlockPos blockposition1 = pos.relative(enumdirection);

View File

@ -22,10 +22,10 @@ index add6fc106d3c38d97b48ec0df3ac2515c8c0486e..cbc89b8898f9243776af88c2b04ad3c2
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ffec458e5b6dc4250758fb8a97ab1e737dcedb1d..2fa76a711a629e38a95b93e473272b8217783f99 100644
index 206e662c8a43604d5a7563868348d501c135017c..cced2d25936eed5360716c8c25e4ca87f9150017 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -4374,6 +4374,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -4382,6 +4382,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
});

View File

@ -7,10 +7,10 @@ This allows the player to be re-positioned before logging into
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
index 93e192ea1a0cda2d7aae983980a6fead013c8b90..b19f1db38e71d9185cca9fc0e44937f91443a042 100644
index ebbe5dda644a06bfd4769934e33402b2c009c7e2..754de3a79e1d8f9e8a5aabef78319958a1c37f72 100644
--- a/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 {
@@ -515,7 +515,13 @@ public abstract class PlayerList {
CompoundTag nbttagcompound1 = nbttagcompound.getCompound("RootVehicle");
// CraftBukkit start
ServerLevel finalWorldServer = worldserver1;

View File

@ -1376,10 +1376,10 @@ index 98fb69a9adeb6eaab199aec127692acb07f56808..7cc624505931dcb6696c3ef3ee3bbea7
label25:
{
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 39cbb724820a07778191b0421c9ded6a9af1ad04..3ec07e77748ee9bb21f9d09230f935bca2217e4d 100644
index 6b07179212ec0bdb6b68294c996b9dfee8fc81cb..d6a7188227cee9072976db98613324ee2d3dcdc8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1582,6 +1582,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1592,6 +1592,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Folia start - region threading
public void tickServer(long startTime, long scheduledEnd, long targetBuffer,
io.papermc.paper.threadedregions.TickRegions.TickRegionData region) {
@ -1387,7 +1387,7 @@ index 39cbb724820a07778191b0421c9ded6a9af1ad04..3ec07e77748ee9bb21f9d09230f935bc
if (region != null) {
region.world.getCurrentWorldData().updateTickData();
if (region.world.checkInitialised.get() != ServerLevel.WORLD_INIT_CHECKED) {
@@ -1616,10 +1617,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1626,10 +1627,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Folia start - region threading
if (region != null) {
@ -1404,7 +1404,7 @@ index 39cbb724820a07778191b0421c9ded6a9af1ad04..3ec07e77748ee9bb21f9d09230f935bc
for (Entity entity : region.world.getCurrentWorldData().getLocalEntitiesCopy()) {
if (!io.papermc.paper.util.TickThread.isTickThreadFor(entity) || entity.isRemoved()) {
continue;
@@ -1627,8 +1634,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1637,8 +1644,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
org.bukkit.craftbukkit.entity.CraftEntity bukkit = entity.getBukkitEntityRaw();
if (bukkit != null) {
bukkit.taskScheduler.executeTick();
@ -1416,7 +1416,7 @@ index 39cbb724820a07778191b0421c9ded6a9af1ad04..3ec07e77748ee9bb21f9d09230f935bc
}
// Folia end - region threading
@@ -1648,6 +1658,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1658,6 +1668,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
this.profiler.push("save");
final boolean fullSave = autosavePeriod > 0 && io.papermc.paper.threadedregions.RegionizedServer.getCurrentTick() % autosavePeriod == 0; // Folia - region threading
@ -1424,7 +1424,7 @@ index 39cbb724820a07778191b0421c9ded6a9af1ad04..3ec07e77748ee9bb21f9d09230f935bc
try {
this.isSaving = true;
if (playerSaveInterval > 0) {
@@ -1661,6 +1672,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1671,6 +1682,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} finally {
this.isSaving = false;
}
@ -1432,7 +1432,7 @@ index 39cbb724820a07778191b0421c9ded6a9af1ad04..3ec07e77748ee9bb21f9d09230f935bc
this.profiler.pop();
// Paper end - Incremental chunk and player saving
io.papermc.paper.util.CachedLists.reset(); // Paper
@@ -1725,6 +1737,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1735,6 +1747,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void tickChildren(BooleanSupplier shouldKeepTicking, io.papermc.paper.threadedregions.TickRegions.TickRegionData region) { // Folia - region threading
@ -1440,7 +1440,7 @@ index 39cbb724820a07778191b0421c9ded6a9af1ad04..3ec07e77748ee9bb21f9d09230f935bc
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
entityplayer.connection.suspendFlushing();
@@ -1791,12 +1804,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1801,12 +1814,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try {
worldserver.timings.doTick.startTiming(); // Spigot
@ -1455,7 +1455,7 @@ index 39cbb724820a07778191b0421c9ded6a9af1ad04..3ec07e77748ee9bb21f9d09230f935bc
worldserver.timings.doTick.stopTiming(); // Spigot
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
@@ -1814,7 +1829,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1824,7 +1839,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.popPush("connection");
MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper
if (region == null) this.getConnection().tick(); // Folia - region threading
@ -1466,7 +1466,7 @@ index 39cbb724820a07778191b0421c9ded6a9af1ad04..3ec07e77748ee9bb21f9d09230f935bc
this.profiler.popPush("players");
MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 6aa8595c22ac933a79b25c7bb159343365b70f26..21ec49acb3c1241d9286959c42a7f8363f637e4f 100644
index d45f4efd66380ace44fb0aa3f8a2569dc702e1aa..30aa7891292da87092724e0e046a08e500dd22ca 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -463,16 +463,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -1635,7 +1635,7 @@ index d532043f33825ce2971d9e53f290cdead22d6916..74483543836d9ed042cc7b9cbbde8d58
// Folia end - region threading
// 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
index a74538bdc720efc435e7890aa835c9f255f9ebb6..ec25610cbffe30fecaeaadf9098e187bc15b5405 100644
index f72e3d2decf8eb2a5a802bb1c6c8aa29e08912cf..81749b8da7182abd1bf35629f33388e813dbeac0 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -891,6 +891,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -1651,11 +1651,11 @@ index a74538bdc720efc435e7890aa835c9f255f9ebb6..ec25610cbffe30fecaeaadf9098e187b
j = regionizedWorldData.getRedstoneGameTime(); // Folia - region threading
gameprofilerfiller.push("blockTicks");
+ profiler.startTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.BLOCK_TICK); try { // Folia - profiler
regionizedWorldData.getBlockLevelTicks().tick(j, 65536, this::tickBlock); // Folia - region ticking
regionizedWorldData.getBlockLevelTicks().tick(j, paperConfig().environment.maxBlockTicks, this::tickBlock); // Paper - configurable max block ticks // Folia - region ticking
+ } finally { profiler.stopTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.BLOCK_TICK); } // Folia - profiler
gameprofilerfiller.popPush("fluidTicks");
+ profiler.startTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.FLUID_TICK); try { // Folia - profiler
regionizedWorldData.getFluidLevelTicks().tick(j, 65536, this::tickFluid); // Folia - region ticking
regionizedWorldData.getFluidLevelTicks().tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks // Folia - region ticking
+ } finally { profiler.stopTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.FLUID_TICK); } // Folia - profiler
gameprofilerfiller.pop();
}
@ -1779,10 +1779,10 @@ index a74538bdc720efc435e7890aa835c9f255f9ebb6..ec25610cbffe30fecaeaadf9098e187b
} else {
passenger.stopRiding();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index b19f1db38e71d9185cca9fc0e44937f91443a042..d13edeff0de64cb77d7668e5b964cabcf9729388 100644
index 754de3a79e1d8f9e8a5aabef78319958a1c37f72..c8f8d41da92c08032ac3f78e002d081d6cd0b763 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1327,6 +1327,7 @@ public abstract class PlayerList {
@@ -1328,6 +1328,7 @@ public abstract class PlayerList {
public void saveAll(int interval) {
io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
@ -1790,7 +1790,7 @@ index b19f1db38e71d9185cca9fc0e44937f91443a042..d13edeff0de64cb77d7668e5b964cabc
MinecraftTimings.savePlayers.startTiming(); // Paper
int numSaved = 0;
long now = System.nanoTime(); // Folia - region threading
@@ -1338,7 +1339,9 @@ public abstract class PlayerList {
@@ -1339,7 +1340,9 @@ public abstract class PlayerList {
}
// Folia end - region threading
if (interval == -1 || now - entityplayer.lastSave >= timeInterval) { // Folia - region threading
@ -1832,10 +1832,10 @@ index 09e8445a3f8c6b3ebc852a75a9a25b41a51ba659..f921c159c4f7556daf3c8405241de360
this.factory = factory;
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
index de7c06785e3914fe7181bcb836b70a96a4900011..bc38893427cbe560ffea30996a391b7ba97f9d5c 100644
index 55f4fc731b5bde0bbac681a0902af1506ad87762..a9921af214c596ef2601ccdbf37b4234bcf4ea1d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -223,6 +223,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -232,6 +232,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return this.getCurrentWorldData().getLocalPlayers();
}
// Folia end - region ticking
@ -1845,7 +1845,7 @@ index de7c06785e3914fe7181bcb836b70a96a4900011..bc38893427cbe560ffea30996a391b7b
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
@@ -315,6 +318,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -324,6 +327,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.minSection = io.papermc.paper.util.WorldUtil.getMinSection(this);
this.maxSection = io.papermc.paper.util.WorldUtil.getMaxSection(this);
// Paper end - optimise collisions
@ -1855,7 +1855,7 @@ index de7c06785e3914fe7181bcb836b70a96a4900011..bc38893427cbe560ffea30996a391b7b
}
// Paper start - Cancel hit for vanished players
@@ -1299,17 +1305,21 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1308,17 +1314,21 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
protected void tickBlockEntities() {
@ -1877,7 +1877,7 @@ index de7c06785e3914fe7181bcb836b70a96a4900011..bc38893427cbe560ffea30996a391b7b
// Spigot start
// Iterator<TickingBlockEntity> iterator = this.blockEntityTickers.iterator();
boolean flag = this.tickRateManager().runsNormally();
@@ -1336,6 +1346,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1345,6 +1355,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
}
blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075 // Folia - regionised ticking

View File

@ -21,7 +21,7 @@ added to the tracker is just easier to do, so that is what
this patch does.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 21ec49acb3c1241d9286959c42a7f8363f637e4f..79e507c1463dbb9039b1fed8bdf41c0ee5f4fec3 100644
index 30aa7891292da87092724e0e046a08e500dd22ca..6ab9f83786dcfbd3156d2f2bd6da57baed1399f4 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1419,6 +1419,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider