public class Slot
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ResourceLocation |
backgroundLocation |
protected java.lang.Object |
backgroundMap |
protected java.lang.String |
backgroundName |
IInventory |
inventory |
int |
slotNumber |
int |
xDisplayPosition |
int |
yDisplayPosition |
Constructor and Description |
---|
Slot(IInventory inventoryIn,
int index,
int xPosition,
int yPosition) |
Modifier and Type | Method and Description |
---|---|
boolean |
canBeHovered() |
boolean |
canTakeStack(EntityPlayer playerIn) |
ItemStack |
decrStackSize(int amount) |
ResourceLocation |
getBackgroundLocation()
Gets the path of the texture file to use for the background image of this slot when drawing the GUI.
|
protected TextureMap |
getBackgroundMap() |
TextureAtlasSprite |
getBackgroundSprite() |
boolean |
getHasStack() |
int |
getItemStackLimit(ItemStack stack) |
int |
getSlotIndex()
Retrieves the index in the inventory for this slot, this value should typically not
be used, but can be useful for some occasions.
|
int |
getSlotStackLimit() |
java.lang.String |
getSlotTexture() |
ItemStack |
getStack() |
boolean |
isHere(IInventory inv,
int slotIn) |
boolean |
isItemValid(ItemStack stack) |
protected void |
onCrafting(ItemStack stack) |
protected void |
onCrafting(ItemStack stack,
int amount) |
void |
onPickupFromSlot(EntityPlayer playerIn,
ItemStack stack) |
void |
onSlotChange(ItemStack p_75220_1_,
ItemStack p_75220_2_) |
void |
onSlotChanged() |
void |
putStack(ItemStack stack) |
void |
setBackgroundLocation(ResourceLocation texture)
Sets the texture file to use for the background image of the slot when it's empty.
|
void |
setBackgroundName(java.lang.String name)
Sets which icon index to use as the background image of the slot when it's empty.
|
public final IInventory inventory
public int slotNumber
public int xDisplayPosition
public int yDisplayPosition
protected java.lang.String backgroundName
protected ResourceLocation backgroundLocation
protected java.lang.Object backgroundMap
public Slot(IInventory inventoryIn, int index, int xPosition, int yPosition)
protected void onCrafting(ItemStack stack, int amount)
protected void onCrafting(ItemStack stack)
public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack)
public boolean isItemValid(@Nullable ItemStack stack)
@Nullable public ItemStack getStack()
public boolean getHasStack()
public void putStack(@Nullable ItemStack stack)
public void onSlotChanged()
public int getSlotStackLimit()
public int getItemStackLimit(ItemStack stack)
@Nullable public java.lang.String getSlotTexture()
public ItemStack decrStackSize(int amount)
public boolean isHere(IInventory inv, int slotIn)
public boolean canTakeStack(EntityPlayer playerIn)
public boolean canBeHovered()
public ResourceLocation getBackgroundLocation()
public void setBackgroundLocation(ResourceLocation texture)
texture
- the resourcelocation for the texturepublic void setBackgroundName(java.lang.String name)
name
- The icon to use, null for nonepublic TextureAtlasSprite getBackgroundSprite()
protected TextureMap getBackgroundMap()
public int getSlotIndex()