From d73573e7c5176285b2a750dc2a1637ff79c2ec95 Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Thu, 4 Jun 2026 21:06:56 +0200 Subject: [PATCH] =?UTF-8?q?feat(items):=20Item.getDisplayName()=20?= =?UTF-8?q?=E2=80=94=20furnidata=20name=20with=20public=5Fname=20fallback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/eu/habbo/habbohotel/items/Item.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/Item.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/Item.java index 323f9758..4fcecb85 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/Item.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/Item.java @@ -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; }