Package net.minecraft.src
Class Container
java.lang.Object
net.minecraft.src.Container
- Direct Known Subclasses:
BlockDispenserContainer,ContainerBeacon,ContainerBrewingStand,ContainerChest,ContainerDispenser,ContainerEnchantment,ContainerFurnace,ContainerHopper,ContainerHorseInventory,ContainerMerchant,ContainerPlayer,ContainerRepair,ContainerWorkbench,HopperContainer,InfernalEnchanterContainer,InventoryContainer,ItemRenameContainer,LoomContainer,PulleyContainer,SoulforgeContainer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Listlist of all people that need to be notified when this craftinventory changesthe list of all items(stacks) for the corresponding slotthe list of all slots in the inventoryint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SlotaddSlotToContainer(Slot par1Slot) the slot is assumed emptyprotected booleanattemptToMergeWithSlot(ItemStack stackSource, int iTempSlot) protected booleanattemptToMergeWithSlotIfEmpty(ItemStack stackSource, int iTempSlot) static intcalcRedstoneFromInventory(IInventory par0IInventory) booleancanDragIntoSlot(Slot par1Slot) Returns true if the player can "drag-spilt" items into this slot,. returns true by default.abstract booleancanInteractWith(EntityPlayer var1) voidLooks for changes made in the container, sends them to every listener.booleanenchantItem(EntityPlayer par1EntityPlayer, int par2) enchants the item on the table using the specified slot; also deducts XP from playerstatic voidfunc_94525_a(Set par0Set, int par1, ItemStack par2ItemStack, int par3) static booleanfunc_94527_a(Slot par0Slot, ItemStack par1ItemStack, boolean par2) static booleanfunc_94528_d(int par0) static intfunc_94529_b(int par0) booleanfunc_94530_a(ItemStack par1ItemStack, Slot par2Slot) static intfunc_94532_c(int par0) protected voidstatic intfunc_94534_d(int par0, int par1) returns a list if itemStacks, for each slot.shortgetNextTransactionID(InventoryPlayer par1InventoryPlayer) Gets a unique transaction ID.getSlot(int par1) getSlotFromInventory(IInventory par1IInventory, int par2) booleanisPlayerNotUsingContainer(EntityPlayer par1EntityPlayer) NotUsing because adding a player twice is an errorprotected booleanmergeItemStack(ItemStack stackSource, int iSlotDestFirst, int iSlotDestCap) protected booleanmergeItemStack(ItemStack stackSource, int iSlotDestFirst, int iSlotDestCap, boolean bFavorHotbar) protected booleanmergeItemStackFavoringHotbar(ItemStack stackSource, int iSlotDestFirst, int iSlotDestCap) voidonContainerClosed(EntityPlayer par1EntityPlayer) Called when the container is closed.voidonCraftGuiOpened(ICrafting par1ICrafting) voidonCraftMatrixChanged(IInventory par1IInventory) Callback for when the crafting matrix is changed.voidputStackInSlot(int par1, ItemStack par2ItemStack) args: slotID, itemStack to put in slotvoidputStacksInSlots(ItemStack[] par1ArrayOfItemStack) places itemstacks in first x slots, x being aitemstack.lenghtvoidremoveCraftingFromCrafters(ICrafting par1ICrafting) Remove this crafting listener from the listener list.protected voidretrySlotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer) voidsetPlayerIsPresent(EntityPlayer par1EntityPlayer, boolean par2) adds or removes the player from the container based on par2slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) Called when a player shift-clicks on a slot.voidupdateProgressBar(int par1, int par2)
-
Field Details
-
inventoryItemStacks
the list of all items(stacks) for the corresponding slot -
inventorySlots
the list of all slots in the inventory -
windowId
public int windowId -
crafters
list of all people that need to be notified when this craftinventory changes
-
-
Constructor Details
-
Container
public Container()
-
-
Method Details
-
addSlotToContainer
the slot is assumed empty -
onCraftGuiOpened
-
removeCraftingFromCrafters
Remove this crafting listener from the listener list. -
getInventory
returns a list if itemStacks, for each slot. -
detectAndSendChanges
public void detectAndSendChanges()Looks for changes made in the container, sends them to every listener. -
enchantItem
enchants the item on the table using the specified slot; also deducts XP from player -
getSlotFromInventory
-
getSlot
-
transferStackInSlot
Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -
slotClick
-
func_94530_a
-
retrySlotClick
-
onContainerClosed
Called when the container is closed. -
onCraftMatrixChanged
Callback for when the crafting matrix is changed. -
putStackInSlot
args: slotID, itemStack to put in slot -
putStacksInSlots
places itemstacks in first x slots, x being aitemstack.lenght -
updateProgressBar
public void updateProgressBar(int par1, int par2) -
getNextTransactionID
Gets a unique transaction ID. Parameter is unused. -
isPlayerNotUsingContainer
NotUsing because adding a player twice is an error -
setPlayerIsPresent
adds or removes the player from the container based on par2 -
canInteractWith
-
func_94529_b
public static int func_94529_b(int par0) -
func_94532_c
public static int func_94532_c(int par0) -
func_94534_d
public static int func_94534_d(int par0, int par1) -
func_94528_d
public static boolean func_94528_d(int par0) -
func_94533_d
protected void func_94533_d() -
func_94527_a
-
func_94525_a
-
canDragIntoSlot
Returns true if the player can "drag-spilt" items into this slot,. returns true by default. Called to check if the slot can be added to a list of Slots to split the held ItemStack across. -
calcRedstoneFromInventory
-
mergeItemStack
protected boolean mergeItemStack(ItemStack stackSource, int iSlotDestFirst, int iSlotDestCap, boolean bFavorHotbar) -
mergeItemStack
-
mergeItemStackFavoringHotbar
protected boolean mergeItemStackFavoringHotbar(ItemStack stackSource, int iSlotDestFirst, int iSlotDestCap) -
attemptToMergeWithSlot
-
attemptToMergeWithSlotIfEmpty
-