Fixed Bug: #0603 - Anvil Repair of Quartz Tools

This commit is contained in:
AlgorithmX2
2014-07-12 17:57:53 -05:00
parent c0c28e6681
commit 3ec4d8495e
7 changed files with 76 additions and 13 deletions
+16
View File
@@ -19,6 +19,7 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.inventory.InventoryCrafting;
@@ -83,6 +84,7 @@ import appeng.api.util.AEItemDefinition;
import appeng.core.AEConfig;
import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.hooks.TickHandler;
import appeng.me.GridAccessException;
@@ -1680,4 +1682,18 @@ public class Platform
TickHandler.instance.addCallable( worldObj, new BlockUpdate( worldObj, xCoord, yCoord, zCoord ) );
}
public static boolean canRepair(AEFeature type, ItemStack a, ItemStack b)
{
if ( b == null || a == null )
return false;
if ( type == AEFeature.CertusQuartzTools )
return AEApi.instance().materials().materialCertusQuartzCrystal.sameAsStack( b );
if ( type == AEFeature.NetherQuartzTools )
return Items.quartz == b.getItem();
return false;
}
}