Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-16 04:50:07 +01:00
Fix: Text display offset <https://github.com/GeyserMC/Geyser/issues/4439> (#4883)
Dieser Commit ist enthalten in:
Ursprung
ddce10138e
Commit
b248abf495
@ -327,6 +327,7 @@ public final class EntityDefinitions {
|
|||||||
TEXT_DISPLAY = EntityDefinition.inherited(TextDisplayEntity::new, displayBase)
|
TEXT_DISPLAY = EntityDefinition.inherited(TextDisplayEntity::new, displayBase)
|
||||||
.type(EntityType.TEXT_DISPLAY)
|
.type(EntityType.TEXT_DISPLAY)
|
||||||
.identifier("minecraft:armor_stand")
|
.identifier("minecraft:armor_stand")
|
||||||
|
.offset(-0.5f)
|
||||||
.addTranslator(MetadataType.CHAT, TextDisplayEntity::setText)
|
.addTranslator(MetadataType.CHAT, TextDisplayEntity::setText)
|
||||||
.addTranslator(null) // Line width
|
.addTranslator(null) // Line width
|
||||||
.addTranslator(null) // Background color
|
.addTranslator(null) // Background color
|
||||||
|
@ -38,7 +38,17 @@ import java.util.UUID;
|
|||||||
// Note: 1.19.4 requires that the billboard is set to something in order to show, on Java Edition
|
// Note: 1.19.4 requires that the billboard is set to something in order to show, on Java Edition
|
||||||
public class TextDisplayEntity extends DisplayBaseEntity {
|
public class TextDisplayEntity extends DisplayBaseEntity {
|
||||||
public TextDisplayEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
|
public TextDisplayEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
|
||||||
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
|
super(session, entityId, geyserId, uuid, definition, position.add(0, definition.offset(), 0), motion, yaw, pitch, headYaw);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void moveRelative(double relX, double relY, double relZ, float yaw, float pitch, boolean isOnGround) {
|
||||||
|
super.moveRelative(relX, relY + definition.offset(), relZ, yaw, pitch, isOnGround);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void moveAbsolute(Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported) {
|
||||||
|
super.moveAbsolute(position.add(Vector3f.from(0, definition.offset(), 0)), yaw, pitch, headYaw, isOnGround, teleported);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren