Register a dynamic tool shard if no shard is present in the PatternBuilder IMC

This commit is contained in:
Bernhard Bonigl committed 2014-10-18 17:04:35 +02:00
1 parent 9672f95efc
commit c05cdf03c6
1 file changed
+7
@@ -78,6 +78,13 @@ public final class IMCHandler {
ItemStack shard = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("Shard")); // optional
ItemStack rod = new ItemStack(TinkerTools.toolRod, 1, matID);
// default shard if none present. Has to exist because old code.
if(shard == null)
{
TConstructRegistry.addDefaultShardMaterial(matID);
shard = new ItemStack(TinkerTools.toolShard, 1, matID);
}
// register the material
PatternBuilder.instance.registerFullMaterial(item, value, TConstructRegistry.getMaterial(matID).materialName, shard, rod, matID);