aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0409-Workaround-for-vehicle-tracking-issue-on-disconnect.patch
blob: a628d6710121e6a8b7fbd6cb3a2c512ed40d153b (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
25
26
27
From c30ea95b78ae18005efefec5a38836d7b8c423b2 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/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 541461275..1d3730083 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1119,6 +1119,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
     public void n() {
         this.cB = true;
         this.ejectPassengers();
+
+        // Paper start - Workaround an issue where the vehicle doesn't track the passenger disconnection dismount.
+        if (this.isPassenger() && this.getVehicle() instanceof EntityPlayer) {
+            this.stopRiding();
+        }
+        // Paper end
+
         if (this.sleeping) {
             this.a(true, false, false);
         }
-- 
2.21.0