Skip to content

Commit

Permalink
Update Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china authored and Lumine1909 committed Apr 21, 2024
1 parent 821385a commit 296d93a
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 56 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4
packageVersion=1_20_R3
org.gradle.jvmargs=-Xmx2G
paperRef=c5d168cef92148a6799141832fdb5f95732c1a38
paperRef=cde5587e58f08ce2d8875bb9d13a4be56825e353
preVersion=false
updatingMinecraft=false
16 changes: 8 additions & 8 deletions patches/server/0002-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ index 41ae5cccc1388c27a88ab9d142d3e4834c5ab97d..61e0e14b74c6585a9d157cae3db9c5c3
this.profiler.popPush("send chunks");
iterator = this.playerList.getPlayers().iterator();
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index b164b09c90b607262938f3c2552d6b5790c27786..b0708f5d72a31720e3696ee707ec21229672bcf0 100644
index 94b0bb1999b47f9777050753d6aff2bc4986d48c..d562b9ce89e510584cf8efc25302a18f6dbf2f2d 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -58,7 +58,6 @@ import org.apache.logging.log4j.Level;
Expand All @@ -1069,23 +1069,23 @@ index b164b09c90b607262938f3c2552d6b5790c27786..b0708f5d72a31720e3696ee707ec2122
import org.bukkit.event.server.ServerCommandEvent;
import org.bukkit.craftbukkit.util.Waitable; // Paper
import org.bukkit.event.server.RemoteServerCommandEvent;
@@ -485,7 +484,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -486,7 +485,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}

public void handleConsoleInputs() {
- MinecraftTimings.serverCommandTimer.startTiming(); // Spigot
// Paper start - Perf: use proper queue
ConsoleInput servercommand;
while ((servercommand = this.serverCommandQueue.poll()) != null) {
@@ -502,7 +500,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -503,7 +501,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
// CraftBukkit end
}

- MinecraftTimings.serverCommandTimer.stopTiming(); // Spigot
}

@Override
@@ -776,21 +773,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -777,21 +774,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}
// Paper start
command.set(event.getCommand());
Expand Down Expand Up @@ -1575,18 +1575,18 @@ index 6934e9dac0d69c043b73b7c46d59f2d39b37c67f..8e43a6817e9101b6dcc956e3b6f4bcff

} else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2562ea3b63b055319a775c12ff327d127f8039c3..f3b33fca6bc6c9c827cab78488b5aec782e92969 100644
index a7e40f72a3b56916620a7f089410ec3a6db0cffc..3ac6943913c887b14078aabb2581f7f16deb4b4a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2379,7 +2379,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2398,7 +2398,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

public void handleCommand(String s) { // Paper - private -> public
org.spigotmc.AsyncCatcher.catchOp("Command Dispatched Async: " + s); // Paper - Add async catcher
- co.aikar.timings.MinecraftTimings.playerCommandTimer.startTiming(); // Paper
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);

@@ -2389,20 +2388,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2408,20 +2407,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.cserver.getPluginManager().callEvent(event);

