3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 16:12:46 +01:00

Remove Y pos workaround in BedrockItemFrameDropItemTranslator (#1037)

Dieser Commit ist enthalten in:
AJ Ferguson 2020-08-01 10:41:59 -08:00 committet von GitHub
Ursprung 07f3d45cc4
Commit 86f18c9392
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -40,15 +40,7 @@ public class BedrockItemFrameDropItemTranslator extends PacketTranslator<ItemFra
@Override
public void translate(ItemFrameDropItemPacket packet, GeyserSession session) {
// I hope that, when we die, God (or whoever is waiting for us) tells us exactly why this code exists
// The packet sends the Y coordinate (and just the Y coordinate) divided by two, and it's negative if it needs to be subtracted by one
int y;
if (packet.getBlockPosition().getY() > 0) {
y = packet.getBlockPosition().getY() * 2;
} else {
y = (packet.getBlockPosition().getY() * -2) - 1;
}
Vector3i position = Vector3i.from(packet.getBlockPosition().getX(), y, packet.getBlockPosition().getZ());
Vector3i position = Vector3i.from(packet.getBlockPosition().getX(), packet.getBlockPosition().getY(), packet.getBlockPosition().getZ());
ClientPlayerInteractEntityPacket interactPacket = new ClientPlayerInteractEntityPacket((int) ItemFrameEntity.getItemFrameEntityId(session, position),
InteractAction.ATTACK, Hand.MAIN_HAND, session.isSneaking());
session.sendDownstreamPacket(interactPacket);