added display_name property

This commit is contained in:
D3v1s0m 2023-10-09 12:21:57 +05:30
parent f3c0df41dc
commit 27a6f32f4f
No known key found for this signature in database
GPG Key ID: FA1F770C7B1D40C1
3 changed files with 3 additions and 2 deletions

@ -120,6 +120,7 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
register(new EquipmentProperty(packetFactory, "offhand", EquipmentSlot.OFF_HAND));
register(new NameProperty(legacyNames, optionalComponents));
register(new DummyProperty<>("display_name", String.class));
register(new DinnerboneProperty(legacyNames, optionalComponents));
register(new DummyProperty<>("look", LookType.FIXED));

@ -115,7 +115,7 @@ public class NpcTypeImpl implements NpcType {
public NpcTypeImpl build() {
ServerVersion version = PacketEvents.getAPI().getServerManager().getVersion();
addProperties("fire", "invisible", "silent", "look", "look_distance", "view_distance",
"potion_color", "potion_ambient");
"potion_color", "potion_ambient", "display_name");
if (!type.equals(EntityTypes.PLAYER)) addProperties("dinnerbone");
// TODO: make this look nicer after completing the rest of the properties
if (version.isNewerThanOrEquals(ServerVersion.V_1_9)) addProperties("glow");

@ -14,6 +14,6 @@ public class StringParser extends ParserType<String> {
@Override
public String parse(Deque<String> deque) throws CommandExecutionException {
return deque.pollFirst();
return String.join(" ", deque);
}
}