Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-17 03:50:08 +01:00
30 Zeilen
1.2 KiB
Diff
30 Zeilen
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 b7d5a718375083a4162df4bb41de3acd57b297fb..b264cbe5f91da9e31c5fd00ee285735a19aaad35 100644
|
||
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||
|
@@ -870,6 +870,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().connection.send(new net.minecraft.network.protocol.game.ClientboundSetPassengersPacket(this.getHandle()));
|
||
|
+ }
|
||
|
+ return wasSet;
|
||
|
+ }
|
||
|
+ // Paper end
|
||
|
+
|
||
|
@Override
|
||
|
public void setSneaking(boolean sneak) {
|
||
|
getHandle().setShiftKeyDown(sneak);
|