2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: connorhartley <vectrixu+gh@gmail.com>
|
|
|
|
Date: Mon, 7 Jan 2019 14:43:48 -0600
|
|
|
|
Subject: [PATCH] Workaround for vehicle tracking issue on disconnect
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
2024-04-12 21:14:06 +02:00
|
|
|
index a8de1f58fffe2541478083defc18be949d0c75f1..7433116ee68b92c86d1588296d521e5df49e5ac2 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
2024-01-24 13:07:40 +01:00
|
|
|
@@ -1705,6 +1705,13 @@ public class ServerPlayer extends Player {
|
2021-06-11 14:02:28 +02:00
|
|
|
public void disconnect() {
|
|
|
|
this.disconnected = true;
|
|
|
|
this.ejectPassengers();
|
|
|
|
+
|
2024-01-21 13:56:22 +01:00
|
|
|
+ // Paper start - Workaround vehicle not tracking the passenger disconnection dismount
|
2021-06-11 14:02:28 +02:00
|
|
|
+ if (this.isPassenger() && this.getVehicle() instanceof ServerPlayer) {
|
|
|
|
+ this.stopRiding();
|
|
|
|
+ }
|
2024-01-21 13:56:22 +01:00
|
|
|
+ // Paper end - Workaround vehicle not tracking the passenger disconnection dismount
|
2021-06-11 14:02:28 +02:00
|
|
|
+
|
|
|
|
if (this.isSleeping()) {
|
|
|
|
this.stopSleepInBed(true, false);
|
|
|
|
}
|