1
0
Fork 0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-04-18 11:29:40 +02:00

This could be cleaned up even more

This commit is contained in:
Eclipse 2024-11-07 17:21:49 +00:00
parent ad73dfdb4d
commit 6a0ca6ef4e
No known key found for this signature in database
GPG key ID: 95E6998F82EC938A

View file

@ -25,7 +25,6 @@
package org.geysermc.geyser.translator.protocol.java.entity;
import org.cloudburstmc.math.vector.Vector3d;
import org.cloudburstmc.protocol.bedrock.packet.SetEntityMotionPacket;
import org.geysermc.geyser.entity.type.Entity;
import org.geysermc.geyser.session.GeyserSession;
@ -43,12 +42,9 @@ public class JavaMoveMinecartTranslator extends PacketTranslator<ClientboundMove
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
MinecartStep lastStep = packet.getLerpSteps().get(packet.getLerpSteps().size() - 1);
Vector3d position = lastStep.position();
entity.moveAbsolute(position.toFloat(), lastStep.yRot(), lastStep.xRot(), entity.isOnGround(), false);
Vector3d movement = lastStep.movement();
entity.setMotion(movement.toFloat());
entity.moveAbsolute(lastStep.position().toFloat(), lastStep.yRot(), lastStep.xRot(), entity.isOnGround(), false);
entity.setMotion(lastStep.movement().toFloat());
SetEntityMotionPacket entityMotionPacket = new SetEntityMotionPacket();
entityMotionPacket.setRuntimeEntityId(entity.getGeyserId());
entityMotionPacket.setMotion(entity.getMotion());