Skip to content

Commit

Permalink
Fix horse movement
Browse files Browse the repository at this point in the history
  • Loading branch information
Camotoy committed Oct 26, 2024
1 parent 9d2d12b commit c9eeed9
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,13 @@ public void translate(GeyserSession session, PlayerAuthInputPacket packet) {
case STOP_GLIDING -> sendPlayerGlideToggle(session, entity);
}
}
boolean up = inputData.contains(PlayerAuthInputData.UP);
// Yes. These are flipped. It's always been an issue with Geyser. That's what it's like working with this codebase.
// Hi random stranger. I am six days into updating for 1.21.3. How's it going?
session.setSteeringLeft(up || inputData.contains(PlayerAuthInputData.PADDLE_RIGHT));
session.setSteeringRight(up || inputData.contains(PlayerAuthInputData.PADDLE_LEFT));
if (entity.getVehicle() instanceof BoatEntity) {
boolean up = inputData.contains(PlayerAuthInputData.UP);
// Yes. These are flipped. It's always been an issue with Geyser. That's what it's like working with this codebase.
// Hi random stranger. I am six days into updating for 1.21.3. How's it going?

This comment has been minimized.

Copy link
@ip0p

ip0p Oct 26, 2024

🤣 all good camotoy! just lookin what you're doing. 😅

This comment has been minimized.

Copy link
@eclipseisoffline

eclipseisoffline Oct 26, 2024

Contributor

You got this Camotoy, take a rest when you need to :p

session.setSteeringLeft(up || inputData.contains(PlayerAuthInputData.PADDLE_RIGHT));
session.setSteeringRight(up || inputData.contains(PlayerAuthInputData.PADDLE_LEFT));
}
}

private static void sendPlayerGlideToggle(GeyserSession session, Entity entity) {
Expand Down Expand Up @@ -228,7 +230,7 @@ private static void processVehicleInput(GeyserSession session, PlayerAuthInputPa

boolean sendMovement = false;
if (vehicle instanceof AbstractHorseEntity && !(vehicle instanceof LlamaEntity)) {
sendMovement = vehicle.isOnGround();
sendMovement = true;
} else if (vehicle instanceof BoatEntity) {
if (vehicle.getPassengers().size() == 1) {
// The player is the only rider
Expand Down Expand Up @@ -299,6 +301,7 @@ private static void processVehicleInput(GeyserSession session, PlayerAuthInputPa
vehiclePosition = vehiclePosition.down(vehicle.getDefinition().offset());
}

vehicle.setPosition(vehiclePosition);
ServerboundMoveVehiclePacket moveVehiclePacket = new ServerboundMoveVehiclePacket(
vehiclePosition.getX(), vehiclePosition.getY(), vehiclePosition.getZ(),
vehicleRotation.getY() - 90, vehiclePosition.getX() // TODO I wonder if this is related to the horse spinning bugs...
Expand Down

0 comments on commit c9eeed9

Please sign in to comment.