Package net.minecraft.src
Class Slot
java.lang.Object
net.minecraft.src.Slot
- Direct Known Subclasses:
SlotCrafting,SlotFurnace,SlotHopperFilter,SlotMerchantResult
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal IInventoryThe inventory we want to extract a slot from.intthe id of the slot(also the index in the inventory arraylist)intdisplay position of the inventory slot on the screen x axisintdisplay position of the inventory slot on the screen y axis -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanTakeStack(EntityPlayer par1EntityPlayer) Return whether this slot's stack can be taken from this slot.decrStackSize(int par1) Decrease the size of the stack in slot (first int arg) by the amount of the second int arg.booleanReturns the icon index on items.png that is used as background image of the slot.booleanReturns if this slot contains a stack.intintReturns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of armor slots)getStack()Helper fnct to get the stack in the slot.booleanisHere(IInventory par1IInventory, int par2) returns true if this slot is in par2 of par1booleanisItemValid(ItemStack par1ItemStack) Check if the stack is a valid item for this slot.protected voidonCrafting(ItemStack par1ItemStack) the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.protected voidonCrafting(ItemStack par1ItemStack, int par2) the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.voidonPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) voidonSlotChange(ItemStack par1ItemStack, ItemStack par2ItemStack) if par2 has more items than par1, onCrafting(item,countIncrease) is calledvoidCalled when the stack in a Slot changesvoidHelper method to put a stack in the slot.
-
Field Details
-
inventory
The inventory we want to extract a slot from. -
slotNumber
public int slotNumberthe id of the slot(also the index in the inventory arraylist) -
xDisplayPosition
public int xDisplayPositiondisplay position of the inventory slot on the screen x axis -
yDisplayPosition
public int yDisplayPositiondisplay position of the inventory slot on the screen y axis
-
-
Constructor Details
-
Slot
-
-
Method Details
-
onSlotChange
if par2 has more items than par1, onCrafting(item,countIncrease) is called -
onCrafting
the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an internal count then calls onCrafting(item). -
onCrafting
the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. -
onPickupFromSlot
-
isItemValid
Check if the stack is a valid item for this slot. Always true beside for the armor slots. -
getStack
Helper fnct to get the stack in the slot. -
getHasStack
public boolean getHasStack()Returns if this slot contains a stack. -
putStack
Helper method to put a stack in the slot. -
onSlotChanged
public void onSlotChanged()Called when the stack in a Slot changes -
getSlotStackLimit
public int getSlotStackLimit()Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of armor slots) -
getBackgroundIconIndex
Returns the icon index on items.png that is used as background image of the slot. -
decrStackSize
Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack. -
isHere
returns true if this slot is in par2 of par1 -
canTakeStack
Return whether this slot's stack can be taken from this slot. -
func_111238_b
public boolean func_111238_b() -
getSlotIndex
public int getSlotIndex()
-