public class MalisisInventoryContainer
extends net.minecraft.inventory.Container
Container.| Modifier and Type | Class and Description |
|---|---|
static class |
MalisisInventoryContainer.ActionType |
| Modifier and Type | Field and Description |
|---|---|
static int |
DRAG_TYPE_ONE
Dragging the itemStack to leave only one item per crossed slot.
|
static int |
DRAG_TYPE_PICKUP
Dragging the itemStack to pick up itemStacks held by crossed slots.
|
static int |
DRAG_TYPE_SPREAD
Dragging the itemStack to be spread evenly among all crossed slots.
|
protected int |
draggedAmount
Stack size when dragging started.
|
protected java.util.Set<MalisisSlot> |
draggedSlots
The dragged slots.
|
protected int |
dragType
Type drag action.
|
protected java.util.HashMap<java.lang.Integer,MalisisInventory> |
inventories
List of inventories handled by this container.
|
protected net.minecraft.item.ItemStack |
lastShiftClicked
Stores the last itemStack that was shift clicked.
|
protected net.minecraft.entity.player.EntityPlayer |
owner
Player that opened this
MalisisInventoryContainer. |
protected net.minecraft.item.ItemStack |
pickedItemStack
ItemStack currently picked and following the cursor.
|
protected net.minecraft.item.ItemStack |
pickedItemStackCache
Cache for the itemStack currently picked.
|
| Constructor and Description |
|---|
MalisisInventoryContainer(net.minecraft.entity.player.EntityPlayer player,
int windowId)
Instantiates a new
MalisisInventoryContainer. |
| Modifier and Type | Method and Description |
|---|---|
int |
addInventory(MalisisInventory inventory)
Adds the
MalisisInventory to this MalisisInventoryContainer. |
boolean |
canInteractWith(net.minecraft.entity.player.EntityPlayer var1)
Can interact with.
|
void |
close()
Closes this
MalisisInventoryContainer, sends a message to force close the client GUI. |
void |
detectAndSendChanges()
Sends all changes for base inventory, player's inventory, picked up itemStack and dragged itemStacks.
|
void |
detectAndSendInventoryChanges(MalisisInventory inventory)
Sends all changes for the
MalisisInventory. |
void |
detectAndSendPickedItemStack()
Sends the currently picked itemStack if changed.
|
int |
getDragType()
Gets the dragging type.
|
MalisisInventory |
getInventory(int id)
Gets the
MalisisInventory of this MalisisInventoryContainer with the specified id. |
net.minecraft.item.ItemStack |
getPickedItemStack()
Gets the picked item stack.
|
MalisisInventory |
getPlayerInventory()
Gets player's inventory of this
MalisisInventoryContainer. |
net.minecraft.item.ItemStack |
handleAction(MalisisInventoryContainer.ActionType action,
int inventoryId,
int slotNumber,
int code)
Handles the action for this
MalisisInventoryContainer. |
boolean |
isDraggingItemStack()
Checks if currently dragging an itemStack.
|
void |
onContainerClosed(net.minecraft.entity.player.EntityPlayer owner)
Called when this
MalisisInventoryContainer is closed. |
void |
removeInventory(MalisisInventory inventory)
Removes the
MalisisInventory from this MalisisInventoryContainer. |
protected void |
resetDrag()
Resets the dragging state.
|
void |
sendInventoryContent()
Sends the all the inventory slots to the client.
|
void |
setPickedItemStack(net.minecraft.item.ItemStack itemStack)
Sets the currently picked itemStack.
|
boolean |
shouldEndDrag(int button)
Checks if the dragging should end based on the mouse button clicked.
|
boolean |
shouldResetDrag(int button)
Checks if the dragging should be reset based on the mouse button clicked.
|
addListener, addSlotToContainer, calcRedstone, calcRedstoneFromInventory, canAddItemToSlot, canDragIntoSlot, canMergeSlot, computeStackSize, enchantItem, extractDragMode, getCanCraft, getDragEvent, getInventory, getNextTransactionID, getQuickcraftMask, getSlot, getSlotFromInventory, isValidDragMode, mergeItemStack, onCraftMatrixChanged, putStackInSlot, putStacksInSlots, removeListener, retrySlotClick, setCanCraft, slotClick, transferStackInSlot, updateProgressBarpublic static final int DRAG_TYPE_SPREAD
public static final int DRAG_TYPE_ONE
public static final int DRAG_TYPE_PICKUP
protected net.minecraft.entity.player.EntityPlayer owner
MalisisInventoryContainer.protected java.util.HashMap<java.lang.Integer,MalisisInventory> inventories
protected net.minecraft.item.ItemStack pickedItemStack
protected net.minecraft.item.ItemStack pickedItemStackCache
protected int draggedAmount
protected java.util.Set<MalisisSlot> draggedSlots
protected int dragType
protected net.minecraft.item.ItemStack lastShiftClicked
public MalisisInventoryContainer(net.minecraft.entity.player.EntityPlayer player,
int windowId)
MalisisInventoryContainer.player - the playerwindowId - the window idpublic int addInventory(MalisisInventory inventory)
inventory - the inventorypublic void removeInventory(MalisisInventory inventory)
MalisisInventory from this MalisisInventoryContainer.inventory - the inventorypublic MalisisInventory getInventory(int id)
MalisisInventory of this MalisisInventoryContainer with the specified id.id - the idpublic MalisisInventory getPlayerInventory()
MalisisInventoryContainer.public void setPickedItemStack(net.minecraft.item.ItemStack itemStack)
itemStack - the new picked item stackpublic net.minecraft.item.ItemStack getPickedItemStack()
public boolean isDraggingItemStack()
public boolean shouldEndDrag(int button)
button - the buttonpublic boolean shouldResetDrag(int button)
button - the buttonpublic int getDragType()
public void sendInventoryContent()
public void detectAndSendChanges()
detectAndSendChanges in class net.minecraft.inventory.Containerpublic void detectAndSendInventoryChanges(MalisisInventory inventory)
MalisisInventory.inventory - the inventorypublic void detectAndSendPickedItemStack()
public void close()
MalisisInventoryContainer, sends a message to force close the client GUI.public void onContainerClosed(net.minecraft.entity.player.EntityPlayer owner)
MalisisInventoryContainer is closed.onContainerClosed in class net.minecraft.inventory.Containerowner - the ownerpublic net.minecraft.item.ItemStack handleAction(MalisisInventoryContainer.ActionType action, int inventoryId, int slotNumber, int code)
MalisisInventoryContainer. See MalisisInventoryContainer.ActionType for possible actions.action - the actioninventoryId - the inventory idslotNumber - the slot numbercode - the codeprotected void resetDrag()
resetDrag in class net.minecraft.inventory.Containerpublic boolean canInteractWith(net.minecraft.entity.player.EntityPlayer var1)
canInteractWith in class net.minecraft.inventory.Containervar1 - the var1