Fix substitutions for recipes and oredict recipes. Should mean that substitutions start working properly.

This commit is contained in:
cpw committed 2015-10-29 08:46:23 -04:00
1 parent 605457deec
commit 945d3887d2
3 files changed
+43 -8

No files matched your search

@@ -29,6 +29,7 @@ import com.google.common.collect.Maps;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.registry.GameData;
public class OreDictionary
{
@@ -493,7 +494,8 @@ public class OreDictionary
}
int oreID = getOreID(name);
int hash = Item.getIdFromItem(ore.getItem());
// HACK: use the registry name's ID. It is unique and it knows about substitutions
int hash = GameData.getItemRegistry().getId(ore.getItem().delegate.name());
if (ore.getItemDamage() != WILDCARD_VALUE)
{
hash |= ((ore.getItemDamage() + 1) << 16); // +1 so 0 is significant
@@ -537,7 +539,8 @@ public class OreDictionary
if (ores == null) continue;
for (ItemStack ore : ores)
{
int hash = Item.getIdFromItem(ore.getItem());
// HACK: use the registry name's ID. It is unique and it knows about substitutions
int hash = GameData.getItemRegistry().getId(ore.getItem().delegate.name());
if (ore.getItemDamage() != WILDCARD_VALUE)
{
hash |= ((ore.getItemDamage() + 1) << 16); // +1 so meta 0 is significant