diff --git a/build.gradle.kts b/build.gradle.kts index c896e45586..bf08d00038 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { java `maven-publish` id("com.github.johnrengelman.shadow") version "8.1.1" apply false - id("io.papermc.paperweight.patcher") version "1.5.7" + id("io.papermc.paperweight.patcher") version "1.5.8" } val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" diff --git a/gradle.properties b/gradle.properties index 07cdbaa12b..fdc5b493d4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=dev.folia version=1.20.2-R0.1-SNAPSHOT mcVersion=1.20.2 -paperRef=99b735c1acd147be05bf1ede13ec757b1a624342 +paperRef=e57af7d01e509c747520cc1037169029256289bf org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch index 81a13fc382..72c31de25a 100644 --- a/patches/server/0001-Build-changes.patch +++ b/patches/server/0001-Build-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Build changes diff --git a/build.gradle.kts b/build.gradle.kts -index c187641f0ec6444a10e0e1583e1697d07e8f0267..0dbcd376ab443af4853f0a02612866d71c5e9164 100644 +index a79461457ea19339f47572c70705d655ebc55276..b62a25bd32b7976dd00f53521d0e050d60c34ca7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { @@ -23,7 +23,7 @@ index c187641f0ec6444a10e0e1583e1697d07e8f0267..0dbcd376ab443af4853f0a02612866d7 // Paper start implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("net.minecrell:terminalconsoleappender:1.3.0") -@@ -72,7 +76,7 @@ tasks.jar { +@@ -70,7 +74,7 @@ tasks.jar { attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", "Implementation-Title" to "CraftBukkit", @@ -32,7 +32,7 @@ index c187641f0ec6444a10e0e1583e1697d07e8f0267..0dbcd376ab443af4853f0a02612866d7 "Implementation-Vendor" to date, // Paper "Specification-Title" to "Bukkit", "Specification-Version" to project.version, -@@ -156,7 +160,7 @@ fun TaskContainer.registerRunTask( +@@ -154,7 +158,7 @@ fun TaskContainer.registerRunTask( name: String, block: JavaExec.() -> Unit ): TaskProvider = register(name) { diff --git a/patches/server/0003-Threaded-Regions.patch b/patches/server/0003-Threaded-Regions.patch index 440c10988f..419967a615 100644 --- a/patches/server/0003-Threaded-Regions.patch +++ b/patches/server/0003-Threaded-Regions.patch @@ -13993,7 +13993,7 @@ index 17610196db7a1c6feb2cf74a02479a8691aa323f..32fdb3d70442257201472f9f1c1ad466 for (ServerPlayer player : ServerLevel.this.players) { player.getBukkitEntity().onEntityRemove(entity); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 76157319b79d7fefe38cb2cc10b2d79c12667e3d..3c09a5d7f1fc25419503bdc46593ef30b44318a3 100644 +index ba972d1661426d7e30f6f61bad3b9608e66ea721..f490bf6a1caed16fd4238ead6565fc5a7ec219bf 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -185,7 +185,7 @@ import org.bukkit.inventory.MainHand; @@ -14537,7 +14537,7 @@ index 76157319b79d7fefe38cb2cc10b2d79c12667e3d..3c09a5d7f1fc25419503bdc46593ef30 // CraftBukkit end if (this.isSleeping()) return this; // CraftBukkit - SPIGOT-3154 // this.isChangingDimension = true; // CraftBukkit - Moved down and into PlayerList#changeDimension -@@ -2127,6 +2563,12 @@ public class ServerPlayer extends Player { +@@ -2132,6 +2568,12 @@ public class ServerPlayer extends Player { public void setCamera(@Nullable Entity entity) { Entity entity1 = this.getCamera(); @@ -14550,7 +14550,7 @@ index 76157319b79d7fefe38cb2cc10b2d79c12667e3d..3c09a5d7f1fc25419503bdc46593ef30 this.camera = (Entity) (entity == null ? this : entity); if (entity1 != this.camera) { // Paper start - Add PlayerStartSpectatingEntityEvent and PlayerStopSpectatingEntity Event -@@ -2625,7 +3067,7 @@ public class ServerPlayer extends Player { +@@ -2630,7 +3072,7 @@ public class ServerPlayer extends Player { this.experienceLevel = this.newLevel; this.totalExperience = this.newTotalExp; this.experienceProgress = 0; @@ -14889,7 +14889,7 @@ index 79326308f6126f84a3cbb3d5a33302de048d8a50..81090d1b5d67506268a41c6387a1d453 Collections.shuffle( this.connections ); } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 8bd243a8d5a4be54f907af2b02e96ea833cee62f..10ce902a1ce857db5376c8318ba0e67b53883873 100644 +index 34fcdeb0f4039f1fc6c4c8c593cc615560af1ba2..14eca10ba81242ec16c77cf69cfee0ffa7363fbc 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -289,7 +289,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -15347,7 +15347,7 @@ index 8bd243a8d5a4be54f907af2b02e96ea833cee62f..10ce902a1ce857db5376c8318ba0e67b this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH); if (this.server.isHardcore()) { this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper -@@ -3192,7 +3279,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3191,7 +3278,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Paper start if (!org.bukkit.Bukkit.isPrimaryThread()) { if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { @@ -15356,7 +15356,7 @@ index 8bd243a8d5a4be54f907af2b02e96ea833cee62f..10ce902a1ce857db5376c8318ba0e67b return; } } -@@ -3361,7 +3448,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3360,7 +3447,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.filterTextPacket(list).thenAcceptAsync((list1) -> { this.updateSignText(packet, list1); @@ -17130,7 +17130,7 @@ index f20ae9153b7098980ce6c0e75fcbbb4da652661b..47061546345d0f367aa64c2d562a5350 /** * Invoked only when the entity is truly removed from the server, never to be added to any world. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 77a1c7dfbaccc2e74da5c78ce4dfcd1717a7ac65..4a74eb831a24d2b0df613620e8ca16501c9f88b0 100644 +index b95f88d5e5b4785ee063695fd81935636a0588d1..768f7463775dd59d96196fbe789f628036d95fd5 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -276,6 +276,13 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -17203,7 +17203,7 @@ index 77a1c7dfbaccc2e74da5c78ce4dfcd1717a7ac65..4a74eb831a24d2b0df613620e8ca1650 } public final float getMaxHealth() { -@@ -3465,7 +3475,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3472,7 +3482,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.pushEntities(); this.level().getProfiler().pop(); // Paper start @@ -17212,7 +17212,7 @@ index 77a1c7dfbaccc2e74da5c78ce4dfcd1717a7ac65..4a74eb831a24d2b0df613620e8ca1650 if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { Location from = new Location(this.level().getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO); Location to = new Location (this.level().getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot()); -@@ -4159,7 +4169,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4166,7 +4176,7 @@ public abstract class LivingEntity extends Entity implements Attackable { BlockPos blockposition = BlockPos.containing(d0, d1, d2); Level world = this.level(); @@ -17729,7 +17729,7 @@ index 759ecd79534a7706f7d4a63eb9dacbefcfe54674..0344b1f77f23274c2932b5dce01b0ea6 }); diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index 9105418b29c89f092378da11b14e3d324332a2ba..31b59d7d439dbbd79605e5d078cbc9131b786ad9 100644 +index e6f75a9cac46c8e3ddba664a9d5b27b665a94cb4..8e348099d6b3eb4510405d76453d70e7cadeebf6 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -295,9 +295,9 @@ public class FallingBlockEntity extends Entity { @@ -22305,7 +22305,7 @@ index cd4ad8261e56365850068db1d83d6a8454026737..78f7e72f2912dae503c2dab7d1992b65 List offers = waitable.get(); if (offers == null) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 315d8260e196709ed9084272aa640f11e327c0a8..1b4926c62e93158180714f58cafb31d9e365f6b3 100644 +index f7ebddd35ff5a60a81034fd7de035ebba83e9517..bdb0198a609028d45501f98d4df62f3a227a25d2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -581,6 +581,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -22338,7 +22338,7 @@ index 315d8260e196709ed9084272aa640f11e327c0a8..1b4926c62e93158180714f58cafb31d9 if (entityTracker == null) { return; -@@ -1357,30 +1362,43 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1361,30 +1366,43 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { Preconditions.checkArgument(location != null, "location"); location.checkFinite(); Location locationClone = location.clone(); // clone so we don't need to worry about mutations after this call. @@ -22567,10 +22567,10 @@ index d7ce4971d9271dbeff4adb9d852e4e7bdf60bf03..eb84a8dd97f92de4a7dd3826d9e124a4 if (!this.isAsyncScheduler && !task.isSync()) { this.asyncScheduler.handle(task, delay); diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 96f6e0554baf5915dd1f5b93f3bcfe7a13393c29..17c5ef57bed41fca97b845f1f6d1752a53a1121f 100644 +index 806fb1064a1769d1251f2a2b04372275754d2aeb..41333c019e005821e4a180f6489538be9359167d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -355,6 +355,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -365,6 +365,12 @@ public final class CraftMagicNumbers implements UnsafeValues { String minimumVersion = MinecraftServer.getServer().server.minimumAPI; int minimumIndex = CraftMagicNumbers.SUPPORTED_API.indexOf(minimumVersion); diff --git a/patches/server/0006-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch b/patches/server/0006-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch index 2fa392d1f0..63e5cd0fe2 100644 --- a/patches/server/0006-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch +++ b/patches/server/0006-Make-CraftEntity-getHandle-and-overrides-perform-thr.patch @@ -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 -index 1b4926c62e93158180714f58cafb31d9e365f6b3..ca87a47afa4260d2dfc4f0010843aa0f4b7b6e9c 100644 +index bdb0198a609028d45501f98d4df62f3a227a25d2..d584c168b5523fda4ebc823f956895178c4b8d13 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -826,7 +826,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -981,7 +981,7 @@ index 26c795983515580b30b5ef8c701faa95ab1aea8e..990709bd56a96a60df020947f99b4f30 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java -index a39694a27e362312eb42a29fd7c833f9c7437d46..ede9068881ea75449ca24bff66ef754a2c17b152 100644 +index a8bed9c1d129ac31486af8b65e26aa245920d6b5..d2cf436c76d9ed0db0c95aafa1df22386fa09515 100644 --- a/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 { @@ -1002,12 +1002,12 @@ index a39694a27e362312eb42a29fd7c833f9c7437d46..ede9068881ea75449ca24bff66ef754a } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java -index e04500dcdc5b72cca7ac81b5d12e76822db9c8c5..f62d88821164ad2fac8d53598bcf1e1b6d350225 100644 +index 22d59ca52229dc566b8dfb460b92ecd6318e6db0..e80426bfcd55e9b2d308eb43b6ec4488668f9dbe 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java -@@ -46,8 +46,16 @@ public class CraftFireball extends AbstractProjectile implements Fireball { - update(); // SPIGOT-6579 +@@ -58,8 +58,16 @@ public class CraftFireball extends AbstractProjectile implements Fireball { } + // Paper end + // Folia start - region threading + @Override @@ -1485,10 +1485,10 @@ index 787f91566fc53c2b4aeba1ec10d8f46ccf15cbe6..eb2b4272b09e5df06e49afc2ccf7063e } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java -index 4dbe8af49fcb4d2c2f517083c013d83f64225b4b..3ef7e3eac107890af5f67a8d02dd6664d35f88b7 100644 +index 58489a6a34e66cd6fc0d0e28141a3ebc32ac0e05..3ee9c2e5f66026375a88bcfcb6b46fbd43770309 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java -@@ -155,8 +155,16 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame { +@@ -157,8 +157,16 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame { this.getHandle().fixed = fixed; } @@ -1569,7 +1569,7 @@ index ef5a5aed9e1b15a29fd3a97ccd502c40b1d865ac..d6e78621601f1553c267f25c527242c8 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index fe2124694eb080cab685a1ce1f6a66e2fcdf6a17..28062755016008d0796676119fdd53d4a3947e20 100644 +index daadfec2d86f7957072a639e1e36d4082448f35f..666742df2f0547922ad40c38821c9fc70b654d24 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -417,6 +417,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/patches/server/0013-Skip-worldstate-access-when-waking-players-up-during.patch b/patches/server/0013-Skip-worldstate-access-when-waking-players-up-during.patch index ac35092945..421dcb77c0 100644 --- a/patches/server/0013-Skip-worldstate-access-when-waking-players-up-during.patch +++ b/patches/server/0013-Skip-worldstate-access-when-waking-players-up-during.patch @@ -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. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 3c09a5d7f1fc25419503bdc46593ef30b44318a3..42ff3d94ee451ced69c1059f0dbd45085489a60d 100644 +index f490bf6a1caed16fd4238ead6565fc5a7ec219bf..62a98ba81cbe89622dd6a545146ff52aa57de880 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -637,7 +637,7 @@ public class ServerPlayer extends Player { @@ -22,10 +22,10 @@ index 3c09a5d7f1fc25419503bdc46593ef30b44318a3..42ff3d94ee451ced69c1059f0dbd4508 // 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 4a74eb831a24d2b0df613620e8ca16501c9f88b0..70053da7f8a6275631ef2d204f318385b95993ab 100644 +index 768f7463775dd59d96196fbe789f628036d95fd5..f0abf40c73575537597571e94555e3c72edbbb5d 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -4343,6 +4343,11 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4350,6 +4350,11 @@ public abstract class LivingEntity extends Entity implements Attackable { } });