public class MalisisSlot
extends java.lang.Object
MalisisInventory| Modifier and Type | Field and Description |
|---|---|
protected net.minecraft.item.ItemStack |
draggedItemStack
ItemStack currently dragged into the slot.
|
protected int |
index
Slot position within its
MalisisInventory. |
protected MalisisInventory |
inventory
Inventory containing this
MalisisSlot. |
protected net.minecraft.item.ItemStack |
itemStack
ItemStack held by this
MalisisSlot. |
protected InventoryState |
state
InventoryState of this slot. |
| Constructor and Description |
|---|
MalisisSlot()
Instantiates a new
MalisisSlot. |
MalisisSlot(net.minecraft.item.ItemStack itemStack)
Instantiates a new
MalisisSlot. |
| Modifier and Type | Method and Description |
|---|---|
int |
addItemStackSize(int stackSize)
Adds the item stack size.
|
net.minecraft.item.ItemStack |
extract()
Extracts the full stack from this
MalisisSlot. |
net.minecraft.item.ItemStack |
extract(int amount)
Extract a specified amount from this
MalisisSlot. |
boolean |
extractInto(net.minecraft.item.ItemStack itemStack)
Extracts the maximum possible from this slots
ItemStack into itemStack. |
net.minecraft.item.ItemStack |
getDraggedItemStack()
Gets the dragged item stack.
|
MalisisInventory |
getInventory()
Gets the
MalisisInventory of this MalisisSlot. |
int |
getInventoryId()
|
net.minecraft.item.ItemStack |
getItemStack()
Gets the item stack.
|
int |
getSlotIndex()
Gets the slot index in the inventory.
|
int |
getSlotStackLimit()
Gets the maximum stackSize available for this slot.
|
net.minecraft.item.ItemStack |
insert(net.minecraft.item.ItemStack insert)
Inserts an
ItemStack into this MalisisSlot. |
net.minecraft.item.ItemStack |
insert(net.minecraft.item.ItemStack insert,
int amount)
Inserts a specified amount of
ItemStack into this MalisisSlot. |
net.minecraft.item.ItemStack |
insert(net.minecraft.item.ItemStack insert,
int amount,
boolean force)
Inserts a specified amount of
ItemStack into this MalisisSlot. |
boolean |
isEmpty()
Checks if this
MalisisSlot is empty. |
boolean |
isFull()
Checks if this
MalisisSlot can accept more itemStack. |
boolean |
isItemValid(net.minecraft.item.ItemStack itemStack)
Checks if this
MalisisSlot can contain itemStack. |
boolean |
isNotEmpty()
Checks if this
MalisisSlot is not empty. |
boolean |
isNotFull()
Checks if this
MalisisSlot can accept more itemStack. |
boolean |
isOutputSlot()
Checks whether this
MalisisSlot is an output slot (if state denies inserts) |
boolean |
isState(int state)
Checks whether this
MalisisSlot is allowed for the state. |
void |
onPickupFromSlot(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.item.ItemStack itemStack)
Called when itemStack is picked up from this
MalisisSlot. |
void |
onSlotChanged()
Called when itemStack is set.
|
void |
register(java.lang.Object object)
Registers an object to inventory changes.
|
void |
setDraggedItemStack(net.minecraft.item.ItemStack itemStack)
Sets the currently dragged ItemStack for this
MalisisSlot. |
void |
setItemStack(net.minecraft.item.ItemStack itemStack)
Sets the itemStack contained by this
MalisisSlot. |
int |
setItemStackSize(int stackSize)
Sets the item stack size.
|
void |
setOutputSlot()
Sets this
MalisisSlot as an output slot. |
protected void |
setup(MalisisInventory inventory,
int slotIndex)
Setup
MalisisSlot with MalisisInventory containing it and slot index. |
java.lang.String |
toString() |
protected MalisisInventory inventory
MalisisSlot.protected net.minecraft.item.ItemStack itemStack
MalisisSlot.protected net.minecraft.item.ItemStack draggedItemStack
protected int index
MalisisInventory.protected InventoryState state
InventoryState of this slot.public MalisisSlot(net.minecraft.item.ItemStack itemStack)
MalisisSlot.itemStack - the item stackpublic MalisisSlot()
MalisisSlot.protected void setup(MalisisInventory inventory, int slotIndex)
MalisisSlot with MalisisInventory containing it and slot index.inventory - the inventoryslotIndex - the slot indexpublic void register(java.lang.Object object)
object - the objectpublic MalisisInventory getInventory()
MalisisInventory of this MalisisSlot.public int getSlotIndex()
public int getInventoryId()
public void setItemStack(net.minecraft.item.ItemStack itemStack)
MalisisSlot. Does not check for slot validity, max stack size etc...itemStack - the new item stackpublic net.minecraft.item.ItemStack getItemStack()
MalisisSlot.public void setDraggedItemStack(net.minecraft.item.ItemStack itemStack)
MalisisSlot.itemStack - the new dragged item stackpublic net.minecraft.item.ItemStack getDraggedItemStack()
MalisisSlotpublic void setOutputSlot()
MalisisSlot as an output slot. Sets the slot state to deny inserts.public boolean isOutputSlot()
MalisisSlot is an output slot (if state denies inserts)public boolean isState(int state)
MalisisSlot is allowed for the state.state - the stateMalisisInventory and this MalisisSlot allow the state, false otherwise.public boolean isItemValid(net.minecraft.item.ItemStack itemStack)
MalisisSlot can contain itemStack. Defers the test to this inventory.itemStack - the item stackMalisisSlotpublic boolean isFull()
MalisisSlot can accept more itemStack.public boolean isNotFull()
MalisisSlot can accept more itemStack.public boolean isEmpty()
MalisisSlot is empty.public boolean isNotEmpty()
MalisisSlot is not empty.public void onSlotChanged()
public void onPickupFromSlot(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.item.ItemStack itemStack)
MalisisSlot.player - the playeritemStack - the item stackpublic int setItemStackSize(int stackSize)
stackSize - the stack sizepublic int addItemStackSize(int stackSize)
stackSize - the stack sizepublic net.minecraft.item.ItemStack extract()
MalisisSlot.public net.minecraft.item.ItemStack extract(int amount)
MalisisSlot.amount - the amountItemStack extractedpublic boolean extractInto(net.minecraft.item.ItemStack itemStack)
ItemStack into itemStack.itemStack - the itemStack the slot is extracted intopublic net.minecraft.item.ItemStack insert(net.minecraft.item.ItemStack insert)
ItemStack into this MalisisSlot.insert - the itemStack to insertpublic net.minecraft.item.ItemStack insert(net.minecraft.item.ItemStack insert,
int amount)
ItemStack into this MalisisSlot.insert - the itemStack to insertamount - the amount to insertpublic net.minecraft.item.ItemStack insert(net.minecraft.item.ItemStack insert,
int amount,
boolean force)
ItemStack into this MalisisSlot.true, the current ItemStack in the slot will be replaced if it cannot be merged.insert - the itemStack to insertamount - the amount to insertforce - whether the itemStack should be forced in the slotpublic int getSlotStackLimit()
inventory.public java.lang.String toString()
toString in class java.lang.Object