mirror of
https://github.com/GTNewHorizons/IguanaTweaksTConstruct.git
synced 2026-11-26 06:43:05 +00:00
Fixed missing gravel drop bug Added config option to override pickaxe harvest level
37 lines
1.1 KiB
Java
37 lines
1.1 KiB
Java
package iguanaman.iguanatweakstconstruct.util;
|
|
|
|
import iguanaman.iguanatweakstconstruct.IguanaLog;
|
|
import tconstruct.TConstruct;
|
|
import tconstruct.common.TContent;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.inventory.IInventory;
|
|
import net.minecraft.item.ItemStack;
|
|
import cpw.mods.fml.common.FMLLog;
|
|
import cpw.mods.fml.common.ICraftingHandler;
|
|
|
|
public class IguanaPatternCraftingHandler implements ICraftingHandler {
|
|
|
|
@Override
|
|
public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) {
|
|
|
|
if (item.getItem().itemID == TContent.woodPattern.itemID)
|
|
{
|
|
for (int i = 0; i < craftMatrix.getSizeInventory(); i++)
|
|
{
|
|
ItemStack inSlot = craftMatrix.getStackInSlot(i);
|
|
if (inSlot != null && inSlot.getItem().itemID == TContent.woodPattern.itemID)
|
|
{
|
|
if (inSlot.stackSize > 1) --inSlot.stackSize;
|
|
else craftMatrix.setInventorySlotContents(i, null);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
@Override
|
|
public void onSmelting(EntityPlayer player, ItemStack item) {}
|
|
|
|
}
|