Fixed ArrayIndexOutOfBoundsException in getOreName

Added sanity check to prevent ArrayIndexOutOfBoundsException in getOreName for negative ids.
This commit is contained in:
Zarathul 2014-06-16 23:00:40 +02:00
parent bb15efd037
commit e68cfa9f72
1 changed files with 1 additions and 1 deletions

View File

@ -282,7 +282,7 @@ public class OreDictionary
*/
public static String getOreName(int id)
{
return id < idToName.size() ? idToName.get(id) : "Unknown";
return (id >= 0 && id < idToName.size()) ? idToName.get(id) : "Unknown";
}
/**