1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

Some work on mannequins

This commit is contained in:
onebeastchris
2025-10-11 16:49:22 +02:00
parent d7d9e48927
commit 28b31f4980
3 changed files with 14 additions and 5 deletions

View File

@@ -125,7 +125,7 @@ public class Entity implements GeyserEntity {
@Setter(AccessLevel.NONE) @Setter(AccessLevel.NONE)
private float boundingBoxWidth; private float boundingBoxWidth;
@Setter(AccessLevel.NONE) @Setter(AccessLevel.NONE)
private String displayName; protected String displayName;
@Setter(AccessLevel.NONE) @Setter(AccessLevel.NONE)
protected boolean silent = false; protected boolean silent = false;
/* Metadata end */ /* Metadata end */

View File

@@ -269,13 +269,17 @@ public class AvatarEntity extends LivingEntity {
@Override @Override
public void setDisplayName(EntityMetadata<Optional<Component>, ?> entityMetadata) { public void setDisplayName(EntityMetadata<Optional<Component>, ?> entityMetadata) {
// Doesn't do anything for players // Doesn't do anything for players
// TODO test mannequins if (!(this instanceof PlayerEntity)) {
super.setDisplayName(entityMetadata);
}
} }
@Override @Override
public void setDisplayNameVisible(BooleanEntityMetadata entityMetadata) { public void setDisplayNameVisible(BooleanEntityMetadata entityMetadata) {
// Doesn't do anything for players // Doesn't do anything for players
// TODO test mannequins if (!(this instanceof PlayerEntity)) {
super.setDisplayNameVisible(entityMetadata);
}
} }
public void setBelowNameText(String text) { public void setBelowNameText(String text) {

View File

@@ -38,14 +38,19 @@ import java.util.UUID;
public class MannequinEntity extends AvatarEntity { public class MannequinEntity extends AvatarEntity {
public MannequinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { public MannequinEntity(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, "Mannequin"); // TODO from translation super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw, "");
} }
public void setProfile(EntityMetadata<ResolvableProfile, ?> entityMetadata) { public void setProfile(EntityMetadata<ResolvableProfile, ?> entityMetadata) {
setSkin(entityMetadata.getValue(), true, () -> {}); setSkin(entityMetadata.getValue(), true, () -> {});
} }
public void setDescription(EntityMetadata<Optional<Component>, ?> entityMetadata) { @Override
public String getDisplayName() {
return displayName;
}
public void setDescription(EntityMetadata<Optional<Component>, ?> entityMetadata) {
// TODO
} }
} }