Fixed ArrayIndexOutOfBoundsException in getOreName
Added sanity check to prevent ArrayIndexOutOfBoundsException in getOreName for negative ids.
This commit is contained in:
parent
bb15efd037
commit
e68cfa9f72
|
@ -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";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue