Fixed error at lookup of non vanilla block types

This commit is contained in:
Robin Kupper
2011-06-18 23:50:05 +02:00
parent af8c919ded
commit a5e532f7f6

View File

@@ -116,7 +116,10 @@ public class BukkitUtils
}
public static String getMaterialName(int type) {
return Material.getMaterial(type).toString().replace('_', ' ').toLowerCase();
final Material mat = Material.getMaterial(type);
if (mat != null)
return mat.toString().replace('_', ' ').toLowerCase();
return String.valueOf(type);
}
public static String getSenderName(CommandSender sender) {