aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0300-Workaround-for-vehicle-tracking-issue-on-disconnect.patch
blob: 8d53da7d4e174ad931bba0384afa2b29e9531e45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
index ef5a1bdbb059a81763b1d630846dd69685842c19..21b585ee91be0636e9d8f223106b5daa7ffb9ee6 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1593,6 +1593,13 @@ public class ServerPlayer extends Player {
     public void disconnect() {
         this.disconnected = true;
         this.ejectPassengers();
+
+        // Paper start - Workaround an issue where the vehicle doesn't track the passenger disconnection dismount.
+        if (this.isPassenger() && this.getVehicle() instanceof ServerPlayer) {
+            this.stopRiding();
+        }
+        // Paper end
+
         if (this.isSleeping()) {
             this.stopSleepInBed(true, false);
         }