Files
Purpur/purpur-server/minecraft-patches/sources/net/minecraft/network/Connection.java.patch
granny c8a4f0b6f0 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@ffcb7b22 Update Parchment (#13177)
PaperMC/Paper@c33a9ce1 Fix incorrect variable use in Entity#startRiding
PaperMC/Paper@c710b667 Add MapPalette.getNearestColor (#13104)
PaperMC/Paper@b57d6410 Expose isReplaceable on BlockData (#13180)
PaperMC/Paper@af1823d4 Reduce impact of tick time calculations (#13188)
PaperMC/Paper@89ca94ab [ci/skip] Rebuild patches
PaperMC/Paper@e5cc2560 [ci/skip] Update CONTRIBUTING.md for Gradle and Windows Docs (#13190)
PaperMC/Paper@ab99393c Fix charged creeper explosions not dropping mob skulls (#13167)
PaperMC/Paper@81b7a578 Fixed Ender Dragon using wrong tracking range (#13046)
2025-10-16 22:07:40 -07:00

24 lines
1.2 KiB
Diff

--- a/net/minecraft/network/Connection.java
+++ b/net/minecraft/network/Connection.java
@@ -578,11 +_,20 @@
private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper - Buffer joins to world
private static int joinAttemptsThisTick; // Paper - Buffer joins to world
private static int currTick; // Paper - Buffer joins to world
+ private static int tickSecond; // Purpur - Max joins per second
public void tick() {
this.flushQueue();
// Paper start - Buffer joins to world
if (Connection.currTick != net.minecraft.server.MinecraftServer.currentTick) {
Connection.currTick = net.minecraft.server.MinecraftServer.currentTick;
+ // Purpur start - Max joins per second
+ if (org.purpurmc.purpur.PurpurConfig.maxJoinsPerSecond) {
+ if (++Connection.tickSecond > 20) {
+ Connection.tickSecond = 0;
+ Connection.joinAttemptsThisTick = 0;
+ }
+ } else
+ // Purpur end - Max joins per second
Connection.joinAttemptsThisTick = 0;
}
// Paper end - Buffer joins to world