feat(items): Item.getDisplayName() — furnidata name with public_name fallback

This commit is contained in:
simoleo89
2026-06-04 21:06:56 +02:00
parent efb88e5957
commit d73573e7c5
@@ -167,6 +167,17 @@ public class Item implements ISerialize {
return this.fullName;
}
/**
* Display name for user-facing/log output, sourced from furnidata (by classname).
* Falls back to the DB public_name when furnidata has no entry or names are disabled.
* Never returns null.
*/
public String getDisplayName() {
FurnitureTextProvider provider = Emulator.getGameEnvironment().getFurnitureTextProvider();
String name = (provider != null) ? provider.getName(this.name) : null;
return (name != null && !name.isBlank()) ? name : this.fullName;
}
public FurnitureType getType() {
return this.type;
}