Package net.minecraft.screen.slot
Class Slot
java.lang.Object
net.minecraft.screen.slot.Slot
- Direct Known Subclasses:
ArmorSlot
,BeaconScreenHandler.PaymentSlot
,BrewingStandScreenHandler.FuelSlot
,BrewingStandScreenHandler.IngredientSlot
,BrewingStandScreenHandler.PotionSlot
,CrafterInputSlot
,CrafterOutputSlot
,CraftingResultSlot
,CreativeInventoryScreen.CreativeSlot
,CreativeInventoryScreen.LockableSlot
,FurnaceFuelSlot
,FurnaceOutputSlot
,ShulkerBoxSlot
,TradeOutputSlot
A slot of a screen handler that holds an item stack. A slot is temporary
holder that holds the stack for the lifetime of the screen handler. They are backed
by an inventory, which implements the persistent storage if necessary.
To add slots, call ScreenHandler.addSlot(net.minecraft.screen.slot.Slot)
inside
the screen handler's constructor.
- Mappings:
Namespace Name named net/minecraft/screen/slot/Slot
intermediary net/minecraft/class_1735
official cuy
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
canTakeItems
(PlayerEntity playerEntity) boolean
canTakePartial
(PlayerEntity player) boolean
Returnstrue
to disable dynamic display for clocks and compasses.@Nullable com.mojang.datafixers.util.Pair
<Identifier, Identifier> int
getIndex()
int
int
getMaxItemCount
(ItemStack stack) getStack()
boolean
hasStack()
insertStack
(ItemStack stack) insertStack
(ItemStack stack, int count) boolean
void
protected void
protected void
void
onQuickTransfer
(ItemStack newItem, ItemStack original) protected void
onTake
(int amount) void
onTakeItem
(PlayerEntity player, ItemStack stack) void
void
Sets the slot's stack tostack
and marks the slot as dirty.void
setStackNoCallbacks
(ItemStack stack) takeStack
(int amount) takeStackRange
(int min, int max, PlayerEntity player) tryTakeStackRange
(int min, int max, PlayerEntity player)
-
Field Details
-
index
private final int index- Mappings:
Namespace Name Mixin selector named index
Lnet/minecraft/screen/slot/Slot;index:I
intermediary field_7875
Lnet/minecraft/class_1735;field_7875:I
official a
Lcuy;a:I
-
inventory
- Mappings:
Namespace Name Mixin selector named inventory
Lnet/minecraft/screen/slot/Slot;inventory:Lnet/minecraft/inventory/Inventory;
intermediary field_7871
Lnet/minecraft/class_1735;field_7871:Lnet/minecraft/class_1263;
official c
Lcuy;c:Lbtb;
-
id
public int id- Mappings:
Namespace Name Mixin selector named id
Lnet/minecraft/screen/slot/Slot;id:I
intermediary field_7874
Lnet/minecraft/class_1735;field_7874:I
official d
Lcuy;d:I
-
x
public final int x- Mappings:
Namespace Name Mixin selector named x
Lnet/minecraft/screen/slot/Slot;x:I
intermediary field_7873
Lnet/minecraft/class_1735;field_7873:I
official e
Lcuy;e:I
-
y
public final int y- Mappings:
Namespace Name Mixin selector named y
Lnet/minecraft/screen/slot/Slot;y:I
intermediary field_7872
Lnet/minecraft/class_1735;field_7872:I
official f
Lcuy;f:I
-
-
Constructor Details
-
Slot
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/screen/slot/Slot;<init>(Lnet/minecraft/inventory/Inventory;III)V
intermediary <init>
Lnet/minecraft/class_1735;<init>(Lnet/minecraft/class_1263;III)V
official <init>
Lcuy;<init>(Lbtb;III)V
-
-
Method Details
-
onQuickTransfer
- Mappings:
Namespace Name Mixin selector named onQuickTransfer
Lnet/minecraft/screen/slot/Slot;onQuickTransfer(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)V
intermediary method_7670
Lnet/minecraft/class_1735;method_7670(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)V
official b
Lcuy;b(Lcxo;Lcxo;)V
-
onCrafted
- Mappings:
Namespace Name Mixin selector named onCrafted
Lnet/minecraft/screen/slot/Slot;onCrafted(Lnet/minecraft/item/ItemStack;I)V
intermediary method_7678
Lnet/minecraft/class_1735;method_7678(Lnet/minecraft/class_1799;I)V
official a
Lcuy;a(Lcxo;I)V
-
onTake
protected void onTake(int amount) - Mappings:
Namespace Name Mixin selector named onTake
Lnet/minecraft/screen/slot/Slot;onTake(I)V
intermediary method_7672
Lnet/minecraft/class_1735;method_7672(I)V
official b
Lcuy;b(I)V
-
onCrafted
- Mappings:
Namespace Name Mixin selector named onCrafted
Lnet/minecraft/screen/slot/Slot;onCrafted(Lnet/minecraft/item/ItemStack;)V
intermediary method_7669
Lnet/minecraft/class_1735;method_7669(Lnet/minecraft/class_1799;)V
official b_
Lcuy;b_(Lcxo;)V
-
onTakeItem
- Mappings:
Namespace Name Mixin selector named onTakeItem
Lnet/minecraft/screen/slot/Slot;onTakeItem(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)V
intermediary method_7667
Lnet/minecraft/class_1735;method_7667(Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)V
official a
Lcuy;a(Lcpw;Lcxo;)V
-
canInsert
- Mappings:
Namespace Name Mixin selector named canInsert
Lnet/minecraft/screen/slot/Slot;canInsert(Lnet/minecraft/item/ItemStack;)Z
intermediary method_7680
Lnet/minecraft/class_1735;method_7680(Lnet/minecraft/class_1799;)Z
official a
Lcuy;a(Lcxo;)Z
-
getStack
- Mappings:
Namespace Name Mixin selector named getStack
Lnet/minecraft/screen/slot/Slot;getStack()Lnet/minecraft/item/ItemStack;
intermediary method_7677
Lnet/minecraft/class_1735;method_7677()Lnet/minecraft/class_1799;
official g
Lcuy;g()Lcxo;
-
hasStack
public boolean hasStack()- Mappings:
Namespace Name Mixin selector named hasStack
Lnet/minecraft/screen/slot/Slot;hasStack()Z
intermediary method_7681
Lnet/minecraft/class_1735;method_7681()Z
official h
Lcuy;h()Z
-
setStack
- Mappings:
Namespace Name Mixin selector named setStack
Lnet/minecraft/screen/slot/Slot;setStack(Lnet/minecraft/item/ItemStack;)V
intermediary method_53512
Lnet/minecraft/class_1735;method_53512(Lnet/minecraft/class_1799;)V
official e
Lcuy;e(Lcxo;)V
-
setStack
Sets the slot's stack tostack
and marks the slot as dirty. Subclasses may override this method to perform additional operations.- Mappings:
Namespace Name Mixin selector named setStack
Lnet/minecraft/screen/slot/Slot;setStack(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)V
intermediary method_48931
Lnet/minecraft/class_1735;method_48931(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)V
official a
Lcuy;a(Lcxo;Lcxo;)V
-
setStackNoCallbacks
- Mappings:
Namespace Name Mixin selector named setStackNoCallbacks
Lnet/minecraft/screen/slot/Slot;setStackNoCallbacks(Lnet/minecraft/item/ItemStack;)V
intermediary method_7673
Lnet/minecraft/class_1735;method_7673(Lnet/minecraft/class_1799;)V
official f
Lcuy;f(Lcxo;)V
-
markDirty
public void markDirty()- Mappings:
Namespace Name Mixin selector named markDirty
Lnet/minecraft/screen/slot/Slot;markDirty()V
intermediary method_7668
Lnet/minecraft/class_1735;method_7668()V
official c
Lcuy;c()V
-
getMaxItemCount
public int getMaxItemCount()- Mappings:
Namespace Name Mixin selector named getMaxItemCount
Lnet/minecraft/screen/slot/Slot;getMaxItemCount()I
intermediary method_7675
Lnet/minecraft/class_1735;method_7675()I
official a
Lcuy;a()I
-
getMaxItemCount
- Mappings:
Namespace Name Mixin selector named getMaxItemCount
Lnet/minecraft/screen/slot/Slot;getMaxItemCount(Lnet/minecraft/item/ItemStack;)I
intermediary method_7676
Lnet/minecraft/class_1735;method_7676(Lnet/minecraft/class_1799;)I
official a_
Lcuy;a_(Lcxo;)I
-
getBackgroundSprite
@Nullable public @Nullable com.mojang.datafixers.util.Pair<Identifier,Identifier> getBackgroundSprite()- Mappings:
Namespace Name Mixin selector named getBackgroundSprite
Lnet/minecraft/screen/slot/Slot;getBackgroundSprite()Lcom/mojang/datafixers/util/Pair;
intermediary method_7679
Lnet/minecraft/class_1735;method_7679()Lcom/mojang/datafixers/util/Pair;
official b
Lcuy;b()Lcom/mojang/datafixers/util/Pair;
-
takeStack
- Mappings:
Namespace Name Mixin selector named takeStack
Lnet/minecraft/screen/slot/Slot;takeStack(I)Lnet/minecraft/item/ItemStack;
intermediary method_7671
Lnet/minecraft/class_1735;method_7671(I)Lnet/minecraft/class_1799;
official a
Lcuy;a(I)Lcxo;
-
canTakeItems
- Mappings:
Namespace Name Mixin selector named canTakeItems
Lnet/minecraft/screen/slot/Slot;canTakeItems(Lnet/minecraft/entity/player/PlayerEntity;)Z
intermediary method_7674
Lnet/minecraft/class_1735;method_7674(Lnet/minecraft/class_1657;)Z
official a
Lcuy;a(Lcpw;)Z
-
isEnabled
public boolean isEnabled()- Mappings:
Namespace Name Mixin selector named isEnabled
Lnet/minecraft/screen/slot/Slot;isEnabled()Z
intermediary method_7682
Lnet/minecraft/class_1735;method_7682()Z
official d
Lcuy;d()Z
-
tryTakeStackRange
- Mappings:
Namespace Name Mixin selector named tryTakeStackRange
Lnet/minecraft/screen/slot/Slot;tryTakeStackRange(IILnet/minecraft/entity/player/PlayerEntity;)Ljava/util/Optional;
intermediary method_34264
Lnet/minecraft/class_1735;method_34264(IILnet/minecraft/class_1657;)Ljava/util/Optional;
official a
Lcuy;a(IILcpw;)Ljava/util/Optional;
-
takeStackRange
- Mappings:
Namespace Name Mixin selector named takeStackRange
Lnet/minecraft/screen/slot/Slot;takeStackRange(IILnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;
intermediary method_32753
Lnet/minecraft/class_1735;method_32753(IILnet/minecraft/class_1657;)Lnet/minecraft/class_1799;
official b
Lcuy;b(IILcpw;)Lcxo;
-
insertStack
- Mappings:
Namespace Name Mixin selector named insertStack
Lnet/minecraft/screen/slot/Slot;insertStack(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;
intermediary method_32756
Lnet/minecraft/class_1735;method_32756(Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;
official d
Lcuy;d(Lcxo;)Lcxo;
-
insertStack
- Mappings:
Namespace Name Mixin selector named insertStack
Lnet/minecraft/screen/slot/Slot;insertStack(Lnet/minecraft/item/ItemStack;I)Lnet/minecraft/item/ItemStack;
intermediary method_32755
Lnet/minecraft/class_1735;method_32755(Lnet/minecraft/class_1799;I)Lnet/minecraft/class_1799;
official b
Lcuy;b(Lcxo;I)Lcxo;
-
canTakePartial
- Mappings:
Namespace Name Mixin selector named canTakePartial
Lnet/minecraft/screen/slot/Slot;canTakePartial(Lnet/minecraft/entity/player/PlayerEntity;)Z
intermediary method_32754
Lnet/minecraft/class_1735;method_32754(Lnet/minecraft/class_1657;)Z
official b
Lcuy;b(Lcpw;)Z
-
getIndex
public int getIndex()- Mappings:
Namespace Name Mixin selector named getIndex
Lnet/minecraft/screen/slot/Slot;getIndex()I
intermediary method_34266
Lnet/minecraft/class_1735;method_34266()I
official i
Lcuy;i()I
-
canBeHighlighted
public boolean canBeHighlighted()- Mappings:
Namespace Name Mixin selector named canBeHighlighted
Lnet/minecraft/screen/slot/Slot;canBeHighlighted()Z
intermediary method_51306
Lnet/minecraft/class_1735;method_51306()Z
official e
Lcuy;e()Z
-
disablesDynamicDisplay
public boolean disablesDynamicDisplay()Returnstrue
to disable dynamic display for clocks and compasses.- Returns:
true
to disable dynamic display for clocks and compasses- Mappings:
Namespace Name Mixin selector named disablesDynamicDisplay
Lnet/minecraft/screen/slot/Slot;disablesDynamicDisplay()Z
intermediary method_55059
Lnet/minecraft/class_1735;method_55059()Z
official f
Lcuy;f()Z
-