Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/1.21.1 #1

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import io.papermc.paperweight.tasks.RebuildGitPatches
plugins {
java
`maven-publish`
id("io.papermc.paperweight.patcher") version "1.7.1"
id("io.papermc.paperweight.patcher") version "1.7.3"
}

val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group=dev.folia
version=1.21.1-R0.1-SNAPSHOT
mcVersion=1.21.1

paperRef=25621248d3f30f35c3458b4b13a2474ffd0bee0e
paperRef=14a48cda408dc49db65b345b2e02cd71d9a7aae9

org.gradle.caching=true
org.gradle.parallel=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ more helpful than some random error log caused by
a breakage.

diff --git a/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java b/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java
index bcf91d048d84144f6acf9bfd2095df9ada2e585f..3072f95dc1cafb47c1820dc67c8d24991540fc4a 100644
index 3c768d5ccf490e962d9638e92d4ea7c85670bad8..2dbc9fc268850c85e4e8d38da05586a004862c76 100644
--- a/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java
+++ b/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java
@@ -200,4 +200,12 @@ public interface PluginMeta {
@Nullable
String getAPIVersion();
@@ -183,4 +183,12 @@ public interface PluginMeta {
*/
@Nullable String getAPIVersion();

+ // Folia start - block plugins not marked as supported
+ /**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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 419c056faf0d49d9b0435feb01252e87e227b9a9..63eb35aebc4551355ea1ea5cd1305d93502f0dbc 100644
index e20e4239a5a1f952e1c70e899549989d5e42f73c..60ac226b58981155649b7d67c11385a0c105eca0 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2916,6 +2916,14 @@ public final class Bukkit {
Expand All @@ -30,7 +30,7 @@ index 419c056faf0d49d9b0435feb01252e87e227b9a9..63eb35aebc4551355ea1ea5cd1305d93
@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 5aa64ea39ebd92e5067c53cea49a8685c0b9eee4..8a7ba7d14f20b8169854daaf26e8f4da4563f166 100644
index 6246251caf2c6f025c824b8e7a944b8d48751fa1..10f6eb1756de71960f1c0565366d5f262c7641f1 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2554,4 +2554,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
Expand Down
673 changes: 337 additions & 336 deletions patches/server/0001-Build-changes.patch

Large diffs are not rendered by default.

730 changes: 296 additions & 434 deletions patches/server/0003-Threaded-Regions.patch

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions patches/server/0004-Max-pending-logins.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Max pending logins
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
index bc9956d36ce3adabd50dc4b6467a0fd24386e4e0..d0f8a81ed0363764d185682c3de667703d30e8eb 100644
index 9451cccebf7acee3bd9f28f4f9d60412d1554ff4..8098b1a447a7c054e15edc09d2fa50e48f73e926 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -112,7 +112,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -117,7 +117,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
if (this.server.getPlayerList().pushPendingJoin(name, uniqueId, this.connection)) {
// Folia end - region threading - rewrite login process
this.verifyLoginAndFinishConnectionSetup((GameProfile) Objects.requireNonNull(this.authenticatedProfile));
Expand All @@ -19,7 +19,7 @@ index bc9956d36ce3adabd50dc4b6467a0fd24386e4e0..d0f8a81ed0363764d185682c3de66770

// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 4e484a111fc8d7a98e89aa06042bcd1d61c8cfad..cc0c75340cc366f07a5bf169b4de50ba2d9ce366 100644
index 444f363e577344e962ffc515f6a052e349a0466d..7503afc82ec13a7f5732d32d70ce47900a747352 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -175,6 +175,17 @@ public abstract class PlayerList {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,34 @@ index 41bf71d116ffc5431586ce54abba7f8def6c1dcf..1cf9a7677449ab8f03fb23d835e3fadc
}

diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d1a8e8a7f03f1769431b6711cf842898e8c59aaa..0dce7e72a2c5f7360a43b662b43b47603e2aa213 100644
index 4aefadd491f1c0c541d23fcaeaf03fd2ae995f3e..2ccc358daae43dcebf03db64526f17fbd9df23f8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3044,6 +3044,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -3046,6 +3046,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (!force && (!this.canRide(entity) || !entity.canAddPassenger(this))) {
return false;
} else {
+ if (this.valid) { // Folia - region threading - suppress entire event logic during worldgen
// CraftBukkit start
if (entity.getBukkitEntity() instanceof Vehicle && this.getBukkitEntity() instanceof LivingEntity) {
VehicleEnterEvent event = new VehicleEnterEvent((Vehicle) entity.getBukkitEntity(), this.getBukkitEntity());
@@ -3065,6 +3066,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -3067,6 +3068,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return false;
}
// CraftBukkit end
+ } // Folia - region threading - suppress entire event logic during worldgen
if (this.isPassenger()) {
this.stopRiding();
}
@@ -3148,6 +3150,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -3150,6 +3152,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else {
// CraftBukkit start
+ if (this.valid) { // Folia - region threading - suppress entire event logic during worldgen
CraftEntity craft = (CraftEntity) entity.getBukkitEntity().getVehicle();
Entity orig = craft == null ? null : craft.getHandle();
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
@@ -3175,6 +3178,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -3177,6 +3180,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return false;
}
// CraftBukkit end
Expand Down Expand Up @@ -153,10 +153,10 @@ index 5beaa2bb0d58fe477ce8d2de8b77600d3b416d8c..c8406f2d83f4c8b60efec0de546f4576
}
// Paper end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
index 34e4c763c7ec971885147ab2509281fad56e1ca6..7fb2e28c12dba743d8c2fb0a8a4e2f3e76d151f6 100644
index 3199f04d00836a0a51547c679f3f3c80d00da502..a1959919109fe04d4b829dcd2d244842ab05fe13 100644
--- a/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
@@ -15,8 +15,16 @@ public class CraftAbstractVillager extends CraftAgeable implements CraftMerchant
super(server, entity);
}

Expand Down Expand Up @@ -979,7 +979,7 @@ index d657fd2c507a5b215aeab0a5f3e9c2ee892a27c8..399ef60ab5f1bf02b638c8c46a72d297
}

diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index f05e9a36cbb8476c355fc79da2c670c8a362cdb0..ed840f7c36265354ebf07c9fbe2c42155ea1fc4b 100644
index 88dd653f3c7871cae5983f4a0f62af0f3dd1bd99..7be80f2774b5ec3d0bede096da8f2b6d1cf7b09b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -498,7 +498,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
Expand Down Expand Up @@ -1441,10 +1441,10 @@ index 9b6ff0f64966c78a3233860bb0840182b52f01bc..fb34651a9e4ed0cb05721d15524a26f8
}

diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index c1bad887d1340ebc7c63fda3dceff929e4a44517..37c8bd3dc3e539ca92216ae5c2896b037d9af21e 100644
index 7dcfb45c24d7743956be514c7d554e06aac77b3e..6a052ed8d66a62b42c98a3b1d60263dd8018fed1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -290,8 +290,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -298,8 +298,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
this.mode = mode;
}

Expand Down Expand Up @@ -1677,10 +1677,10 @@ index e9f471e60af0725ec34e2985d63ae9ea9f88590a..cd824fc65ac2b1fe55710da4700f7c31
}

diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index beb6ad312028adb14053e3f019a4fcf6c9149373..90939123cd749321d3846f0970aa75417c1a0f52 100644
index 57b71a3894638253c6d24d4967a96768834bb02b..a82e2be0d104fefbf9a213256b82b3354fd1c098 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -477,6 +477,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -478,6 +478,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.getHandle().invulnerableTime = ticks;
}

Expand All @@ -1694,7 +1694,7 @@ index beb6ad312028adb14053e3f019a4fcf6c9149373..90939123cd749321d3846f0970aa7541
@Override
public int getNoActionTicks() {
return this.getHandle().getNoActionTime();
@@ -490,6 +497,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -491,6 +498,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

@Override
public net.minecraft.world.entity.LivingEntity getHandle() {
Expand Down Expand Up @@ -2234,7 +2234,7 @@ index 2638c341bc02f201f7ab17fdebcdbdf3a7ec05bf..074b2919be2b5544b0a46e6cd32f6c57
}

diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0e3eed03f307a414effdd30414b8d01797349908..28c6923c90ca106256ca75769828cd62d5542ca7 100644
index 149f442304b6af17b483822d4db1b8e760ecd556..12a2da086f249b3dbd61e5749b9856a2fce9ac7b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -669,7 +669,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Expand All @@ -2246,7 +2246,7 @@ index 0e3eed03f307a414effdd30414b8d01797349908..28c6923c90ca106256ca75769828cd62
final ServerGamePacketListenerImpl connection = this.getHandle().connection;
if (connection != null) {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message, cause);
@@ -2311,9 +2311,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2315,9 +2315,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ 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 454cac11619fc1e8317db0b95a174f6747af6e60..39e4493ef5c7d4bfd903da18b76e14235a535ab5 100644
index f9b399214848098149eb1f3a4043028d242dd454..dee23b4b96b7f2c6af54a6affe385b183479f8cc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1310,6 +1310,7 @@ public final class CraftServer implements Server {
@@ -1312,6 +1312,7 @@ public final class CraftServer implements Server {

@Override
public World createWorld(WorldCreator creator) {
+ if (true) throw new UnsupportedOperationException(); // Folia - not implemented properly yet
Preconditions.checkState(this.console.getAllLevels().iterator().hasNext(), "Cannot create additional worlds on STARTUP");
//Preconditions.checkState(!this.console.isIteratingOverLevels, "Cannot create a world while worlds are being ticked"); // Paper - Cat - Temp disable. We'll see how this goes.
Preconditions.checkArgument(creator != null, "WorldCreator cannot be null");
@@ -1488,6 +1489,7 @@ public final class CraftServer implements Server {
@@ -1490,6 +1491,7 @@ public final class CraftServer implements Server {

@Override
public boolean unloadWorld(World world, boolean save) {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0008-Fix-tests-by-removing-them.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Fix tests by removing them
We don't care about this one, some commands just need to be removed.

diff --git a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
index ca71c688b37ce2c8b712a4f9216cf872c8edf78e..d2298f423a289b8a4df815d04bd8218faafb5e30 100644
index 75ed5050f72c001d6eab117a2c0b352a413548bd..2b036e80fbc1c873b47fe947dee7175a93586a90 100644
--- a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
+++ b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
@@ -36,6 +36,7 @@ public class MinecraftCommandPermissionsTest extends AbstractTestingBase {
@@ -37,6 +37,7 @@ public class MinecraftCommandPermissionsTest {

@Test
public void test() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 b0ad25daf2d3c1727c61686e35eb4c03e1c60122..d963e8a6a498232a9ae760b2befaa17578a192f8 100644
index d518487433088f090edb0d12e222b85f0c93b792..db232ac0cc27ddff4bc25ba9b9a5f3a1996fc4e8 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1919,7 +1919,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1936,7 +1936,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
Direction enumdirection = (Direction) iterator.next();
BlockPos blockposition1 = pos.relative(enumdirection);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 9f379fd5f3999e64c9b37851316ecd9069e19201..d681ec617590a3718f926cd5a9749952d5ac52bd 100644
index 00b3c3c60f67d129058a888b7bd5e7fb031063da..e4a68f43c1a48fe8193623c646eb40bc5f664c76 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -709,7 +709,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
Expand All @@ -22,10 +22,10 @@ index 9f379fd5f3999e64c9b37851316ecd9069e19201..d681ec617590a3718f926cd5a9749952

// 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 6e2ce383bb4d52702dfcb8823ce0c5dce7c81b5f..bd544eee8d7439a466f0f82e7d7a51a63b7294c0 100644
index 551ad6757e76ec9c731488f0355d4950ad1b0bd4..9b8fd458c851d72901568845d973330ed58260a9 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -4448,6 +4448,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -4451,6 +4451,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
}

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index cc0c75340cc366f07a5bf169b4de50ba2d9ce366..5b68d16ef099285482e66a714d2e2f4c54e011ab 100644
index 7503afc82ec13a7f5732d32d70ce47900a747352..77164bd5d562a72d5936dc84a41071472421eeb5 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -516,7 +516,13 @@ public abstract class PlayerList {
Expand Down
Loading
Loading