1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

Small fixes

This commit is contained in:
onebeastchris
2025-06-25 19:43:37 +02:00
parent 39b15f945c
commit 9fb0dfd975
3 changed files with 9 additions and 14 deletions

View File

@@ -516,9 +516,8 @@ public class LivingEntity extends Entity {
case FLYING_SPEED -> {
AttributeData attributeData = calculateAttribute(javaAttribute, GeyserAttributeType.FLYING_SPEED);
newAttributes.add(attributeData);
if (this instanceof HappyGhastEntity happyGhast &&
happyGhast.getVehicleComponent() instanceof HappyGhastVehicleComponent vehicleComponent) {
vehicleComponent.setFlyingSpeed(attributeData.getValue());
if (this instanceof HappyGhastEntity ghast && ghast.getVehicleComponent() instanceof HappyGhastVehicleComponent component) {
component.setFlyingSpeed(attributeData.getValue());
}
}
case FOLLOW_RANGE -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.FOLLOW_RANGE));

View File

@@ -25,7 +25,7 @@
package org.geysermc.geyser.translator.protocol.java.entity;
import lombok.NonNull;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.cloudburstmc.protocol.bedrock.data.entity.EntityDataTypes;
import org.cloudburstmc.protocol.bedrock.data.entity.EntityLinkData;
import org.cloudburstmc.protocol.bedrock.packet.SetEntityLinkPacket;
@@ -54,7 +54,6 @@ public class JavaSetPassengersTranslator extends PacketTranslator<ClientboundSet
int @NonNull [] passengerIds = packet.getPassengerIds();
for (int i = 0; i < passengerIds.length; i++) {
int passengerId = passengerIds[i];
Entity passenger = session.getEntityCache().getEntityByJavaId(passengerId);
if (passenger == session.getPlayerEntity()) {
session.getPlayerEntity().setVehicle(entity);

View File

@@ -226,7 +226,6 @@ public final class EntityUtils {
}
}
case HAPPY_GHAST -> {
// 0.0, 5.02001, 1.7 BDS
int seatingIndex = Math.min(index, 4);
xOffset = HappyGhastEntity.X_OFFSETS[seatingIndex];
yOffset = 3.4f;
@@ -279,14 +278,12 @@ public final class EntityUtils {
}
public static void updateRiderRotationLock(Entity passenger, Entity mount, boolean isRiding) {
if (isRiding) {
if (mount instanceof BoatEntity) {
// Head rotation is locked while riding in a boat
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION, true);
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION_DEGREES, 90f);
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_HAS_ROTATION, true);
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_ROTATION_OFFSET_DEGREES, -90f);
}
if (isRiding && mount instanceof BoatEntity) {
// Head rotation is locked while riding in a boat
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION, true);
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION_DEGREES, 90f);
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_HAS_ROTATION, true);
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_ROTATION_OFFSET_DEGREES, -90f);
} else {
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION, false);
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION_DEGREES, 0f);