mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00: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>
This commit is contained in:
parent
119fbc86bc
commit
3292718e69
1 changed files with 7 additions and 0 deletions
|
@ -34,6 +34,7 @@ import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.translator.text.MessageTranslator;
|
import org.geysermc.geyser.translator.text.MessageTranslator;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
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
|
||||||
|
@ -56,6 +57,12 @@ public class TextDisplayEntity extends Entity {
|
||||||
// On JE: Hiding the display name still shows the display entity text.
|
// 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) {
|
public void setText(EntityMetadata<Component, ?> entityMetadata) {
|
||||||
this.dirtyMetadata.put(EntityDataTypes.NAME, MessageTranslator.convertMessage(entityMetadata.getValue()));
|
this.dirtyMetadata.put(EntityDataTypes.NAME, MessageTranslator.convertMessage(entityMetadata.getValue()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue