Class CreativeModeInventoryScreen.SlotWrapper
java.lang.Object
net.minecraft.world.inventory.Slot
net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen.SlotWrapper
- Enclosing class:
CreativeModeInventoryScreen
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetItem()
int
int
getMaxStackSize
(ItemStack pStack) com.mojang.datafixers.util.Pair
<ResourceLocation, ResourceLocation> int
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
Return whether this slot's stack can be taken from this slot.boolean
Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.void
remove
(int pAmount) Decrease the size of the stack in slot (first int arg) by the amount of the second int arg.void
Helper method to put a stack in the slot.setBackground
(ResourceLocation atlas, ResourceLocation sprite) Sets the background atlas and sprite location.void
setByPlayer
(ItemStack pNewStack, ItemStack pOldStack) void
Methods inherited from class net.minecraft.world.inventory.Slot
allowModification, checkTakeAchievements, getContainerSlot, isFake, isHighlightable, onQuickCraft, onQuickCraft, onSwapCraft, safeInsert, safeInsert, safeTake, setByPlayer, tryRemove
-
Field Details
-
target
-
-
Constructor Details
-
SlotWrapper
-
-
Method Details
-
onTake
-
mayPlace
Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel. -
getItem
-
hasItem
public boolean hasItem() -
setByPlayer
- Overrides:
setByPlayer
in classSlot
-
set
Helper method to put a stack in the slot. -
setChanged
public void setChanged()- Overrides:
setChanged
in classSlot
-
getMaxStackSize
public int getMaxStackSize()- Overrides:
getMaxStackSize
in classSlot
-
getMaxStackSize
- Overrides:
getMaxStackSize
in classSlot
-
getNoItemIcon
- Overrides:
getNoItemIcon
in classSlot
-
remove
Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack. -
isActive
public boolean isActive() -
mayPickup
Return whether this slot's stack can be taken from this slot. -
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
Description copied from class:Slot
Checks if the other slot is in the same inventory, by comparing the inventory reference.- Overrides:
isSameInventory
in classSlot
- Parameters:
other
-- Returns:
- true if the other slot is in the same inventory
-
setBackground
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.
-