Paper/patches/server/0800-Don-t-allow-vehicle-movement-from-players-while-tele.patch
Emilia Kond 2d09115b3a
Use net.kyori.ansi for console logging (#9313)
Uses the new ANSIComponentSerializer introduced in Adventure 4.14.0 to
serialize components when logging them via the ComponentLogger, or when
sending messages to the console.

This replaces the old solution which uses legacy jank and custom color
conversions, with a new library that handles the conversion and config
2023-06-12 15:00:12 -07:00

25 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Mon, 14 Mar 2022 12:35:37 -0700
Subject: [PATCH] Don't allow vehicle movement from players while teleporting
Bring the vehicle move packet behavior in line with the
regular player move packet.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c47d838ad26e4a32de065d9adc2af35e1a915b0c..32f14d93a27f340551a157445250ccbc8a133157 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -576,6 +576,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_VEHICLE_MOVEMENT); // Paper - kick event cause
} else {
Entity entity = this.player.getRootVehicle();
+ // Paper start
+ if (this.awaitingPositionFromClient != null || this.player.isImmobile() || entity.isRemoved()) {
+ return;
+ }
+ // Paper end
if (entity != this.player && entity.getControllingPassenger() == this.player && entity == this.lastVehicle) {
ServerLevel worldserver = this.player.serverLevel();