Class SlotReference.Player
java.lang.Object
net.ixdarklord.coolcatcore.api.utils.SlotReference<net.minecraft.world.entity.player.Player>
net.ixdarklord.coolcatcore.api.utils.SlotReference.Player
- Enclosing class:
SlotReference<T>
public static class SlotReference.Player
extends SlotReference<net.minecraft.world.entity.player.Player>
A
SlotReference implementation for player inventories.-
Nested Class Summary
Nested classes/interfaces inherited from class SlotReference
SlotReference.Container, SlotReference.Player -
Field Summary
Fields inherited from class SlotReference
EMPTY, index, owner -
Constructor Summary
ConstructorsConstructorDescriptionPlayer(net.minecraft.world.entity.player.Player player, int index) Creates a new player inventory slot reference. -
Method Summary
Methods inherited from class SlotReference
clear, getIndex, getOwner
-
Constructor Details
-
Player
public Player(@NotNull net.minecraft.world.entity.player.Player player, int index) Creates a new player inventory slot reference.- Parameters:
player- the player owning the inventoryindex- the slot index within the player's inventory
-
-
Method Details
-
get
@NotNull public @NotNull net.minecraft.world.item.ItemStack get()Description copied from class:SlotReferenceRetrieves theItemStackcurrently stored in this slot.- Specified by:
getin classSlotReference<net.minecraft.world.entity.player.Player>- Returns:
- the stored item, or
ItemStack.EMPTYif the slot is empty
-
set
public boolean set(net.minecraft.world.item.ItemStack stack) Description copied from class:SlotReferenceReplaces the item in this slot.- Specified by:
setin classSlotReference<net.minecraft.world.entity.player.Player>- Parameters:
stack- the newItemStackto place- Returns:
trueif the item was successfully set,falseif unchanged
-