Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-25 15:50:14 +01:00
Don't show custom names on display entities (#4309)
* Ensure that a custom text display entity name doesn't show up - it doesn't show on Java, and if we show it, the text display contents aren't shown. * Update core/src/main/java/org/geysermc/geyser/entity/type/TextDisplayEntity.java Co-authored-by: Konicai <71294714+Konicai@users.noreply.github.com> --------- Co-authored-by: Konicai <71294714+Konicai@users.noreply.github.com>
Dieser Commit ist enthalten in:
Ursprung
119fbc86bc
Commit
3292718e69
@ -34,6 +34,7 @@ import org.geysermc.geyser.entity.EntityDefinition;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.translator.text.MessageTranslator;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
// Note: 1.19.4 requires that the billboard is set to something in order to show, on Java Edition
|
||||
@ -56,6 +57,12 @@ public class TextDisplayEntity extends Entity {
|
||||
// On JE: Hiding the display name still shows the display entity text.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisplayName(EntityMetadata<Optional<Component>, ?> entityMetadata) {
|
||||
// This would usually set EntityDataTypes.NAME, but we are instead using NAME for the text display.
|
||||
// On JE: custom name does not override text display.
|
||||
}
|
||||
|
||||
public void setText(EntityMetadata<Component, ?> entityMetadata) {
|
||||
this.dirtyMetadata.put(EntityDataTypes.NAME, MessageTranslator.convertMessage(entityMetadata.getValue()));
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren