Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipseisoffline committed Nov 7, 2024
1 parent abe0d7d commit ad73dfd
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
package org.geysermc.geyser.translator.protocol.java.entity;

import org.cloudburstmc.math.vector.Vector3d;
import org.cloudburstmc.math.vector.Vector3f;
import org.cloudburstmc.protocol.bedrock.packet.SetEntityMotionPacket;
import org.geysermc.geyser.entity.type.Entity;
import org.geysermc.geyser.session.GeyserSession;
Expand All @@ -44,12 +43,11 @@ public void translate(GeyserSession session, ClientboundMoveMinecartPacket packe
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());

MinecartStep lastStep = packet.getLerpSteps().get(packet.getLerpSteps().size() - 1);
Vector3d relativePosition = lastStep.position();
Vector3d movement = lastStep.movement();
entity.moveAbsolute(Vector3f.from(relativePosition.getX(), relativePosition.getY(), relativePosition.getZ()), lastStep.yRot(), lastStep.xRot(), false, false);

Vector3d position = lastStep.position();
entity.moveAbsolute(position.toFloat(), lastStep.yRot(), lastStep.xRot(), entity.isOnGround(), false);

entity.setMotion(Vector3f.from(movement.getX(), movement.getY(), movement.getZ()));
Vector3d movement = lastStep.movement();
entity.setMotion(movement.toFloat());

SetEntityMotionPacket entityMotionPacket = new SetEntityMotionPacket();
entityMotionPacket.setRuntimeEntityId(entity.getGeyserId());
Expand Down

0 comments on commit ad73dfd

Please sign in to comment.