public class Slot extends Object
Modifier and Type | Field and Description |
---|---|
int |
id |
private int |
index |
Inventory |
inventory |
int |
x |
int |
y |
Constructor and Description |
---|
Slot(Inventory inventory,
int index,
int x,
int y) |
Modifier and Type | Method and Description |
---|---|
boolean |
canInsert(ItemStack stack) |
boolean |
canTakeItems(PlayerEntity playerEntity) |
boolean |
doDrawHoveringEffect() |
com.mojang.datafixers.util.Pair<Identifier,Identifier> |
getBackgroundSprite() |
int |
getMaxItemCount() |
int |
getMaxItemCount(ItemStack stack) |
ItemStack |
getStack() |
boolean |
hasStack() |
void |
markDirty() |
protected void |
onCrafted(ItemStack stack) |
protected void |
onCrafted(ItemStack stack,
int amount) |
void |
onStackChanged(ItemStack originalItem,
ItemStack itemStack) |
protected void |
onTake(int amount) |
ItemStack |
onTakeItem(PlayerEntity player,
ItemStack stack) |
void |
setStack(ItemStack stack) |
ItemStack |
takeStack(int amount) |
private final int index
public final Inventory inventory
public int id
public final int x
public final int y
public Slot(Inventory inventory, int index, int x, int y)
protected void onCrafted(ItemStack stack, int amount)
protected void onTake(int amount)
protected void onCrafted(ItemStack stack)
public ItemStack onTakeItem(PlayerEntity player, ItemStack stack)
public boolean canInsert(ItemStack stack)
public ItemStack getStack()
public boolean hasStack()
public void setStack(ItemStack stack)
public void markDirty()
public int getMaxItemCount()
public int getMaxItemCount(ItemStack stack)
@Environment(value=CLIENT) @Nullable public com.mojang.datafixers.util.Pair<Identifier,Identifier> getBackgroundSprite()
public ItemStack takeStack(int amount)
public boolean canTakeItems(PlayerEntity playerEntity)
@Environment(value=CLIENT) public boolean doDrawHoveringEffect()