Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-09-08 12:32:53 +02:00
Fix /geyser offhand command on Bukkit (#611)
If CommandSender is not an instance of GeyserSession, we iterate through all GeyserSessions in order to find the sender.
Dieser Commit ist enthalten in:
Ursprung
93d15c16f5
Commit
61e0e796da
@ -56,6 +56,16 @@ public class OffhandCommand extends GeyserCommand {
|
|||||||
ClientPlayerActionPacket releaseItemPacket = new ClientPlayerActionPacket(PlayerAction.SWAP_HANDS, new Position(0,0,0),
|
ClientPlayerActionPacket releaseItemPacket = new ClientPlayerActionPacket(PlayerAction.SWAP_HANDS, new Position(0,0,0),
|
||||||
BlockFace.DOWN);
|
BlockFace.DOWN);
|
||||||
session.sendDownstreamPacket(releaseItemPacket);
|
session.sendDownstreamPacket(releaseItemPacket);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Needed for Bukkit - sender is not an instance of GeyserSession
|
||||||
|
for (GeyserSession session : connector.getPlayers().values()) {
|
||||||
|
if (sender.getName().equals(session.getPlayerEntity().getUsername())) {
|
||||||
|
ClientPlayerActionPacket releaseItemPacket = new ClientPlayerActionPacket(PlayerAction.SWAP_HANDS, new Position(0,0,0),
|
||||||
|
BlockFace.DOWN);
|
||||||
|
session.sendDownstreamPacket(releaseItemPacket);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren