Log.warn(t, "Can't get inventory name for %s", cls);
}
}
if (target instanceof TileEntity) {
TileEntity te = (TileEntity)target;
try {
String mapping = getClassToNameMap().get(cls);
if (!Strings.isNullOrEmpty(mapping)) return mapping;
} catch (Throwable t) {
Log.warn(t, "Failed to map class %s to name", cls);
}
try {
Block block = te.getBlockType();
if (block != null) {
int dmg = te.getBlockMetadata();
ItemStack is = new ItemStack(block, 1, dmg);
try {
String name = is.getDisplayName();
if (!Strings.isNullOrEmpty(name)) return name;