Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 08:30:12 +01:00
Commit
40feb0880f
@ -85,11 +85,23 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator<Inve
|
|||||||
if (entity == null)
|
if (entity == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Vector3f vector = packet.getClickPosition();
|
//https://wiki.vg/Protocol#Interact_Entity
|
||||||
ClientPlayerInteractEntityPacket entityPacket = new ClientPlayerInteractEntityPacket((int) entity.getEntityId(),
|
switch (packet.getActionType()) {
|
||||||
InteractAction.values()[packet.getActionType()], vector.getX(), vector.getY(), vector.getZ(), Hand.MAIN_HAND);
|
case 0: //Interact
|
||||||
|
Vector3f vector = packet.getClickPosition();
|
||||||
session.getDownstream().getSession().send(entityPacket);
|
ClientPlayerInteractEntityPacket interactPacket = new ClientPlayerInteractEntityPacket((int) entity.getEntityId(),
|
||||||
|
InteractAction.INTERACT, Hand.MAIN_HAND);
|
||||||
|
ClientPlayerInteractEntityPacket interactAtPacket = new ClientPlayerInteractEntityPacket((int) entity.getEntityId(),
|
||||||
|
InteractAction.INTERACT_AT, vector.getX(), vector.getY(), vector.getZ(), Hand.MAIN_HAND);
|
||||||
|
session.getDownstream().getSession().send(interactPacket);
|
||||||
|
session.getDownstream().getSession().send(interactAtPacket);
|
||||||
|
break;
|
||||||
|
case 1: //Attack
|
||||||
|
ClientPlayerInteractEntityPacket attackPacket = new ClientPlayerInteractEntityPacket((int) entity.getEntityId(),
|
||||||
|
InteractAction.ATTACK);
|
||||||
|
session.getDownstream().getSession().send(attackPacket);
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren