PaperMC/patches/server/0082-Workaround-for-setting-passengers-on-players.patch

30 lines
1.2 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
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 2dab55e7d807ae8414fbb1f4446df2f38783cfb4..4cbd2fcbbc96d64116665b13f49f0bb3d4b2bca6 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -894,6 +894,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
2021-06-11 14:02:28 +02:00
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().connection.send(new net.minecraft.network.protocol.game.ClientboundSetPassengersPacket(this.getHandle()));
+ }
+ return wasSet;
+ }
+ // Paper end
+
@Override
public void setSneaking(boolean sneak) {
2021-06-12 05:07:57 +02:00
this.getHandle().setShiftKeyDown(sneak);