fix more diff

This commit is contained in:
Lulu13022002 2024-12-20 23:39:43 +01:00
parent 13b890950d
commit 051ab9117a
No known key found for this signature in database
GPG key ID: 491C8F0B8ACDEB01
6 changed files with 7 additions and 8 deletions

View file

@ -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: "<ip address withheld>"); // Paper - Respect logIPs option
+ LOGGER.debug("Ping: (<1.3.x) from {}", net.minecraft.server.MinecraftServer.getServer().logIPs() ? socketAddress : "<ip address withheld>"); // 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(): "<ip address withheld>"); // Paper - Respect logIPs option
+ LOGGER.debug("Ping: (1.6) from {}", net.minecraft.server.MinecraftServer.getServer().logIPs() ? ctx.channel().remoteAddress() : "<ip address withheld>"); // 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);

View file

@ -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,

View file

@ -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

View file

@ -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();
}

View file

@ -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;
}

View file

@ -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;
}