public ContainerFurnace(net.minecraft.src.InventoryPlayer inventoryplayer, net.minecraft.src.TileEntityFurnace tileentityfurnace) { // Referenced classes of package net.minecraft.src: // Container, Slot, SlotFurnace, InventoryPlayer, // TileEntityFurnace, ICrafting, ItemStack, EntityPlayer lastCookTime = 0; lastBurnTime = 0; lastItemBurnTime = 0; furnace = tileentityfurnace; AddSlot(new net.minecraft.src.Slot(tileentityfurnace, 0, 56, 17)); AddSlot(new net.minecraft.src.Slot(tileentityfurnace, 1, 56, 53)); AddSlot(new net.minecraft.src.SlotFurnace(inventoryplayer.player, tileentityfurnace , 2, 116, 35)); for (int i = 0; i < 3; i++) { for (int k = 0; k < 9; k++) { AddSlot(new net.minecraft.src.Slot(inventoryplayer, k + i * 9 + 9, 8 + k * 18, 84 + i * 18)); } } for (int j = 0; j < 9; j++) { AddSlot(new net.minecraft.src.Slot(inventoryplayer, j, 8 + j * 18, 142)); } }
public EntityPlayer(net.minecraft.src.World world) : base(world) { // Referenced classes of package net.minecraft.src: // EntityLiving, InventoryPlayer, ContainerPlayer, World, // ChunkCoordinates, DataWatcher, Container, StatList, // MathHelper, AxisAlignedBB, Entity, ItemStack, // Item, EntityItem, Material, NBTTagCompound, // NBTTagList, EntityMob, EntityArrow, EntityCreeper, // EntityGhast, EntityWolf, EnumStatus, WorldProvider, // BlockBed, Block, IChunkProvider, EntityMinecart, // AchievementList, EntityBoat, EntityPig, EntityFish, // IInventory, TileEntityFurnace, TileEntityDispenser, TileEntitySign, // StatBase inventory = new net.minecraft.src.InventoryPlayer(this); field_9152_am = 0; score = 0; isSwinging = false; swingProgressInt = 0; timeUntilPortal = 20; inPortal = false; damageRemainder = 0; fishEntity = null; personalCraftingInventory = new net.minecraft.src.ContainerPlayer(inventory, !world.singleplayerWorld); currentCraftingInventory = personalCraftingInventory; yOffset = 1.62F; net.minecraft.src.ChunkCoordinates chunkcoordinates = world.GetSpawnPoint(); SetLocationAndAngles((double)chunkcoordinates.posX + 0.5D, chunkcoordinates.posY + 1, (double)chunkcoordinates.posZ + 0.5D, 0.0F, 0.0F); health = 20; entityType = "humanoid"; field_9117_aI = 180F; fireResistance = 20; texture = "/mob/char.png"; }
public virtual void OnCraftGuiClosed(net.minecraft.src.EntityPlayer entityplayer) { net.minecraft.src.InventoryPlayer inventoryplayer = entityplayer.inventory; if (inventoryplayer.GetItemStack() != null) { entityplayer.DropPlayerItem(inventoryplayer.GetItemStack()); inventoryplayer.SetItemStack(null); } }
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_27085_a(int i, int j, bool flag, net.minecraft.src.EntityPlayer entityplayer) { net.minecraft.src.ItemStack itemstack = null; if (j == 0 || j == 1) { net.minecraft.src.InventoryPlayer inventoryplayer = entityplayer.inventory; if (i == -999) { if (inventoryplayer.GetItemStack() != null && i == -999) { if (j == 0) { entityplayer.DropPlayerItem(inventoryplayer.GetItemStack()); inventoryplayer.SetItemStack(null); } if (j == 1) { entityplayer.DropPlayerItem(inventoryplayer.GetItemStack().SplitStack(1)); if (inventoryplayer.GetItemStack().stackSize == 0) { inventoryplayer.SetItemStack(null); } } } } else { if (flag) { net.minecraft.src.ItemStack itemstack1 = Func_27086_a(i); if (itemstack1 != null) { int k = itemstack1.stackSize; itemstack = itemstack1.Copy(); net.minecraft.src.Slot slot1 = (net.minecraft.src.Slot)inventorySlots[i]; if (slot1 != null && slot1.GetStack() != null) { int l = slot1.GetStack().stackSize; if (l < k) { Func_27085_a(i, j, flag, entityplayer); } } } } else { net.minecraft.src.Slot slot = (net.minecraft.src.Slot)inventorySlots[i]; if (slot != null) { slot.OnSlotChanged(); net.minecraft.src.ItemStack itemstack2 = slot.GetStack(); net.minecraft.src.ItemStack itemstack3 = inventoryplayer.GetItemStack(); if (itemstack2 != null) { itemstack = itemstack2.Copy(); } if (itemstack2 == null) { if (itemstack3 != null && slot.IsItemValid(itemstack3)) { int i1 = j != 0 ? 1 : itemstack3.stackSize; if (i1 > slot.GetSlotStackLimit()) { i1 = slot.GetSlotStackLimit(); } slot.PutStack(itemstack3.SplitStack(i1)); if (itemstack3.stackSize == 0) { inventoryplayer.SetItemStack(null); } } } else { if (itemstack3 == null) { int j1 = j != 0 ? (itemstack2.stackSize + 1) / 2 : itemstack2.stackSize; net.minecraft.src.ItemStack itemstack5 = slot.DecrStackSize(j1); inventoryplayer.SetItemStack(itemstack5); if (itemstack2.stackSize == 0) { slot.PutStack(null); } slot.OnPickupFromSlot(inventoryplayer.GetItemStack()); } else { if (slot.IsItemValid(itemstack3)) { if (itemstack2.itemID != itemstack3.itemID || itemstack2.GetHasSubtypes() && itemstack2 .GetItemDamage() != itemstack3.GetItemDamage()) { if (itemstack3.stackSize <= slot.GetSlotStackLimit()) { net.minecraft.src.ItemStack itemstack4 = itemstack2; slot.PutStack(itemstack3); inventoryplayer.SetItemStack(itemstack4); } } else { int k1 = j != 0 ? 1 : itemstack3.stackSize; if (k1 > slot.GetSlotStackLimit() - itemstack2.stackSize) { k1 = slot.GetSlotStackLimit() - itemstack2.stackSize; } if (k1 > itemstack3.GetMaxStackSize() - itemstack2.stackSize) { k1 = itemstack3.GetMaxStackSize() - itemstack2.stackSize; } itemstack3.SplitStack(k1); if (itemstack3.stackSize == 0) { inventoryplayer.SetItemStack(null); } itemstack2.stackSize += k1; } } else { if (itemstack2.itemID == itemstack3.itemID && itemstack3.GetMaxStackSize() > 1 && (!itemstack2.GetHasSubtypes() || itemstack2.GetItemDamage() == itemstack3.GetItemDamage ())) { int l1 = itemstack2.stackSize; if (l1 > 0 && l1 + itemstack3.stackSize <= itemstack3.GetMaxStackSize()) { itemstack3.stackSize += l1; itemstack2.SplitStack(l1); if (itemstack2.stackSize == 0) { slot.PutStack(null); } slot.OnPickupFromSlot(inventoryplayer.GetItemStack()); } } } } } } } } } return(itemstack); }
public ContainerPlayer(net.minecraft.src.InventoryPlayer inventoryplayer) : this(inventoryplayer, true) { }