diff --git a/paper-server/patches/sources/net/minecraft/server/network/LegacyQueryHandler.java.patch b/paper-server/patches/sources/net/minecraft/server/network/LegacyQueryHandler.java.patch index 31868aa929..9bda2a7540 100644 --- a/paper-server/patches/sources/net/minecraft/server/network/LegacyQueryHandler.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/network/LegacyQueryHandler.java.patch @@ -34,7 +34,7 @@ if (i == 0) { - LOGGER.debug("Ping: (<1.3.x) from {}", socketAddress); - String string = createVersion0Response(this.server); -+ LOGGER.debug("Ping: (<1.3.x) from {}", net.minecraft.server.MinecraftServer.getServer().logIPs() ? socketAddress: ""); // Paper - Respect logIPs option ++ LOGGER.debug("Ping: (<1.3.x) from {}", net.minecraft.server.MinecraftServer.getServer().logIPs() ? socketAddress : ""); // Paper - Respect logIPs option + // Paper start - Call PaperServerListPingEvent and use results + com.destroystokyo.paper.event.server.PaperServerListPingEvent event = com.destroystokyo.paper.network.PaperLegacyStatusClient.processRequest(net.minecraft.server.MinecraftServer.getServer(), (java.net.InetSocketAddress) socketAddress, 39, null); + if (event == null) { @@ -157,7 +157,7 @@ + buf.release(); + this.buf = null; + -+ LOGGER.debug("Ping: (1.6) from {}", net.minecraft.server.MinecraftServer.getServer().logIPs() ? ctx.channel().remoteAddress(): ""); // Paper - Respect logIPs option ++ LOGGER.debug("Ping: (1.6) from {}", net.minecraft.server.MinecraftServer.getServer().logIPs() ? ctx.channel().remoteAddress() : ""); // Paper - Respect logIPs option + + net.minecraft.server.MinecraftServer server = net.minecraft.server.MinecraftServer.getServer(); + java.net.InetSocketAddress virtualHost = com.destroystokyo.paper.network.PaperNetworkClient.prepareVirtualHost(host, port); diff --git a/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index 565e6dcb4b..c4a14444de 100644 --- a/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -740,7 +740,7 @@ - LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getName().getString(), d3, d4, d5); - this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot()); - return; -+ if (d7 - d6 > Math.max(f2, Mth.square((org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed)))) { ++ if (d7 - d6 > Math.max(f2, Mth.square(org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed))) { + // CraftBukkit end + // Paper start - Add fail move event + io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY, diff --git a/paper-server/patches/sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch b/paper-server/patches/sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch index 47090dba31..4360d8653f 100644 --- a/paper-server/patches/sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch @@ -293,7 +293,6 @@ @Override public void handleCustomQueryPacket(ServerboundCustomQueryAnswerPacket packet) { -- this.disconnect(ServerCommonPacketListenerImpl.DISCONNECT_UNEXPECTED_QUERY); + // Paper start - Add Velocity IP Forwarding Support + if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled && packet.transactionId() == this.velocityLoginMessageId) { + ServerboundCustomQueryAnswerPacket.QueryAnswerPayload payload = (ServerboundCustomQueryAnswerPacket.QueryAnswerPayload)packet.payload(); @@ -338,7 +337,7 @@ + return; + } + // Paper end - Add Velocity IP Forwarding Support -+ // this.disconnect(ServerCommonPacketListenerImpl.DISCONNECT_UNEXPECTED_QUERY); + this.disconnect(ServerCommonPacketListenerImpl.DISCONNECT_UNEXPECTED_QUERY); } @Override diff --git a/paper-server/patches/sources/net/minecraft/server/players/StoredUserList.java.patch b/paper-server/patches/sources/net/minecraft/server/players/StoredUserList.java.patch index 1e359d0ca2..cfe6571868 100644 --- a/paper-server/patches/sources/net/minecraft/server/players/StoredUserList.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/players/StoredUserList.java.patch @@ -70,8 +70,8 @@ } + // Spigot start + } catch (com.google.gson.JsonParseException | NullPointerException ex) { -+ LOGGER.warn("Unable to read file {}, backing it up to {0}.backup and creating new copy.", this.file, ex); + File backup = new File(this.file + ".backup"); ++ LOGGER.warn("Unable to read file {}, backing it up to {} and creating new copy.", this.file, backup, ex); + this.file.renameTo(backup); + this.file.delete(); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPig.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPig.java index 8016c810ae..fd4f13e8ea 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPig.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPig.java @@ -45,7 +45,7 @@ public class CraftPig extends CraftAnimals implements Pig { } int max = this.getHandle().steering.boostTimeTotal(); - Preconditions.checkArgument(ticks >= 0 && ticks <= max, "boost ticks must not exceed 0 or %d (inclusive)", max); + Preconditions.checkArgument(ticks >= 0 && ticks <= max, "boost ticks must not exceed 0 or %s (inclusive)", max); this.getHandle().steering.boostTime = ticks; } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftStrider.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftStrider.java index 9472a6f9c9..74fac97231 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftStrider.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftStrider.java @@ -55,7 +55,7 @@ public class CraftStrider extends CraftAnimals implements Strider { } int max = this.getHandle().steering.boostTimeTotal(); - Preconditions.checkArgument(ticks >= 0 && ticks <= max, "boost ticks must not exceed 0 or %d (inclusive)", max); + Preconditions.checkArgument(ticks >= 0 && ticks <= max, "boost ticks must not exceed 0 or %s (inclusive)", max); this.getHandle().steering.boostTime = ticks; }