public virtual net.minecraft.src.ItemStack FindMatchingRecipe(net.minecraft.src.InventoryCrafting inventorycrafting) { for (int i = 0; i < recipes.Count; i++) { net.minecraft.src.IRecipe irecipe = (net.minecraft.src.IRecipe)recipes[i]; if (irecipe.Func_21134_a(inventorycrafting)) { return(irecipe.Func_21136_b(inventorycrafting)); } } return(null); }
public virtual bool Func_21134_a(net.minecraft.src.InventoryCrafting inventorycrafting ) { System.Collections.ArrayList arraylist = new System.Collections.ArrayList(field_21137_b ); int i = 0; do { if (i >= 3) { break; } for (int j = 0; j < 3; j++) { net.minecraft.src.ItemStack itemstack = inventorycrafting.Func_21084_a(j, i); if (itemstack == null) { continue; } bool flag = false; System.Collections.IEnumerator iterator = arraylist.GetEnumerator(); do { if (!iterator.MoveNext()) { break; } net.minecraft.src.ItemStack itemstack1 = (net.minecraft.src.ItemStack)iterator.Current; if (itemstack.itemID != itemstack1.itemID || itemstack1.GetItemDamage() != -1 && itemstack.GetItemDamage() != itemstack1.GetItemDamage()) { continue; } flag = true; arraylist.Remove(itemstack1); break; }while (true); if (!flag) { return(false); } } i++; }while (true); return(arraylist.Count < 1); }
private bool Func_21139_a(net.minecraft.src.InventoryCrafting inventorycrafting, int i, int j, bool flag) { for (int k = 0; k < 3; k++) { for (int l = 0; l < 3; l++) { int i1 = k - i; int j1 = l - j; net.minecraft.src.ItemStack itemstack = null; if (i1 >= 0 && j1 >= 0 && i1 < field_21140_b && j1 < field_21144_c) { if (flag) { itemstack = field_21143_d[(field_21140_b - i1 - 1) + j1 * field_21140_b]; } else { itemstack = field_21143_d[i1 + j1 * field_21140_b]; } } net.minecraft.src.ItemStack itemstack1 = inventorycrafting.Func_21084_a(k, l); if (itemstack1 == null && itemstack == null) { continue; } if (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) { return(false); } if (itemstack.itemID != itemstack1.itemID) { return(false); } if (itemstack.GetItemDamage() != -1 && itemstack.GetItemDamage() != itemstack1.GetItemDamage ()) { return(false); } } } return(true); }
public virtual bool Func_21134_a(net.minecraft.src.InventoryCrafting inventorycrafting ) { for (int i = 0; i <= 3 - field_21140_b; i++) { for (int j = 0; j <= 3 - field_21144_c; j++) { if (Func_21139_a(inventorycrafting, i, j, true)) { return(true); } if (Func_21139_a(inventorycrafting, i, j, false)) { return(true); } } } return(false); }
public ContainerPlayer(net.minecraft.src.InventoryPlayer inventoryplayer, bool flag ) { // Referenced classes of package net.minecraft.src: // Container, InventoryCrafting, InventoryCraftResult, SlotCrafting, // InventoryPlayer, Slot, SlotArmor, CraftingManager, // IInventory, EntityPlayer, ItemStack craftMatrix = new net.minecraft.src.InventoryCrafting(this, 2, 2); craftResult = new net.minecraft.src.InventoryCraftResult(); isMP = false; isMP = flag; AddSlot(new net.minecraft.src.SlotCrafting(inventoryplayer.player, craftMatrix, craftResult, 0, 144, 36)); for (int i = 0; i < 2; i++) { for (int i1 = 0; i1 < 2; i1++) { AddSlot(new net.minecraft.src.Slot(craftMatrix, i1 + i * 2, 88 + i1 * 18, 26 + i * 18)); } } for (int j = 0; j < 4; j++) { int j1 = j; AddSlot(new net.minecraft.src.SlotArmor(this, inventoryplayer, inventoryplayer.GetSizeInventory() - 1 - j, 8, 8 + j * 18, j1)); } for (int k = 0; k < 3; k++) { for (int k1 = 0; k1 < 9; k1++) { AddSlot(new net.minecraft.src.Slot(inventoryplayer, k1 + (k + 1) * 9, 8 + k1 * 18, 84 + k * 18)); } } for (int l = 0; l < 9; l++) { AddSlot(new net.minecraft.src.Slot(inventoryplayer, l, 8 + l * 18, 142)); } OnCraftMatrixChanged(craftMatrix); }
public ContainerWorkbench(net.minecraft.src.InventoryPlayer inventoryplayer, net.minecraft.src.World world, int i, int j, int k) { // Referenced classes of package net.minecraft.src: // Container, InventoryCrafting, InventoryCraftResult, SlotCrafting, // InventoryPlayer, Slot, CraftingManager, IInventory, // World, EntityPlayer, Block, ItemStack craftMatrix = new net.minecraft.src.InventoryCrafting(this, 3, 3); craftResult = new net.minecraft.src.InventoryCraftResult(); field_20150_c = world; field_20149_h = i; field_20148_i = j; field_20147_j = k; AddSlot(new net.minecraft.src.SlotCrafting(inventoryplayer.player, craftMatrix, craftResult , 0, 124, 35)); for (int l = 0; l < 3; l++) { for (int k1 = 0; k1 < 3; k1++) { AddSlot(new net.minecraft.src.Slot(craftMatrix, k1 + l * 3, 30 + k1 * 18, 17 + l * 18)); } } for (int i1 = 0; i1 < 3; i1++) { for (int l1 = 0; l1 < 9; l1++) { AddSlot(new net.minecraft.src.Slot(inventoryplayer, l1 + i1 * 9 + 9, 8 + l1 * 18, 84 + i1 * 18)); } } for (int j1 = 0; j1 < 9; j1++) { AddSlot(new net.minecraft.src.Slot(inventoryplayer, j1, 8 + j1 * 18, 142)); } OnCraftMatrixChanged(craftMatrix); }
public virtual net.minecraft.src.ItemStack Func_21136_b(net.minecraft.src.InventoryCrafting inventorycrafting) { return(field_21138_a.Copy()); }
public virtual net.minecraft.src.ItemStack Func_21136_b(net.minecraft.src.InventoryCrafting inventorycrafting) { return(new net.minecraft.src.ItemStack(field_21142_e.itemID, field_21142_e.stackSize , field_21142_e.GetItemDamage())); }