ItemShard fix

Fixes #267: Wildcard damage values will no longer cause GUI crashes.
Added Thaumcraft's itemShard to the ore dictionary, allowing
autocrafting substitutions where allowed.
This commit is contained in:
Chris committed 2016-01-24 18:43:45 -05:00
1 parent 963dda76e1
commit 2cfd702f1b
6 files changed
+25 -6

No files matched your search

+5 -1
View File
@@ -1,4 +1,8 @@
01/23/2016 1.0.0.0 - Beta
01/24/2016 1.0.0.1 - Beta
Fixes #267: Wildcard damage values will no longer cause GUI crashes.
Added Thaumcraft's itemShard to the ore dictionary, allowing autocrafting substitutions where allowed.
01/23/2016 1.0.0.0 - Beta
Fixed SMP packet crash.
Fixed potential golem hook crash.
Added levels of interaction.
+1 -1
View File
@@ -17,7 +17,7 @@ buildscript {
apply plugin: 'forge'
version = "1.0.0.0"
version = "1.0.0.1"
group= "thaumicenergistics" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "thaumicenergistics"
@@ -1,6 +1,8 @@
package thaumicenergistics.common;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.common.config.ConfigItems;
import thaumicenergistics.common.fluids.GaseousEssentia;
import thaumicenergistics.common.items.ItemEnum;
import thaumicenergistics.common.items.ItemMaterial;
@@ -52,6 +54,9 @@ public class CommonProxy
// Add iron gear to the oredic
OreDictionary.registerOre( "gearIron", ItemMaterial.MaterialTypes.IRON_GEAR.getStack() );
// Add the shard from thaumcraft so that AE will suggest replacements.
OreDictionary.registerOre( "materialAspectShard", new ItemStack( ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE ) );
}
/**
@@ -39,7 +39,7 @@ public class ThaumicEnergistics
/**
* Current version of the mod.
*/
public static final String VERSION = "1.0.0.0"; // NOTE: don't forget to change the build.gradle file as well
public static final String VERSION = "1.0.0.1"; // NOTE: don't forget to change the build.gradle file as well
/**
* Singleton instance
@@ -9,6 +9,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.crafting.IArcaneRecipe;
import thaumcraft.api.crafting.ShapedArcaneRecipe;
@@ -298,6 +299,15 @@ public class ContainerKnowledgeInscriber
return ingList;
}
// Is this a wildcard item?
else if( ( input instanceof ItemStack ) && ( ( (ItemStack)input ).getItemDamage() == OreDictionary.WILDCARD_VALUE ) )
{
// Create a list to hold the users preferred item, and the wildcard item
ArrayList<ItemStack> ingList = new ArrayList<ItemStack>();
ingList.add( this.craftingSlots[slotNumber].getStack() );
ingList.add( (ItemStack)input );
return ingList;
}
return input;
}
@@ -6,6 +6,7 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.ThaumcraftApiHelper;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
@@ -146,8 +147,8 @@ public class ArcaneCraftingPattern
}
}
// Finally check item damage (32767 is some magic number from thaumcraft)
return( ( target.getItemDamage() == 32767 ) || ( target.getItemDamage() == input.getItemDamage() ) );
// Finally check item damage
return( ( target.getItemDamage() == OreDictionary.WILDCARD_VALUE ) || ( target.getItemDamage() == input.getItemDamage() ) );
}
/**
@@ -209,7 +210,6 @@ public class ArcaneCraftingPattern
@Override
public boolean canSubstitute()
{
//return false;
return true;
}