Skip to content

Commit

Permalink
Rebuild Patches
Browse files Browse the repository at this point in the history
  • Loading branch information
killerprojecte committed Aug 11, 2023
2 parents c4d50b6 + f6e91e9 commit c98e6e2
Show file tree
Hide file tree
Showing 37 changed files with 5,854 additions and 622 deletions.
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.20.1-R0.1-SNAPSHOT
mcVersion=1.20.1
paperRef=d7d3f6371e15f68bbbfc70d567552d426563acfb
paperRef=4179b8f3fa86437aa1d9742930fd8ca6d23515a0

org.gradle.caching=true
org.gradle.parallel=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 b243db56756c67cd2c41d7768898d01539f9260a..fd5ed5d6725537c26e6139dd6242c4154b306a97 100644
index f380a518bc444bfdfbbedf38805c7684e53a5629..c54d5f254a4e7055470a4868187de3a18c21d0e5 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2657,6 +2657,14 @@ public final class Bukkit {
@@ -2709,6 +2709,14 @@ public final class Bukkit {
return server.isOwnedByCurrentRegion(entity);
}
// Paper end - Folia region threading API
Expand All @@ -30,10 +30,10 @@ index b243db56756c67cd2c41d7768898d01539f9260a..fd5ed5d6725537c26e6139dd6242c415
@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 6b72eccdcb6f75534a4267a1dd0a4cc2f39e917b..57d4789c1eb00cb376adce31ece2b6672c4a12a9 100644
index 68206cf0178c26c0f528a1e14a5fb4e9ad410369..f77553fc70bc1f3f18af50e53c0041bbaaebab9a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2313,4 +2313,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2364,4 +2364,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
// Paper end - Folia region threading API
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0001-Build-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Build changes


diff --git a/build.gradle.kts b/build.gradle.kts
index 57f2c414dbfe127c193002fbc8eeb22e94e9cb55..93f9abd2169a48a4fd32f712c68be7b49b034e83 100644
index fb98936bb8a5488db75d676c5bcb4060597fbbf8..9ee90bc753e65f9dd532f28ec75cc16bf16486c8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
Expand Down Expand Up @@ -106,10 +106,10 @@ index 3238cbcba567b1242c77e41f6b6f19a8d157fb4e..f2bda376d64296cf41e44b03e83bc6fe

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 a05c1bc8874ef5e380544a6a344c848e37da49c4..50f75400e59a5d917416f284ecc5a1f77896113f 100644
index 249d76acac9a91cd46f0b8a477511974a75d6f4a..15b17004cd1430131caf36423d3fd1461f47b029 100644
--- a/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
@@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper

public final class CraftServer implements Server {
Expand Down
453 changes: 274 additions & 179 deletions patches/server/0003-Threaded-Regions.patch

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion patches/server/0004-Max-pending-logins.patch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ index 2e96377d628b3a07fb565020074d665f594f32e8..75b1877f8c3e4da3183437f327ef3376
} // Folia - region threading - remove delayed accept

diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9aa12c2ae7d86604583e98ba9872ad613882c867..39d404c278bdc1227cb806bb257492493d05a439 100644
index a4bf2bd466bbe306b6ecec43c8bd797ebfdc34c5..92b30f5b61d1025d526c8bd7b820f83037fe8510 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -180,6 +180,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..519da6886613b8460e989767b1a21e31
}

diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 27475335c6e340de6fdd690bb19829afcd257bf6..ee15661227754149164893d6acf678d13b2e1b27 100644
index 6b101ccddc811483cc1b8652685313baa06cae30..8b28f6fed78cbad95b7943efb05099edd9eeed57 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2820,6 +2820,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2819,6 +2819,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
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());
@@ -2841,6 +2842,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2840,6 +2841,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (event.isCancelled()) {
return false;
}
+ } // Folia - region threading - suppress entire event logic during worldgen
// Spigot end
if (this.isPassenger()) {
this.stopRiding();
@@ -2923,6 +2925,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2922,6 +2924,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
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) {
@@ -2950,6 +2953,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2949,6 +2952,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (event.isCancelled()) {
return false;
}
Expand Down Expand Up @@ -246,7 +246,7 @@ index 56bc26f227b97e8e935a20c6393d3f2eb806b285..5cf8ea3a7dd4e8ea96ca6061aa1aaefc
}

diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java
index 3034a3902a946162f48840682d434e554de4eae9..f67a9f77039c29daac80359e2793bee4baf3b3c4 100644
index c73a9c930c6fa3a7b85986048dca8dc11aa05238..fb5df44773c478c1418a63429b15b96e2efd5f9a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java
@@ -26,8 +26,16 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
Expand Down Expand Up @@ -1359,7 +1359,7 @@ index 794dc15d5e09d0b73b2d297a2da60d2b6b407f6c..a34608c74daced31ec45a96b643176a4
}

diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 0f3e696582cd288357598490e8af0131ab30bdfc..07347858bff8a764a140cb3fbd484301803cfa00 100644
index 5fe9a0985432ac6cdd28a2a138854a24f10e42ba..16cf9cd20b400cdadac89152bdafd64b4e207a5e 100644
--- a/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 {
Expand Down Expand Up @@ -2109,10 +2109,10 @@ index beea227855f0b978e655efc298024120df8f4945..e1b7922ed298b6b3068c3f5fbe3b4030
}

diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b291941717b6f9e1bed2c8e89bdd15200f8b8699..66f4e0578e7682d732ba4b36f5c3344d1d0e3d68 100644
index 1da2e14d6fa557625835af7a3f003c4e9bb0f40e..36fc7444514a82532731026a0c4402d2ec04e9d2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -600,7 +600,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -602,7 +602,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

@Override
public void kick(net.kyori.adventure.text.Component message, org.bukkit.event.player.PlayerKickEvent.Cause cause) {
Expand All @@ -2121,7 +2121,7 @@ index b291941717b6f9e1bed2c8e89bdd15200f8b8699..66f4e0578e7682d732ba4b36f5c3344d
final ServerGamePacketListenerImpl connection = this.getHandle().connection;
if (connection != null) {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message, cause);
@@ -2054,9 +2054,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2086,9 +2086,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this;
}

Expand All @@ -2139,7 +2139,7 @@ index b291941717b6f9e1bed2c8e89bdd15200f8b8699..66f4e0578e7682d732ba4b36f5c3344d
}