if (event.isCancelled()) {
Expand Down Expand Up @@ -2093,7 +2093,7 @@ index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..e9798517b9211c50a20ea5c69603aab3
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index ca5312febcdd467889ad725c0263367bc5fe69f6..e77482def28fbd930b49913fb68f48212bc9b4a8 100644
index 8036ed91714d638eb2a8e8c2bea4bf62bc18cb57..2a84a653f8b10525f9f6667273295cf92ed71cb1 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -212,7 +212,6 @@ public final class CraftMagicNumbers implements UnsafeValues {
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0005-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ index 61e0e14b74c6585a9d157cae3db9c5c3a69b393f..2cf51683978e72d552f9148a61070420
org.spigotmc.WatchdogThread.hasStarted = true; // Paper
Arrays.fill( this.recentTps, 20 );
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index b0708f5d72a31720e3696ee707ec21229672bcf0..129c2e6f0cc9d752e7ca5934e13e89358af39180 100644
index d562b9ce89e510584cf8efc25302a18f6dbf2f2d..1a610cd47fb26b70bc16078adc2c22acff6a9578 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -220,6 +220,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
Expand All @@ -31,18 +31,18 @@ index b0708f5d72a31720e3696ee707ec21229672bcf0..129c2e6f0cc9d752e7ca5934e13e8935

this.setPvpAllowed(dedicatedserverproperties.pvp);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6bcfd8a1170c3e629574239a0ddad35662eeb218..350830c4875a0834bb5e1d055eaa29f05e8b78b0 100644
index a3b7d9ef5d9149e04eb69ebc30b59fba3f8f49f0..61f3bf48558eb469778fd33f50de9d5b016bf700 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1064,6 +1064,7 @@ public final class CraftServer implements Server {
@@ -1069,6 +1069,7 @@ public final class CraftServer implements Server {
playerMetadata.removeAll(plugin);
}
// Paper end
+ top.leavesmc.leaves.LeavesConfig.init((File) console.options.valueOf("leaves-settings")); // Leaves - Server Config
this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
@@ -2995,6 +2996,14 @@ public final class CraftServer implements Server {
@@ -3000,6 +3001,14 @@ public final class CraftServer implements Server {
{
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
}
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0006-Leaves-Protocol-Core.patch
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ index af86f752c33a2990405fea058b7c41c437ba9d46..bada9fae1e7178162429e1f5a1608b9c
}

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9d50d30670d9ac0ffa74eb6da2e84b5bd069839c..3ab53e1eee43c048ec89f8bda610e35efa5a52aa 100644
index 2cf51683978e72d552f9148a610704202d207df5..77e952a502bebfb31311b47ceed0b88118278d4a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1717,6 +1717,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand Down Expand Up @@ -56,7 +56,7 @@ index 0306771b8f90dcdd77f151c19c6c2d75c41f8feb..8aa1337b420e1c9fbf51f951f14a63d8
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 257b4fd11d398513a61485ab2019b30eb0d2c9ac..753c10ca9e802e11f5b9b03b5df8e047f14aece2 100644
index 6104f952b9138b0030aebd23c23fdeccc88e567d..6d4f175e2820b48d04bd11fc694fcdfc73580da9 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -346,6 +346,8 @@ public abstract class PlayerList {
Expand All @@ -77,7 +77,7 @@ index 257b4fd11d398513a61485ab2019b30eb0d2c9ac..753c10ca9e802e11f5b9b03b5df8e047
ServerLevel worldserver = entityplayer.serverLevel();

diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f9a32d3aa3a1bf6fbdfaa78781afe058af921267..b1c8806e65c97bbeb96ea03aae0ffba9f5d7ae5b 100644
index 61f3bf48558eb469778fd33f50de9d5b016bf700..20414b4cb34b05acf98ea31e2d0e5a4cc7ad515a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -463,6 +463,7 @@ public final class CraftServer implements Server {
Expand All @@ -88,7 +88,7 @@ index f9a32d3aa3a1bf6fbdfaa78781afe058af921267..b1c8806e65c97bbeb96ea03aae0ffba9
}

public boolean getCommandBlockOverride(String command) {
@@ -1070,6 +1071,7 @@ public final class CraftServer implements Server {
@@ -1075,6 +1076,7 @@ public final class CraftServer implements Server {
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ index 78f02c2e068a63648f6d650a48a1cf21c5da1545..85be9376fe30f18fe4fea437955f1a60

}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 0dba30c41affafe7b1d585b515925043b37712fa..6767665e55ca1ec9cf2707918c349fd3ea5ada8a 100644
index 58591bf2f63b9c5e97d9ce4188dff3366968a178..f961fc365118a06b140cac780d5618ea33c5d57a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -186,6 +186,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
Expand Down Expand Up @@ -165,7 +165,7 @@ index 0dba30c41affafe7b1d585b515925043b37712fa..6767665e55ca1ec9cf2707918c349fd3
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f3b33fca6bc6c9c827cab78488b5aec782e92969..98b0cee150e9e27e6bafc7c2afc9d5008ca8ef82 100644
index 3ac6943913c887b14078aabb2581f7f16deb4b4a..1939c2f8c020c8ba6701a9d886b315276c1d1862 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -297,7 +297,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand Down Expand Up @@ -347,7 +347,7 @@ index ed80960777b18faca2d6a99783e53daf5fa19e09..9d492a2a45a2088f4bf28c85f04c22fa
if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper - Ability to control player's insomnia and phantoms
BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21));
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c21cc6231cfd6d542fc0ceaa4d62541709c1e3a8..1c79abf5952c29301bc9d83cd20a81696085fbf0 100644
index 20414b4cb34b05acf98ea31e2d0e5a4cc7ad515a..f935e286103618401726481b512794430bc26c8a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -259,6 +259,7 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
Expand All @@ -366,7 +366,7 @@ index c21cc6231cfd6d542fc0ceaa4d62541709c1e3a8..1c79abf5952c29301bc9d83cd20a8169

// Paper start - Folia region threading API
private final io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler regionizedScheduler = new io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler();
@@ -3238,4 +3240,11 @@ public final class CraftServer implements Server {
@@ -3243,4 +3245,11 @@ public final class CraftServer implements Server {
}

// Paper end
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0018-No-chat-sign.patch
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ index 9d6db4a378036559efab91c8b7dcf2a6b0c2cce6..2c349dc502ce275a8215766933f4855f
}
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 129c2e6f0cc9d752e7ca5934e13e89358af39180..2882d720f2b4fbc5f00cfe45a80f48e7810c1424 100644
index 1a610cd47fb26b70bc16078adc2c22acff6a9578..def41add94e74f0230031d75aed5a2191810b5c7 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -642,7 +642,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -643,7 +643,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
// Paper start - Add setting for proxy online mode status
return dedicatedserverproperties.enforceSecureProfile
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
Expand Down Expand Up @@ -147,7 +147,7 @@ index 8aa1337b420e1c9fbf51f951f14a63d89f61d3f4..19db81d87d1e0eb9716ceaf88dc407db
if (packet == null || this.processedDisconnect) { // Spigot
return;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 7612ee6c93c4ad783d71b125ed3b2fe91ab7c166..02427973b52898ab2d87d7585801fe14555d2ae4 100644
index eb4baddfe05397c52d7722d81dd3078bb23ea077..6a5ff44abca2bf5096bceb4f9ab2454e78b80fea 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1488,7 +1488,7 @@ public abstract class PlayerList {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Disable distance check for UseItemOnPacket


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2d388dcafc02a04348a1c07d970b7a8bb8fdf014..7101ca0ec164784d4be7a7c818131d4d11c69e98 100644
index 2d0b3ae86a32cf28824a5fdbd3dbf332f571f1e9..853264a6160f933bc08003b5b2e5d4dad6207ed5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1917,7 +1917,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1936,7 +1936,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Vec3 vec3d2 = vec3d.subtract(vec3d1);
double d0 = 1.0000001D;

Expand Down
Loading

0 comments on commit 296d93a

Please sign in to comment.