Paper/Spigot-Server-Patches/0085-Workaround-for-setting-passengers-on-players.patch
Aikar 70ad51a80c
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

My recent work on serialization is now in CraftBukkit so was able to drop the patch and Paper
is now consistent with upstream.

Bukkit Changes:
e2699636 Move API notes to more obvious location

CraftBukkit Changes:
1b2830a3 SPIGOT-4441: Fix serializing Components to and from Legacy
2020-06-02 01:29:18 -04:00

30 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sun, 10 Apr 2016 03:23:32 -0500
Subject: [PATCH] Workaround for setting passengers on players
SPIGOT-1915 & GH-114
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b2e6eeb60db96cab7b95048d9773c3e3f6da10dc..faff98ac698a5576ef4112a334e845a50d60b857 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -767,6 +767,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return true;
}
+ // Paper start - Ugly workaround for SPIGOT-1915 & GH-114
+ @Override
+ public boolean setPassenger(org.bukkit.entity.Entity passenger) {
+ boolean wasSet = super.setPassenger(passenger);
+ if (wasSet) {
+ this.getHandle().playerConnection.sendPacket(new net.minecraft.server.PacketPlayOutMount(this.getHandle()));
+ }
+ return wasSet;
+ }
+ // Paper end
+
@Override
public void setSneaking(boolean sneak) {
getHandle().setSneaking(sneak);