public class SlotSpaceImpl extends java.lang.Object implements InventorySlot
| 构造器和说明 |
|---|
SlotSpaceImpl(Inventory parent,
int index) |
| 限定符和类型 | 方法和说明 |
|---|---|
net.minecraft.item.ItemStack |
extractItem(int amount,
boolean simulate)
Extracts an ItemStack from the given slot.
|
InventoryRule |
getRule() |
net.minecraft.item.ItemStack |
getStackInSlot()
Returns the ItemStack in a given slot.
|
int |
id() |
net.minecraft.item.ItemStack |
insertItem(net.minecraft.item.ItemStack stack,
boolean simulate)
Inserts an ItemStack into the given slot and return the remainder.
|
java.util.Iterator<net.minecraft.item.ItemStack> |
iterator() |
com.google.common.base.Optional<java.lang.String> |
name() |
Inventory |
parent() |
void |
setRule(InventoryRule rule) |
public SlotSpaceImpl(Inventory parent, int index)
public InventoryRule getRule()
getRule 在接口中 InventoryElementpublic Inventory parent()
parent 在接口中 InventoryElementpublic com.google.common.base.Optional<java.lang.String> name()
name 在接口中 InventoryElementpublic int id()
id 在接口中 InventoryElementpublic void setRule(InventoryRule rule)
public net.minecraft.item.ItemStack getStackInSlot()
InventorySlotThe 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
getStackInSlot 在接口中 InventorySlotpublic net.minecraft.item.ItemStack insertItem(net.minecraft.item.ItemStack stack,
boolean simulate)
InventorySlotinsertItem 在接口中 InventorySlotstack - ItemStack to insertsimulate - If true, the insertion is only simulatedpublic net.minecraft.item.ItemStack extractItem(int amount,
boolean simulate)
InventorySlotextractItem 在接口中 InventorySlotamount - Amount to extract (may be greater than the current stacks max limit)simulate - If true, the extraction is only simulatedpublic java.util.Iterator<net.minecraft.item.ItemStack> iterator()
iterator 在接口中 java.lang.Iterable<net.minecraft.item.ItemStack>