mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-12-23 15:00:37 +01:00
let boats not sink down, use less choppy (but faster) animation (#3949)
* let boats not sink down, use less choppy (but faster) animation * remove passenger check since that always returns true
This commit is contained in:
parent
78e788dca0
commit
872d7e3bb6
3 changed files with 4 additions and 4 deletions
|
@ -66,7 +66,7 @@ public class BoatEntity extends Entity {
|
|||
private int variant;
|
||||
|
||||
// Looks too fast and too choppy with 0.1f, which is how I believe the Microsoftian client handles it
|
||||
private final float ROWING_SPEED = 0.05f;
|
||||
private final float ROWING_SPEED = 0.1f;
|
||||
|
||||
public BoatEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
|
||||
// Initial rotation is incorrect
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
|||
import org.geysermc.geyser.translator.protocol.Translator;
|
||||
|
||||
/**
|
||||
* Sent by the client when moving a horse.
|
||||
* Sent by the client when moving a horse or boat.
|
||||
*/
|
||||
@Translator(packet = MoveEntityAbsolutePacket.class)
|
||||
public class BedrockMoveEntityAbsoluteTranslator extends PacketTranslator<MoveEntityAbsolutePacket> {
|
||||
|
@ -64,7 +64,7 @@ public class BedrockMoveEntityAbsoluteTranslator extends PacketTranslator<MoveEn
|
|||
}
|
||||
|
||||
float y = packet.getPosition().getY();
|
||||
if (ridingEntity instanceof BoatEntity) {
|
||||
if (ridingEntity instanceof BoatEntity && !ridingEntity.isOnGround()) {
|
||||
// Remove the offset to prevents boats from looking like they're floating in water
|
||||
y -= EntityDefinitions.BOAT.offset();
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ public class BedrockPlayerInputTranslator extends PacketTranslator<PlayerInputPa
|
|||
if (timeSinceVehicleMove >= 100) {
|
||||
Vector3f vehiclePosition = vehicle.getPosition();
|
||||
|
||||
if (vehicle instanceof BoatEntity) {
|
||||
if (vehicle instanceof BoatEntity && !vehicle.isOnGround()) {
|
||||
// Remove some Y position to prevents boats flying up
|
||||
vehiclePosition = vehiclePosition.down(EntityDefinitions.BOAT.offset());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue