From f8d0fdf1279ab0fe94917cc2977878daca1edcf1 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 7 Jun 2022 17:42:07 -0700 Subject: [PATCH] i love jmp --- .../Add-LivingEntity-getTargetEntity.patch | 0 .../Add-Velocity-IP-Forwarding-Support.patch | 38 ++++++++----------- .../server/Add-more-Witch-API.patch | 0 ...event-players-from-moving-into-unloa.patch | 0 .../server/Add-sun-related-API.patch | 0 ...tator-target-events-and-improve-impl.patch | 0 ...owned-for-Villager-Aggression-Config.patch | 0 ...ble-connection-throttle-kick-message.patch | 4 +- ...-after-profile-lookups-if-not-needed.patch | 0 .../server/Hook-into-CB-plugin-rewrites.patch | 0 ...er-Thread-Pool-and-Thread-Priorities.patch | 0 ...ther-worlds-for-shooter-of-projectil.patch | 0 .../server/Optimize-World-Time-Updates.patch | 0 .../server/PreSpawnerSpawnEvent.patch | 0 .../Reset-players-airTicks-on-respawn.patch | 0 ...store-custom-InventoryHolder-support.patch | 0 .../{unapplied => }/server/Turtle-API.patch | 0 .../server/Use-Vanilla-Minecart-Speeds.patch | 0 18 files changed, 17 insertions(+), 25 deletions(-) rename patches/{unapplied => }/server/Add-LivingEntity-getTargetEntity.patch (100%) rename patches/{unapplied => }/server/Add-Velocity-IP-Forwarding-Support.patch (88%) rename patches/{unapplied => }/server/Add-more-Witch-API.patch (100%) rename patches/{unapplied => }/server/Add-option-to-prevent-players-from-moving-into-unloa.patch (100%) rename patches/{unapplied => }/server/Add-sun-related-API.patch (100%) rename patches/{unapplied => }/server/Call-player-spectator-target-events-and-improve-impl.patch (100%) rename patches/{unapplied => }/server/Check-Drowned-for-Villager-Aggression-Config.patch (100%) rename patches/{unapplied => }/server/Configurable-connection-throttle-kick-message.patch (86%) rename patches/{unapplied => }/server/Don-t-sleep-after-profile-lookups-if-not-needed.patch (100%) rename patches/{unapplied => }/server/Hook-into-CB-plugin-rewrites.patch (100%) rename patches/{unapplied => }/server/Improve-Server-Thread-Pool-and-Thread-Priorities.patch (100%) rename patches/{unapplied => }/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch (100%) rename patches/{unapplied => }/server/Optimize-World-Time-Updates.patch (100%) rename patches/{unapplied => }/server/PreSpawnerSpawnEvent.patch (100%) rename patches/{unapplied => }/server/Reset-players-airTicks-on-respawn.patch (100%) rename patches/{unapplied => }/server/Restore-custom-InventoryHolder-support.patch (100%) rename patches/{unapplied => }/server/Turtle-API.patch (100%) rename patches/{unapplied => }/server/Use-Vanilla-Minecart-Speeds.patch (100%) diff --git a/patches/unapplied/server/Add-LivingEntity-getTargetEntity.patch b/patches/server/Add-LivingEntity-getTargetEntity.patch similarity index 100% rename from patches/unapplied/server/Add-LivingEntity-getTargetEntity.patch rename to patches/server/Add-LivingEntity-getTargetEntity.patch diff --git a/patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch b/patches/server/Add-Velocity-IP-Forwarding-Support.patch similarity index 88% rename from patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch rename to patches/server/Add-Velocity-IP-Forwarding-Support.patch index f08ebe2e75..49d341b2df 100644 --- a/patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/Add-Velocity-IP-Forwarding-Support.patch @@ -131,14 +131,6 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListene index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -0,0 +0,0 @@ import javax.crypto.Cipher; - import javax.crypto.SecretKey; - import net.minecraft.DefaultUncaughtExceptionHandler; - import net.minecraft.network.Connection; -+import net.minecraft.network.FriendlyByteBuf; - import net.minecraft.network.chat.Component; - import net.minecraft.network.chat.TextComponent; - import net.minecraft.network.chat.TranslatableComponent; @@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.Waitable; import org.bukkit.event.player.AsyncPlayerPreLoginEvent; import org.bukkit.event.player.PlayerPreLoginEvent; @@ -149,25 +141,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @Nullable - private ServerPlayer delayedAcceptPlayer; + private ProfilePublicKey playerProfilePublicKey; public String hostname = ""; // CraftBukkit - add field + private int velocityLoginMessageId = -1; // Paper - Velocity support public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) { this.state = ServerLoginPacketListenerImpl.State.HELLO; @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener - this.state = ServerLoginPacketListenerImpl.State.KEY; - this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce)); - } else { -+ // Paper start - Velocity support -+ if (com.destroystokyo.paper.PaperConfig.velocitySupport) { -+ this.velocityLoginMessageId = java.util.concurrent.ThreadLocalRandom.current().nextInt(); -+ net.minecraft.network.protocol.login.ClientboundCustomQueryPacket packet1 = new net.minecraft.network.protocol.login.ClientboundCustomQueryPacket(this.velocityLoginMessageId, com.destroystokyo.paper.proxy.VelocityProxy.PLAYER_INFO_CHANNEL, new FriendlyByteBuf(Unpooled.EMPTY_BUFFER)); -+ this.connection.send(packet1); -+ return; -+ } -+ // Paper end - // Spigot start + this.state = ServerLoginPacketListenerImpl.State.KEY; + this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce)); + } else { ++ // Paper start - Velocity support ++ if (com.destroystokyo.paper.PaperConfig.velocitySupport) { ++ this.velocityLoginMessageId = java.util.concurrent.ThreadLocalRandom.current().nextInt(); ++ net.minecraft.network.protocol.login.ClientboundCustomQueryPacket packet1 = new net.minecraft.network.protocol.login.ClientboundCustomQueryPacket(this.velocityLoginMessageId, com.destroystokyo.paper.proxy.VelocityProxy.PLAYER_INFO_CHANNEL, new net.minecraft.network.FriendlyByteBuf(Unpooled.EMPTY_BUFFER)); ++ this.connection.send(packet1); ++ return; ++ } ++ // Paper end + // Spigot start // Paper start - Cache authenticator threads authenticatorPool.execute(new Runnable() { @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @@ -189,7 +181,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void handleCustomQueryPacket(ServerboundCustomQueryPacket packet) { + // Paper start - Velocity support + if (com.destroystokyo.paper.PaperConfig.velocitySupport && packet.getTransactionId() == this.velocityLoginMessageId) { -+ FriendlyByteBuf buf = packet.getData(); ++ net.minecraft.network.FriendlyByteBuf buf = packet.getData(); + if (buf == null) { + this.disconnect("This server requires you to connect with Velocity."); + return; @@ -221,7 +213,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return; + } + // Paper end - this.disconnect(new TranslatableComponent("multiplayer.disconnect.unexpected_query_response")); + this.disconnect(Component.translatable("multiplayer.disconnect.unexpected_query_response")); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/patches/unapplied/server/Add-more-Witch-API.patch b/patches/server/Add-more-Witch-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-Witch-API.patch rename to patches/server/Add-more-Witch-API.patch diff --git a/patches/unapplied/server/Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch similarity index 100% rename from patches/unapplied/server/Add-option-to-prevent-players-from-moving-into-unloa.patch rename to patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch diff --git a/patches/unapplied/server/Add-sun-related-API.patch b/patches/server/Add-sun-related-API.patch similarity index 100% rename from patches/unapplied/server/Add-sun-related-API.patch rename to patches/server/Add-sun-related-API.patch diff --git a/patches/unapplied/server/Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/Call-player-spectator-target-events-and-improve-impl.patch similarity index 100% rename from patches/unapplied/server/Call-player-spectator-target-events-and-improve-impl.patch rename to patches/server/Call-player-spectator-target-events-and-improve-impl.patch diff --git a/patches/unapplied/server/Check-Drowned-for-Villager-Aggression-Config.patch b/patches/server/Check-Drowned-for-Villager-Aggression-Config.patch similarity index 100% rename from patches/unapplied/server/Check-Drowned-for-Villager-Aggression-Config.patch rename to patches/server/Check-Drowned-for-Villager-Aggression-Config.patch diff --git a/patches/unapplied/server/Configurable-connection-throttle-kick-message.patch b/patches/server/Configurable-connection-throttle-kick-message.patch similarity index 86% rename from patches/unapplied/server/Configurable-connection-throttle-kick-message.patch rename to patches/server/Configurable-connection-throttle-kick-message.patch index 002b5bea10..e801c24559 100644 --- a/patches/unapplied/server/Configurable-connection-throttle-kick-message.patch +++ b/patches/server/Configurable-connection-throttle-kick-message.patch @@ -28,8 +28,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 synchronized (ServerHandshakePacketListenerImpl.throttleTracker) { if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) { ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime); -- TranslatableComponent chatmessage = new TranslatableComponent("Connection throttled! Please wait before reconnecting."); -+ TranslatableComponent chatmessage = new TranslatableComponent(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message +- MutableComponent chatmessage = Component.literal("Connection throttled! Please wait before reconnecting."); ++ MutableComponent chatmessage = Component.literal(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage)); this.connection.disconnect(chatmessage); return; diff --git a/patches/unapplied/server/Don-t-sleep-after-profile-lookups-if-not-needed.patch b/patches/server/Don-t-sleep-after-profile-lookups-if-not-needed.patch similarity index 100% rename from patches/unapplied/server/Don-t-sleep-after-profile-lookups-if-not-needed.patch rename to patches/server/Don-t-sleep-after-profile-lookups-if-not-needed.patch diff --git a/patches/unapplied/server/Hook-into-CB-plugin-rewrites.patch b/patches/server/Hook-into-CB-plugin-rewrites.patch similarity index 100% rename from patches/unapplied/server/Hook-into-CB-plugin-rewrites.patch rename to patches/server/Hook-into-CB-plugin-rewrites.patch diff --git a/patches/unapplied/server/Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/Improve-Server-Thread-Pool-and-Thread-Priorities.patch similarity index 100% rename from patches/unapplied/server/Improve-Server-Thread-Pool-and-Thread-Priorities.patch rename to patches/server/Improve-Server-Thread-Pool-and-Thread-Priorities.patch diff --git a/patches/unapplied/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch b/patches/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch similarity index 100% rename from patches/unapplied/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch rename to patches/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch diff --git a/patches/unapplied/server/Optimize-World-Time-Updates.patch b/patches/server/Optimize-World-Time-Updates.patch similarity index 100% rename from patches/unapplied/server/Optimize-World-Time-Updates.patch rename to patches/server/Optimize-World-Time-Updates.patch diff --git a/patches/unapplied/server/PreSpawnerSpawnEvent.patch b/patches/server/PreSpawnerSpawnEvent.patch similarity index 100% rename from patches/unapplied/server/PreSpawnerSpawnEvent.patch rename to patches/server/PreSpawnerSpawnEvent.patch diff --git a/patches/unapplied/server/Reset-players-airTicks-on-respawn.patch b/patches/server/Reset-players-airTicks-on-respawn.patch similarity index 100% rename from patches/unapplied/server/Reset-players-airTicks-on-respawn.patch rename to patches/server/Reset-players-airTicks-on-respawn.patch diff --git a/patches/unapplied/server/Restore-custom-InventoryHolder-support.patch b/patches/server/Restore-custom-InventoryHolder-support.patch similarity index 100% rename from patches/unapplied/server/Restore-custom-InventoryHolder-support.patch rename to patches/server/Restore-custom-InventoryHolder-support.patch diff --git a/patches/unapplied/server/Turtle-API.patch b/patches/server/Turtle-API.patch similarity index 100% rename from patches/unapplied/server/Turtle-API.patch rename to patches/server/Turtle-API.patch diff --git a/patches/unapplied/server/Use-Vanilla-Minecart-Speeds.patch b/patches/server/Use-Vanilla-Minecart-Speeds.patch similarity index 100% rename from patches/unapplied/server/Use-Vanilla-Minecart-Speeds.patch rename to patches/server/Use-Vanilla-Minecart-Speeds.patch