public interface InventorySlot extends InventoryElement
| 限定符和类型 | 方法和说明 |
|---|---|
net.minecraft.item.ItemStack |
extractItem(int amount,
boolean simulate)
Extracts an ItemStack from the given slot.
|
net.minecraft.item.ItemStack |
getStackInSlot()
Returns the ItemStack in a given slot.
|
net.minecraft.item.ItemStack |
insertItem(net.minecraft.item.ItemStack stack,
boolean simulate)
Inserts an ItemStack into the given slot and return the remainder.
|
getRule, id, name, parentnet.minecraft.item.ItemStack getStackInSlot()
The result's stack size may be greater than the itemstacks max size.
If the result is null, then the slot is empty. If the result is not null but the stack size is zero, then it represents an empty slot that will only accept* a specific itemstack.
IMPORTANT: This ItemStack MUST NOT be modified. This method is not for altering an inventories contents. Any implementers who are able to detect modification through this method should throw an exception.
SERIOUSLY: DO NOT MODIFY THE RETURNED ITEMSTACK
net.minecraft.item.ItemStack insertItem(net.minecraft.item.ItemStack stack,
boolean simulate)
stack - ItemStack to insertsimulate - If true, the insertion is only simulatednet.minecraft.item.ItemStack extractItem(int amount,
boolean simulate)
amount - Amount to extract (may be greater than the current stacks max limit)simulate - If true, the extraction is only simulated