PaperMC/Spigot-Server-Patches/0321-Workaround-for-vehicle-tracking-issue-on-disconnect.patch
Riley Park 4e958e229f
We're going on an Adventure! (#4842)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
2021-02-21 20:45:33 +01:00

24 lines
1.1 KiB
Diff

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/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 0c494b9c463789cd35d906afbdba5bcfffdbb28d..b1835179de7789ee98da8daa1d96c2feefab7ff6 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1391,6 +1391,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void p() {
this.ch = 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.isSleeping()) {
this.wakeup(true, false);
}