Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +01:00
Only send release packet if action type is 0
Needed for eating to work correctly
Dieser Commit ist enthalten in:
Ursprung
1364eb1df7
Commit
6fa25aa264
@ -41,16 +41,16 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator<Inve
|
|||||||
public void translate(InventoryTransactionPacket packet, GeyserSession session) {
|
public void translate(InventoryTransactionPacket packet, GeyserSession session) {
|
||||||
switch (packet.getTransactionType()) {
|
switch (packet.getTransactionType()) {
|
||||||
case ITEM_USE:
|
case ITEM_USE:
|
||||||
switch (packet.getActionType()) {
|
if (packet.getActionType() == 1) {
|
||||||
case 1:
|
ClientPlayerUseItemPacket useItemPacket = new ClientPlayerUseItemPacket(Hand.MAIN_HAND);
|
||||||
ClientPlayerUseItemPacket useItemPacket = new ClientPlayerUseItemPacket(Hand.MAIN_HAND);
|
session.getDownstream().getSession().send(useItemPacket);
|
||||||
session.getDownstream().getSession().send(useItemPacket);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ITEM_RELEASE:
|
case ITEM_RELEASE:
|
||||||
ClientPlayerActionPacket releaseItemPacket = new ClientPlayerActionPacket(PlayerAction.RELEASE_USE_ITEM, new Position(0,0,0), BlockFace.DOWN);
|
if (packet.getActionType() == 0) {
|
||||||
session.getDownstream().getSession().send(releaseItemPacket);
|
ClientPlayerActionPacket releaseItemPacket = new ClientPlayerActionPacket(PlayerAction.RELEASE_USE_ITEM, new Position(0, 0, 0), BlockFace.DOWN);
|
||||||
|
session.getDownstream().getSession().send(releaseItemPacket);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren