static class CreativeScreen.CreativeSlot extends Slot
Modifier and Type | Field and Description |
---|---|
private Slot |
slot |
inventory, slotNumber, xPos, yPos
Constructor and Description |
---|
CreativeSlot(Slot p_i229959_1_,
int p_i229959_2_,
int p_i229959_3_,
int p_i229959_4_) |
Modifier and Type | Method and Description |
---|---|
boolean |
canTakeStack(PlayerEntity playerIn) |
ItemStack |
decrStackSize(int amount) |
com.mojang.datafixers.util.Pair<ResourceLocation,ResourceLocation> |
func_225517_c_() |
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() |
ItemStack |
getStack() |
boolean |
isEnabled() |
boolean |
isItemValid(ItemStack stack) |
boolean |
isSameInventory(Slot other)
Checks if the other slot is in the same inventory, by comparing the inventory reference.
|
void |
onSlotChanged() |
ItemStack |
onTake(PlayerEntity thePlayer,
ItemStack stack) |
void |
putStack(ItemStack stack) |
Slot |
setBackground(ResourceLocation atlas,
ResourceLocation sprite)
Sets the background atlas and sprite location.
|
onCrafting, onCrafting, onSlotChange, onSwapCraft
private final Slot slot
public CreativeSlot(Slot p_i229959_1_, int p_i229959_2_, int p_i229959_3_, int p_i229959_4_)
public ItemStack onTake(PlayerEntity thePlayer, ItemStack stack)
public boolean isItemValid(ItemStack stack)
isItemValid
in class Slot
public boolean getHasStack()
getHasStack
in class Slot
public void onSlotChanged()
onSlotChanged
in class Slot
public int getSlotStackLimit()
getSlotStackLimit
in class Slot
public int getItemStackLimit(ItemStack stack)
getItemStackLimit
in class Slot
@Nullable public com.mojang.datafixers.util.Pair<ResourceLocation,ResourceLocation> func_225517_c_()
func_225517_c_
in class Slot
public ItemStack decrStackSize(int amount)
decrStackSize
in class Slot
public boolean canTakeStack(PlayerEntity playerIn)
canTakeStack
in class Slot
public int getSlotIndex()
Slot
getSlotIndex
in class Slot
public boolean isSameInventory(Slot other)
Slot
isSameInventory
in class Slot
public Slot setBackground(ResourceLocation atlas, ResourceLocation sprite)
Slot
setBackground
in class Slot
atlas
- The atlas namesprite
- The sprite located on that atlas.