3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-07-31 09:38:06 +02:00

Fix interact entity packet (#2179)

For the InteractAt type of packet of the PlayerInteractEntityPacket, Java sends a diff between the entity's current position and the hit result of its cursor. Bedrock sends the full vector location in its interaction. Therefore, we just do the diff ourselves.

This fixes taking armor off of armor stands.
Dieser Commit ist enthalten in:
Camotoy 2021-04-30 18:35:45 -04:00 committet von GitHub
Ursprung abc3a187d4
Commit 1301cd9c30
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -321,7 +321,7 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator<Inve
session.sendUpstreamPacket(openPacket);
break;
}
Vector3f vector = packet.getClickPosition();
Vector3f vector = packet.getClickPosition().sub(entity.getPosition());
ClientPlayerInteractEntityPacket interactPacket = new ClientPlayerInteractEntityPacket((int) entity.getEntityId(),
InteractAction.INTERACT, Hand.MAIN_HAND, session.isSneaking());
ClientPlayerInteractEntityPacket interactAtPacket = new ClientPlayerInteractEntityPacket((int) entity.getEntityId(),
@ -329,7 +329,7 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator<Inve
session.sendDownstreamPacket(interactPacket);
session.sendDownstreamPacket(interactAtPacket);
EntitySoundInteractionHandler.handleEntityInteraction(session, vector, entity);
EntitySoundInteractionHandler.handleEntityInteraction(session, packet.getClickPosition(), entity);
break;
case 1: //Attack
if (entity.getEntityType() == EntityType.ENDER_DRAGON) {