Fix GameData.findBlock

This commit is contained in:
Take Weiland 2015-11-08 15:34:31 +01:00
parent b6664c76c5
commit e6d8fde415

View file

@ -155,13 +155,12 @@ public class GameData {
static Item findItem(String modId, String name) static Item findItem(String modId, String name)
{ {
return (Item)getMain().iItemRegistry.getObject(modId + ":" + name); return getMain().iItemRegistry.getObject(modId + ":" + name);
} }
static Block findBlock(String modId, String name) static Block findBlock(String modId, String name)
{ {
String key = modId + ":" + name; return getMain().iBlockRegistry.getObject(modId + ":" + name);
return getMain().iBlockRegistry.containsKey(key) ? getMain().iBlockRegistry.getObject(key) : null;
} }
static UniqueIdentifier getUniqueName(Block block) static UniqueIdentifier getUniqueName(Block block)