Fix crash when reloading texture

This commit is contained in:
modmuss50 2016-05-22 21:20:39 +01:00
parent 7d69cab414
commit a24ee95c4d
4 changed files with 13 additions and 11 deletions

View file

@ -118,6 +118,8 @@ public class ModItems
public static Item emptyCell;
public static DynamicCell dynamicCell;
public static final String META_PLACEHOLDER = "PLACEHOLDER_ITEM";
public static void init() throws InstantiationException, IllegalAccessException
{
gems = new ItemGems();

View file

@ -234,7 +234,7 @@ public class ModRecipes
ScrapboxList.addItemStackToList(new ItemStack(ModBlocks.rubberSapling));
for (String i : ItemDusts.types){
if(i.equals("%NULL%")){
if(i.equals(ModItems.META_PLACEHOLDER)){
continue;
}
ScrapboxList.addItemStackToList(ItemDusts.getDustByName(i));
@ -918,7 +918,7 @@ public class ModRecipes
for (String name : ItemDustsSmall.types)
{
if(name.equals("%NULL%")){
if(name.equals(ModItems.META_PLACEHOLDER)){
continue;
}
GameRegistry.addShapelessRecipe(ItemDustsSmall.getSmallDustByName(name, 4), ItemDusts.getDustByName(name));

View file

@ -17,9 +17,9 @@ public class ItemDusts extends ItemTextureBase
"bauxite", "brass", "bronze", "calcite", "charcoal", "chrome", "cinnabar", "clay", "coal", "copper",
"darkAshes", "diamond", "electrum", "emerald", "enderEye", "enderPearl", "endstone", "flint", "galena",
"gold", "grossular", "invar", "iron", "lazurite", "lead", "magnesium", "manganese", "marble", "netherrack",
"nickel", "obsidian", "peridot", "phosphorous", "platinum", "pyrite", "pyrope", "redGarnet", "%NULL%",
"nickel", "obsidian", "peridot", "phosphorous", "platinum", "pyrite", "pyrope", "redGarnet", ModItems.META_PLACEHOLDER,
"ruby", "saltpeter", "sapphire", "sawDust", "silver", "sodalite", "spessartine", "sphalerite", "steel",
"sulfur", "tin", "titanium", "tungsten", "uvarovite", "%NULL%", "yellowGarnet", "zinc",
"sulfur", "tin", "titanium", "tungsten", "uvarovite", ModItems.META_PLACEHOLDER, "yellowGarnet", "zinc",
"olivine", "andesite", "diorite", "granite" };
public ItemDusts()
@ -35,7 +35,7 @@ public class ItemDusts extends ItemTextureBase
{
if (types[i].equalsIgnoreCase(name))
{
if(types[i].equals("%NULL%")){
if(types[i].equals(ModItems.META_PLACEHOLDER)){
throw new InvalidParameterException("The dust " + name + " could not be found.");
}
return new ItemStack(ModItems.dusts, count, i);
@ -80,7 +80,7 @@ public class ItemDusts extends ItemTextureBase
{
for (int meta = 0; meta < types.length; ++meta)
{
if(!types[meta].equals("%NULL%")){
if(!types[meta].equals(ModItems.META_PLACEHOLDER)){
list.add(new ItemStack(item, 1, meta));
}
}

View file

@ -18,9 +18,9 @@ public class ItemDustsSmall extends ItemTextureBase
"bauxite", "brass", "bronze", "calcite", "charcoal", "chrome", "cinnabar", "clay", "coal", "copper",
"darkAshes", "diamond", "electrum", "emerald", "enderEye", "enderPearl", "endstone", "flint", "galena",
"gold", "grossular", "invar", "iron", "lazurite", "lead", "magnesium", "manganese", "marble", "netherrack",
"nickel", "obsidian", "peridot", "phosphorous", "platinum", "pyrite", "pyrope", "redGarnet", "%NULL%",
"nickel", "obsidian", "peridot", "phosphorous", "platinum", "pyrite", "pyrope", "redGarnet", ModItems.META_PLACEHOLDER,
"ruby", "saltpeter", "sapphire", "sawDust", "silver", "sodalite", "spessartine", "sphalerite", "steel",
"sulfur", "tin", "titanium", "tungsten", "uvarovite", "%NULL%", "yellowGarnet", "zinc",
"sulfur", "tin", "titanium", "tungsten", "uvarovite", ModItems.META_PLACEHOLDER, "yellowGarnet", "zinc",
"olivine", "redstone", "glowstone", "andesite", "diorite", "granite" };
public ItemDustsSmall()
@ -36,7 +36,7 @@ public class ItemDustsSmall extends ItemTextureBase
{
if (types[i].equalsIgnoreCase(name))
{
if(types[i].equals("%NULL%")){
if(types[i].equals(ModItems.META_PLACEHOLDER)){
throw new InvalidParameterException("The small dust " + name + " could not be found.");
}
return new ItemStack(ModItems.smallDusts, count, i);
@ -68,7 +68,7 @@ public class ItemDustsSmall extends ItemTextureBase
{
for (int meta = 0; meta < types.length; ++meta)
{
if(!types[meta].equals("%NULL%")){
if(!types[meta].equals(ModItems.META_PLACEHOLDER)){
list.add(new ItemStack(item, 1, meta));
}
}
@ -77,7 +77,7 @@ public class ItemDustsSmall extends ItemTextureBase
@Override
public String getTextureName(int damage)
{
if(types[damage].equals("%NULL%")){
if(types[damage].equals(ModItems.META_PLACEHOLDER)){
damage = 0;
}
return ModInfo.MOD_ID + ":items/smallDust/small" + StringUtils.toFirstCapital(types[damage]) + "Dust";