Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CarvingRecipe extends ShapedOreRecipe{
- private ItemStack baseShears;
- private String matName;
- public CarvingRecipe() {
- super(new ItemStack(Item.getItemFromBlock(PumpkinCarving.carvedPumpkin),1,0), new Object[] {" ", "BA", 'A', Blocks.PUMPKIN, 'B', new ItemStack(Items.SHEARS,1,OreDictionary.WILDCARD_VALUE)});
- }
- @Override
- public ItemStack[] getRemainingItems(InventoryCrafting inv) {
- ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()];
- for (int i = 0; i < aitemstack.length; ++i)
- {
- ItemStack itemstack = inv.getStackInSlot(i);
- if(itemstack.getItem() == Items.SHEARS){
- ItemStack shearscopy = itemstack.copy();
- if(shearscopy.attemptDamageItem(1, Minecraft.getMinecraft().theWorld.rand)){
- ForgeEventFactory.onPlayerDestroyItem(ForgeHooks.getCraftingPlayer(), itemstack, null);
- aitemstack[i] = null;
- }else{
- aitemstack[i] = shearscopy;
- }
- }else{
- aitemstack[i] = ForgeHooks.getContainerItem(itemstack);
- }
- }
- return aitemstack;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement