diff --git a/UPDATE_NOTES.md b/UPDATE_NOTES.md deleted file mode 100644 index 23c915e195..0000000000 --- a/UPDATE_NOTES.md +++ /dev/null @@ -1,14 +0,0 @@ -# Shit to check - -* Mini: "Optimize World Server Map": Figure out how to fill PaperWorldMap, it needs a dim key which doesnt exist anymore? -* Mini: "MC-50319": fix if still works -* Make sure the flat bedrock setting doesn't do anything stupid -* Check DataBits foreach -* lighting is bork (load chunk, fly away, come back, everything or parts are black) -* chunk generation seems slow with a lot of it happening -* Fix IDE Debug JVM Flag for new versions of minecraft - -* Check if `PlayerEditBookEvent`: https://github.com/PaperMC/Paper/pull/1751 -The PlayerEditBookEvent is straight up not called anymore. -The method to call it must now be `PlayerConnection#a(List, int)` (CB bug). -The item is presumably edited with the new page contents before it ever reaches this method? \ No newline at end of file diff --git a/patches/api-unmapped/Add-PlayerJumpEvent.patch b/patches/api/Add-PlayerJumpEvent.patch similarity index 100% rename from patches/api-unmapped/Add-PlayerJumpEvent.patch rename to patches/api/Add-PlayerJumpEvent.patch diff --git a/patches/api-unmapped/Expose-client-protocol-version-and-virtual-host.patch b/patches/api/Expose-client-protocol-version-and-virtual-host.patch similarity index 100% rename from patches/api-unmapped/Expose-client-protocol-version-and-virtual-host.patch rename to patches/api/Expose-client-protocol-version-and-virtual-host.patch diff --git a/patches/server-remapped/Add-PlayerJumpEvent.patch b/patches/server/Add-PlayerJumpEvent.patch similarity index 95% rename from patches/server-remapped/Add-PlayerJumpEvent.patch rename to patches/server/Add-PlayerJumpEvent.patch index 222813f585..e012450b01 100644 --- a/patches/server-remapped/Add-PlayerJumpEvent.patch +++ b/patches/server/Add-PlayerJumpEvent.patch @@ -8,13 +8,13 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener { +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser boolean flag = d8 > 0.0D; if (this.player.isOnGround() && !packet.isOnGround() && flag) { - this.player.jumpFromGround(); + // Paper start - Add player jump event -+ Player player = this.getPlayer(); ++ Player player = this.getCraftPlayer(); + Location from = new Location(player.getWorld(), lastPosX, lastPosY, lastPosZ, lastYaw, lastPitch); // Get the Players previous Event location. + Location to = player.getLocation().clone(); // Start off the To location as the Players current location. + @@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.player.jumpFromGround(); + } else { + from = event.getFrom(); -+ this.internalTeleport(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch(), Collections.emptySet()); ++ this.internalTeleport(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch(), Collections.emptySet(), false); + return; + } + // Paper end diff --git a/patches/server-remapped/Expose-client-protocol-version-and-virtual-host.patch b/patches/server/Expose-client-protocol-version-and-virtual-host.patch similarity index 81% rename from patches/server-remapped/Expose-client-protocol-version-and-virtual-host.patch rename to patches/server/Expose-client-protocol-version-and-virtual-host.patch index 39fef816a3..d78a465b7b 100644 --- a/patches/server-remapped/Expose-client-protocol-version-and-virtual-host.patch +++ b/patches/server/Expose-client-protocol-version-and-virtual-host.patch @@ -74,18 +74,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public Connection(PacketFlow side) { this.receiving = side; -diff --git a/src/main/java/net/minecraft/network/protocol/handshake/ClientIntentionPacket.java b/src/main/java/net/minecraft/network/protocol/handshake/ClientIntentionPacket.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/network/protocol/handshake/ClientIntentionPacket.java -+++ b/src/main/java/net/minecraft/network/protocol/handshake/ClientIntentionPacket.java -@@ -0,0 +0,0 @@ public class ClientIntentionPacket implements Packet - org.apache.logging.log4j - log4j-core + com.googlecode.json-simple + json-simple + 1.1.1 - runtime + compile - org.apache.logging.log4j + org.xerial diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java @@ -34,8 +47,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class SpigotConfig private static void playerSample() { - playerSample = getInt( "settings.sample-count", 12 ); -- System.out.println( "Server Ping Player Sample Count: " + playerSample ); + SpigotConfig.playerSample = SpigotConfig.getInt( "settings.sample-count", 12 ); +- System.out.println( "Server Ping Player Sample Count: " + SpigotConfig.playerSample ); + Bukkit.getLogger().log( Level.INFO, "Server Ping Player Sample Count: {0}", playerSample ); // Paper - Use logger } diff --git a/patches/server-remapped/Improve-Log4J-Configuration-Plugin-Loggers.patch b/patches/server/Improve-Log4J-Configuration-Plugin-Loggers.patch similarity index 100% rename from patches/server-remapped/Improve-Log4J-Configuration-Plugin-Loggers.patch rename to patches/server/Improve-Log4J-Configuration-Plugin-Loggers.patch diff --git a/patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch index 54505318ca..5d29bf93c3 100644 --- a/patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch +++ b/patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch @@ -8,6 +8,14 @@ diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java +@@ -0,0 +0,0 @@ public abstract class BaseSpawner { + // Spigot End + } + entity.spawnedViaMobSpawner = true; // Paper ++ flag = true; // Paper + // Spigot Start + if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) { + Entity vehicle = entity.getVehicle(); @@ -0,0 +0,0 @@ public abstract class BaseSpawner { ((Mob) entity).spawnAnim(); } diff --git a/patches/server-remapped/Send-attack-SoundEffects-only-to-players-who-can-see.patch b/patches/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch similarity index 100% rename from patches/server-remapped/Send-attack-SoundEffects-only-to-players-who-can-see.patch rename to patches/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch diff --git a/patches/server-remapped/handle-PacketPlayInKeepAlive-async.patch b/patches/server/handle-PacketPlayInKeepAlive-async.patch similarity index 96% rename from patches/server-remapped/handle-PacketPlayInKeepAlive-async.patch rename to patches/server/handle-PacketPlayInKeepAlive-async.patch index 1ce20d2fe3..dd80e48e9e 100644 --- a/patches/server-remapped/handle-PacketPlayInKeepAlive-async.patch +++ b/patches/server/handle-PacketPlayInKeepAlive-async.patch @@ -18,7 +18,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener { +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @Override public void handleKeepAlive(ServerboundKeepAlivePacket packet) { @@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.keepAlivePending = false; } else if (!this.isSingleplayerOwner()) { + // Paper start - This needs to be handled on the main thread for plugins -+ server.scheduleOnMain(() -> { ++ server.submit(() -> { this.disconnect(new TranslatableComponent("disconnect.timeout")); + }); + // Paper end diff --git a/patches/server-remapped/revert-serverside-behavior-of-keepalives.patch b/patches/server/revert-serverside-behavior-of-keepalives.patch similarity index 81% rename from patches/server-remapped/revert-serverside-behavior-of-keepalives.patch rename to patches/server/revert-serverside-behavior-of-keepalives.patch index ca9362fa9b..b572888275 100644 --- a/patches/server-remapped/revert-serverside-behavior-of-keepalives.patch +++ b/patches/server/revert-serverside-behavior-of-keepalives.patch @@ -20,16 +20,20 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener { +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private final MinecraftServer server; public ServerPlayer player; private int tickCount; - private long keepAliveTime; private void setLastPing(long lastPing) { this.keepAliveTime = lastPing;}; private long getLastPing() { return this.keepAliveTime;}; // Paper - OBFHELPER -+ private long keepAliveTime = Util.getMillis(); private void setLastPing(long lastPing) { this.keepAliveTime = lastPing;}; private long getLastPing() { return this.keepAliveTime;}; // Paper - OBFHELPER - private boolean keepAlivePending; private void setPendingPing(boolean isPending) { this.keepAlivePending = isPending;}; private boolean isPendingPing() { return this.keepAlivePending;}; // Paper - OBFHELPER - private long keepAliveChallenge; private void setKeepAliveID(long keepAliveID) { this.keepAliveChallenge = keepAliveID;}; private long getKeepAliveID() {return this.keepAliveChallenge; }; // Paper - OBFHELPER +- private boolean keepAlivePending; private void setPendingPing(boolean isPending) { this.keepAlivePending = isPending;}; private boolean isPendingPing() { return this.keepAlivePending;}; // Paper - OBFHELPER +- private long keepAliveChallenge; private void setKeepAliveID(long keepAliveID) { this.keepAliveChallenge = keepAliveID;}; private long getKeepAliveID() {return this.keepAliveChallenge; }; // Paper - OBFHELPER ++ private long keepAliveTime = Util.getMillis(); ++ private boolean keepAlivePending; ++ private long keepAliveChallenge; // CraftBukkit start - multithreaded fields -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener { + private AtomicInteger chatSpamTickCount = new AtomicInteger(); + // CraftBukkit end +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private int aboveGroundVehicleTickCount; private int receivedMovePacketCount; private int knownMovePacketCount; @@ -37,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { this.server = server; -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener { +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } this.server.getProfiler().push("keepAlive"); @@ -47,26 +51,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - if (this.keepAlivePending) { - this.disconnect(new TranslatableComponent("disconnect.timeout")); - } else { -- this.keepAlivePending = true; -- this.keepAliveTime = i; -- this.keepAliveChallenge = i; -- this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge)); + // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings + // This should effectively place the keepalive handling back to "as it was" before 1.12.2 + long currentTime = Util.getMillis(); -+ long elapsedTime = currentTime - this.getLastPing(); ++ long elapsedTime = currentTime - this.keepAliveTime; + -+ if (this.isPendingPing()) { ++ if (this.keepAlivePending) { + if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected + ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info + this.disconnect(new TranslatableComponent("disconnect.timeout", new Object[0])); + } + } else { + if (elapsedTime >= 15000L) { // 15 seconds -+ this.setPendingPing(true); -+ this.setLastPing(currentTime); -+ this.setKeepAliveID(currentTime); -+ this.send(new ClientboundKeepAlivePacket(this.getKeepAliveID())); + this.keepAlivePending = true; +- this.keepAliveTime = i; +- this.keepAliveChallenge = i; ++ this.keepAliveTime = currentTime; ++ this.keepAliveChallenge = currentTime; + this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge)); } } + // Paper end