Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +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
Dieser Commit ist enthalten in:
Ursprung
78e788dca0
Commit
872d7e3bb6
@ -66,7 +66,7 @@ public class BoatEntity extends Entity {
|
|||||||
private int variant;
|
private int variant;
|
||||||
|
|
||||||
// Looks too fast and too choppy with 0.1f, which is how I believe the Microsoftian client handles it
|
// 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) {
|
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
|
// Initial rotation is incorrect
|
||||||
|
@ -36,7 +36,7 @@ import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
|||||||
import org.geysermc.geyser.translator.protocol.Translator;
|
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)
|
@Translator(packet = MoveEntityAbsolutePacket.class)
|
||||||
public class BedrockMoveEntityAbsoluteTranslator extends PacketTranslator<MoveEntityAbsolutePacket> {
|
public class BedrockMoveEntityAbsoluteTranslator extends PacketTranslator<MoveEntityAbsolutePacket> {
|
||||||
@ -64,7 +64,7 @@ public class BedrockMoveEntityAbsoluteTranslator extends PacketTranslator<MoveEn
|
|||||||
}
|
}
|
||||||
|
|
||||||
float y = packet.getPosition().getY();
|
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
|
// Remove the offset to prevents boats from looking like they're floating in water
|
||||||
y -= EntityDefinitions.BOAT.offset();
|
y -= EntityDefinitions.BOAT.offset();
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public class BedrockPlayerInputTranslator extends PacketTranslator<PlayerInputPa
|
|||||||
if (timeSinceVehicleMove >= 100) {
|
if (timeSinceVehicleMove >= 100) {
|
||||||
Vector3f vehiclePosition = vehicle.getPosition();
|
Vector3f vehiclePosition = vehicle.getPosition();
|
||||||
|
|
||||||
if (vehicle instanceof BoatEntity) {
|
if (vehicle instanceof BoatEntity && !vehicle.isOnGround()) {
|
||||||
// Remove some Y position to prevents boats flying up
|
// Remove some Y position to prevents boats flying up
|
||||||
vehiclePosition = vehiclePosition.down(EntityDefinitions.BOAT.offset());
|
vehiclePosition = vehiclePosition.down(EntityDefinitions.BOAT.offset());
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren