Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +01:00
Fixed armorstand passenger yOffset (#2976)
Dieser Commit ist enthalten in:
Ursprung
71c489b462
Commit
fef0401add
@ -51,6 +51,7 @@ public class ArmorStandEntity extends LivingEntity {
|
||||
@Getter
|
||||
private boolean isMarker = false;
|
||||
private boolean isInvisible = false;
|
||||
@Getter
|
||||
private boolean isSmall = false;
|
||||
|
||||
/**
|
||||
@ -74,6 +75,7 @@ public class ArmorStandEntity extends LivingEntity {
|
||||
* - No armor, no name: false
|
||||
* - No armor, yes name: true
|
||||
*/
|
||||
@Getter
|
||||
private boolean positionRequiresOffset = false;
|
||||
/**
|
||||
* Whether we should update the position of this armor stand after metadata updates.
|
||||
@ -411,6 +413,8 @@ public class ArmorStandEntity extends LivingEntity {
|
||||
this.positionRequiresOffset = newValue;
|
||||
if (positionRequiresOffset) {
|
||||
this.position = applyOffsetToPosition(position);
|
||||
// Update the passenger offset as armorstand is moving up by roughly 2 blocks
|
||||
updatePassengerOffsets();
|
||||
} else {
|
||||
this.position = removeOffsetFromPosition(position);
|
||||
}
|
||||
|
@ -187,6 +187,15 @@ public final class EntityUtils {
|
||||
case MINECART, HOPPER_MINECART, TNT_MINECART, CHEST_MINECART, FURNACE_MINECART, SPAWNER_MINECART,
|
||||
COMMAND_BLOCK_MINECART, BOAT, CHEST_BOAT -> yOffset -= mount.getDefinition().height() * 0.5f;
|
||||
}
|
||||
if (passenger.getDefinition().entityType() == EntityType.FALLING_BLOCK) {
|
||||
yOffset += 0.5f;
|
||||
}
|
||||
if (mount.getDefinition().entityType() == EntityType.ARMOR_STAND) {
|
||||
ArmorStandEntity armorStand = (ArmorStandEntity) mount;
|
||||
if (armorStand.isPositionRequiresOffset()) {
|
||||
yOffset -= EntityDefinitions.ARMOR_STAND.height() * (armorStand.isSmall() ? 0.55d : 1d);
|
||||
}
|
||||
}
|
||||
Vector3f offset = Vector3f.from(xOffset, yOffset, zOffset);
|
||||
passenger.setRiderSeatPosition(offset);
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren