Ugly workaround for SPIGOT-1915 & GH-114

Closes GH-114
This commit is contained in:
Zach Brown 2016-04-10 03:24:54 -05:00
parent 6fc0a013a5
commit a3358b1915
No known key found for this signature in database
GPG Key ID: CC9DA35FC5450B76
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
From 4e8d404a04aefaad3860c588800939320f8be912 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 d77211a..b80474e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -570,6 +570,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);
--
2.8.0