Merge pull request #1796 from KingLemming/1.7.10
Adjusts OreDictionary to prevent invalid registrations.
This commit is contained in:
commit
b30b551197
2 changed files with 8 additions and 3 deletions
|
@ -171,7 +171,7 @@ public abstract class FluidContainerRegistry
|
||||||
}
|
}
|
||||||
if (data.fluid == null || data.fluid.getFluid() == null)
|
if (data.fluid == null || data.fluid.getFluid() == null)
|
||||||
{
|
{
|
||||||
FMLLog.bigWarning("Invalid registration attempt for a fluid container item %s (type %s) has occurred. The registration has been denied to prevent crashes. The mod responsible for the registration needs to correct this.", data.filledContainer.getItem().getUnlocalizedName(data.filledContainer));
|
FMLLog.bigWarning("Invalid registration attempt for a fluid container item %s has occurred. The registration has been denied to prevent crashes. The mod responsible for the registration needs to correct this.", data.filledContainer.getItem().getUnlocalizedName(data.filledContainer));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
containerFluidMap.put(new ContainerKey(data.filledContainer), data);
|
containerFluidMap.put(new ContainerKey(data.filledContainer), data);
|
||||||
|
|
|
@ -344,7 +344,7 @@ public class OreDictionary
|
||||||
*/
|
*/
|
||||||
public static ArrayList<ItemStack> getOres(String name) //TODO: 1.8 ArrayList -> List
|
public static ArrayList<ItemStack> getOres(String name) //TODO: 1.8 ArrayList -> List
|
||||||
{
|
{
|
||||||
return getOres(getOreID(name));
|
return nameToId.get(name) != null ? getOres(getOreID(name)) : EMPTY_LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -447,7 +447,12 @@ public class OreDictionary
|
||||||
*/
|
*/
|
||||||
private static void registerOreImpl(String name, ItemStack ore)
|
private static void registerOreImpl(String name, ItemStack ore)
|
||||||
{
|
{
|
||||||
if ("Unknown".equals(name)) return; //prevent bad IDs.
|
if (name == null || name.isEmpty() || "Unknown".equals(name)) return; //prevent bad IDs.
|
||||||
|
if (ore == null || ore.getItem() == null)
|
||||||
|
{
|
||||||
|
FMLLog.bigWarning("Invalid registration attempt for an Ore Dictionary item with name %s has occurred. The registration has been denied to prevent crashes. The mod responsible for the registration needs to correct this.", name);
|
||||||
|
return; //prevent bad ItemStacks.
|
||||||
|
}
|
||||||
|
|
||||||
int oreID = getOreID(name);
|
int oreID = getOreID(name);
|
||||||
int hash = Item.getIdFromItem(ore.getItem());
|
int hash = Item.getIdFromItem(ore.getItem());
|
||||||
|
|
Loading…
Reference in a new issue