public void setHandle(final ServerPlayer entity) {
@@ -3061,7 +3068,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3093,7 +3100,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
{
if ( CraftPlayer.this.getHealth() <= 0 && CraftPlayer.this.isOnline() )
{
Expand Down Expand Up @@ -2717,7 +2717,7 @@ index 428437970cac144be53cd0e30af7af0cd1ce603b..dc09e141ba2b12f1955bec521f2170d2
}

diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java
index 99096c1e3f045e4a99335faedfb8e77e99690299..616848bf66273048dfde1f8802582fb871f8a5bb 100644
index 7bfb83d3ac38c5c270d77d9794a55a363ac6302b..f973d6013eef71025fad3b74d6158561aafe508f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java
@@ -14,8 +14,16 @@ public class CraftTextDisplay extends CraftDisplay implements TextDisplay {
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 c9ee1662ab2bff205b509554f0883658682e87c8..23556931a812ed9b2dac5b4b4712961c2d9aa025 100644
index deb6836d57ae5bc5fed74fd9290c5a3abdc7f8ea..9485d754ec6ce4031d88734e327abda240d9db90 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1271,6 +1271,7 @@ public final class CraftServer implements Server {
@@ -1284,6 +1284,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");
@@ -1412,6 +1413,7 @@ public final class CraftServer implements Server {
@@ -1425,6 +1426,7 @@ public final class CraftServer implements Server {

@Override
public boolean unloadWorld(World world, boolean save) {
Expand All @@ -25,7 +25,7 @@ index c9ee1662ab2bff205b509554f0883658682e87c8..23556931a812ed9b2dac5b4b4712961c
if (world == null) {
return false;
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
index 13190c4265bb83e682dede7e982ebcd19d80e334..351667dea3882a71dbd14cc57692ffc3e7c4d43f 100644
index a8c5bfc54ed2b8bd873f124c7080d73fe73a86ad..f59e9e6dd21a7d034b5e3b6e7787458d3c3c7bbc 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
@@ -43,6 +43,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
Expand All @@ -39,21 +39,21 @@ index 13190c4265bb83e682dede7e982ebcd19d80e334..351667dea3882a71dbd14cc57692ffc3
@@ -198,6 +199,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {

@Override
public Team registerNewTeam(String name) throws IllegalArgumentException {
public Team registerNewTeam(String name) {
+ if (true) throw new UnsupportedOperationException(); // Folia - not supported yet
Preconditions.checkArgument(name != null, "Team name cannot be null");
Preconditions.checkArgument(name.length() <= Short.MAX_VALUE, "Team name '%s' is longer than the limit of 32767 characters (%s)", name, name.length());
Preconditions.checkArgument(this.board.getPlayerTeam(name) == null, "Team name '%s' is already in use", name);
@@ -225,6 +227,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {

@Override
public void clearSlot(DisplaySlot slot) throws IllegalArgumentException {
public void clearSlot(DisplaySlot slot) {
+ if (true) throw new UnsupportedOperationException(); // Folia - not supported yet
Preconditions.checkArgument(slot != null, "Slot cannot be null");
this.board.setDisplayObjective(CraftScoreboardTranslations.fromBukkitSlot(slot), null);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
index 7674939964894a56ce495e47d400cbf12cd0475b..92a2115035e2f13b2c3bd90bd5eed23e7a37bf62 100644
index 500f2eb0df5a07637cd278c263e95592b0037eb6..7ab760a57d1305bc4dccec97526328972c2ddfc3 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
@@ -42,6 +42,7 @@ public final class CraftScoreboardManager implements ScoreboardManager {
Expand All @@ -67,7 +67,7 @@ index 7674939964894a56ce495e47d400cbf12cd0475b..92a2115035e2f13b2c3bd90bd5eed23e
@@ -68,6 +69,7 @@ public final class CraftScoreboardManager implements ScoreboardManager {

// CraftBukkit method
public void setPlayerBoard(CraftPlayer player, org.bukkit.scoreboard.Scoreboard bukkitScoreboard) throws IllegalArgumentException {
public void setPlayerBoard(CraftPlayer player, org.bukkit.scoreboard.Scoreboard bukkitScoreboard) {
+ if (true) throw new UnsupportedOperationException(); // Folia - not supported yet
Preconditions.checkArgument(bukkitScoreboard instanceof CraftScoreboard, "Cannot set player scoreboard to an unregistered Scoreboard");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Work around https://github.com/PaperMC/paperweight/issues/194


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index dee7813af91d6729060cbe44d81569a66563357d..b2feaea169fa9d3977c3dfdfdf3dea9283f5d854 100644
index d4111fe99be800a87f0a7b2575a0e7ea861d7be9..88c57c1ef147045315e923a5ba3b6f9394900f92 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -504,7 +504,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -506,7 +506,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s), cause);
}

Expand Down
2 changes: 1 addition & 1 deletion patches/server/0012-Lag-compensate-block-breaking.patch
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ index 41db6c61de36ebb1c214423dca0ba6a0c5a95cc1..65c4e158d81ac5c5788cf4dcb379061a

// connections
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 8b685377b8cc2d36f1fb7ec05c72f2240e3f2d80..d6aba41ee2919942fe895db15fb9b19721bce618 100644
index 73dbc9384119856b93665562611bf15ca6a41e03..3a77c591242a38d9a11246b625147219049c1153 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -124,7 +124,7 @@ public class ServerPlayerGameMode {
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 c28e974ea43e69e1e7d608785299d74317c83920..8cf4428d8140fd03f0ad8fa1d148a04d8caefda8 100644
index 53b51bab52c8bf1becc98916e5a25f7860bb8874..4338b948a53d32cac5c780cbd43c6ca1cc5d11e5 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1343,7 +1343,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1345,7 +1345,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
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 7c4ec191dc64968d349b244818f65c64ba7ab308..c0ad878cd29e2f72b7899d9539031b15ccbf6193 100644
index c85192fae74c97fc790b8eb613a5dcda99058b59..cf18ea69915fd195e1ea4b8840d528a643ff8b8a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -629,7 +629,7 @@ public class ServerPlayer extends Player {
Expand Down
Loading

0 comments on commit c98e6e2

Please sign in to comment.