Class CreativeScreen.CreativeSlot
- java.lang.Object
-
- net.minecraft.inventory.container.Slot
-
- net.minecraft.client.gui.screen.inventory.CreativeScreen.CreativeSlot
-
- Enclosing class:
- CreativeScreen
static class CreativeScreen.CreativeSlot extends Slot
-
-
Constructor Summary
Constructors Constructor Description CreativeSlot(Slot p_i229959_1_, int p_i229959_2_, int p_i229959_3_, int p_i229959_4_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemStack
getItem()
int
getMaxStackSize()
int
getMaxStackSize(ItemStack p_178170_1_)
com.mojang.datafixers.util.Pair<ResourceLocation,ResourceLocation>
getNoItemIcon()
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.boolean
hasItem()
boolean
isActive()
boolean
isSameInventory(Slot other)
Checks if the other slot is in the same inventory, by comparing the inventory reference.boolean
mayPickup(PlayerEntity p_82869_1_)
boolean
mayPlace(ItemStack p_75214_1_)
ItemStack
onTake(PlayerEntity p_190901_1_, ItemStack p_190901_2_)
ItemStack
remove(int p_75209_1_)
void
set(ItemStack p_75215_1_)
Slot
setBackground(ResourceLocation atlas, ResourceLocation sprite)
Sets the background atlas and sprite location.void
setChanged()
-
Methods inherited from class net.minecraft.inventory.container.Slot
checkTakeAchievements, onQuickCraft, onQuickCraft, onSwapCraft
-
-
-
-
Field Detail
-
target
private final Slot target
-
-
Constructor Detail
-
CreativeSlot
public CreativeSlot(Slot p_i229959_1_, int p_i229959_2_, int p_i229959_3_, int p_i229959_4_)
-
-
Method Detail
-
onTake
public ItemStack onTake(PlayerEntity p_190901_1_, ItemStack p_190901_2_)
-
setChanged
public void setChanged()
- Overrides:
setChanged
in classSlot
-
getMaxStackSize
public int getMaxStackSize()
- Overrides:
getMaxStackSize
in classSlot
-
getMaxStackSize
public int getMaxStackSize(ItemStack p_178170_1_)
- Overrides:
getMaxStackSize
in classSlot
-
getNoItemIcon
@Nullable public com.mojang.datafixers.util.Pair<ResourceLocation,ResourceLocation> getNoItemIcon()
- Overrides:
getNoItemIcon
in classSlot
-
mayPickup
public boolean mayPickup(PlayerEntity p_82869_1_)
-
getSlotIndex
public int getSlotIndex()
Description copied from class:Slot
Retrieves the index in the inventory for this slot, this value should typically not be used, but can be useful for some occasions.- Overrides:
getSlotIndex
in classSlot
- Returns:
- Index in associated inventory for this slot.
-
isSameInventory
public boolean isSameInventory(Slot other)
Description copied from class:Slot
Checks if the other slot is in the same inventory, by comparing the inventory reference.- Overrides:
isSameInventory
in classSlot
- Returns:
- true if the other slot is in the same inventory
-
setBackground
public Slot setBackground(ResourceLocation atlas, ResourceLocation sprite)
Description copied from class:Slot
Sets the background atlas and sprite location.- Overrides:
setBackground
in classSlot
- Parameters:
atlas
- The atlas namesprite
- The sprite located on that atlas.- Returns:
- this, to allow chaining.
-
-