From aafb854e4f8435b40862df82bc52f5a9166ac818 Mon Sep 17 00:00:00 2001 From: wizjany Date: Sat, 2 Mar 2019 12:26:26 -0500 Subject: [PATCH] More useful names for block ItemTypes. --- .../world/registry/BundledItemRegistry.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java index 3e0ae8800..1ab788e42 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java @@ -32,7 +32,16 @@ public class BundledItemRegistry implements ItemRegistry { @Nullable @Override public String getName(ItemType itemType) { - BundledItemData.ItemEntry itemEntry = BundledItemData.getInstance().findById(itemType.getId()); - return itemEntry != null ? itemEntry.localizedName : null; + String id = itemType.getId(); + BundledItemData.ItemEntry itemEntry = BundledItemData.getInstance().findById(id); + if (itemEntry != null) { + String localized = itemEntry.localizedName; + if (localized.equals("Air")) { + int c = id.indexOf(':'); + return c < 0 ? id : id.substring(c + 1); + } + return localized; + } + return null; } }