mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-19 14:59:27 +00:00
Small fixes
This commit is contained in:
@@ -516,9 +516,8 @@ public class LivingEntity extends Entity {
|
|||||||
case FLYING_SPEED -> {
|
case FLYING_SPEED -> {
|
||||||
AttributeData attributeData = calculateAttribute(javaAttribute, GeyserAttributeType.FLYING_SPEED);
|
AttributeData attributeData = calculateAttribute(javaAttribute, GeyserAttributeType.FLYING_SPEED);
|
||||||
newAttributes.add(attributeData);
|
newAttributes.add(attributeData);
|
||||||
if (this instanceof HappyGhastEntity happyGhast &&
|
if (this instanceof HappyGhastEntity ghast && ghast.getVehicleComponent() instanceof HappyGhastVehicleComponent component) {
|
||||||
happyGhast.getVehicleComponent() instanceof HappyGhastVehicleComponent vehicleComponent) {
|
component.setFlyingSpeed(attributeData.getValue());
|
||||||
vehicleComponent.setFlyingSpeed(attributeData.getValue());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case FOLLOW_RANGE -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.FOLLOW_RANGE));
|
case FOLLOW_RANGE -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.FOLLOW_RANGE));
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
package org.geysermc.geyser.translator.protocol.java.entity;
|
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.EntityDataTypes;
|
||||||
import org.cloudburstmc.protocol.bedrock.data.entity.EntityLinkData;
|
import org.cloudburstmc.protocol.bedrock.data.entity.EntityLinkData;
|
||||||
import org.cloudburstmc.protocol.bedrock.packet.SetEntityLinkPacket;
|
import org.cloudburstmc.protocol.bedrock.packet.SetEntityLinkPacket;
|
||||||
@@ -54,7 +54,6 @@ public class JavaSetPassengersTranslator extends PacketTranslator<ClientboundSet
|
|||||||
int @NonNull [] passengerIds = packet.getPassengerIds();
|
int @NonNull [] passengerIds = packet.getPassengerIds();
|
||||||
for (int i = 0; i < passengerIds.length; i++) {
|
for (int i = 0; i < passengerIds.length; i++) {
|
||||||
int passengerId = passengerIds[i];
|
int passengerId = passengerIds[i];
|
||||||
|
|
||||||
Entity passenger = session.getEntityCache().getEntityByJavaId(passengerId);
|
Entity passenger = session.getEntityCache().getEntityByJavaId(passengerId);
|
||||||
if (passenger == session.getPlayerEntity()) {
|
if (passenger == session.getPlayerEntity()) {
|
||||||
session.getPlayerEntity().setVehicle(entity);
|
session.getPlayerEntity().setVehicle(entity);
|
||||||
|
|||||||
@@ -226,7 +226,6 @@ public final class EntityUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case HAPPY_GHAST -> {
|
case HAPPY_GHAST -> {
|
||||||
// 0.0, 5.02001, 1.7 BDS
|
|
||||||
int seatingIndex = Math.min(index, 4);
|
int seatingIndex = Math.min(index, 4);
|
||||||
xOffset = HappyGhastEntity.X_OFFSETS[seatingIndex];
|
xOffset = HappyGhastEntity.X_OFFSETS[seatingIndex];
|
||||||
yOffset = 3.4f;
|
yOffset = 3.4f;
|
||||||
@@ -279,14 +278,12 @@ public final class EntityUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void updateRiderRotationLock(Entity passenger, Entity mount, boolean isRiding) {
|
public static void updateRiderRotationLock(Entity passenger, Entity mount, boolean isRiding) {
|
||||||
if (isRiding) {
|
if (isRiding && mount instanceof BoatEntity) {
|
||||||
if (mount instanceof BoatEntity) {
|
// Head rotation is locked while riding in a boat
|
||||||
// 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, true);
|
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION_DEGREES, 90f);
|
||||||
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION_DEGREES, 90f);
|
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_HAS_ROTATION, true);
|
||||||
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_HAS_ROTATION, true);
|
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_ROTATION_OFFSET_DEGREES, -90f);
|
||||||
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_ROTATION_OFFSET_DEGREES, -90f);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION, false);
|
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION, false);
|
||||||
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION_DEGREES, 0f);
|
passenger.getDirtyMetadata().put(EntityDataTypes.SEAT_LOCK_RIDER_ROTATION_DEGREES, 0f);
|
||||||
|
|||||||
Reference in New Issue
Block a user