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/Slotintermediary net/minecraft/class_1735official crq
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleancanTakeItems(PlayerEntity playerEntity) booleancanTakePartial(PlayerEntity player) booleanReturnstrueto disable dynamic display for clocks and compasses.@Nullable com.mojang.datafixers.util.Pair<Identifier, Identifier> intgetIndex()intintgetMaxItemCount(ItemStack stack) getStack()booleanhasStack()insertStack(ItemStack stack) insertStack(ItemStack stack, int count) booleanvoidprotected voidprotected voidvoidonQuickTransfer(ItemStack newItem, ItemStack original) protected voidonTake(int amount) voidonTakeItem(PlayerEntity player, ItemStack stack) voidvoidSets the slot's stack tostackand marks the slot as dirty.voidsetStackNoCallbacks(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 indexLnet/minecraft/screen/slot/Slot;index:Iintermediary field_7875Lnet/minecraft/class_1735;field_7875:Iofficial aLcrq;a:I
-
inventory
- Mappings:
Namespace Name Mixin selector named inventoryLnet/minecraft/screen/slot/Slot;inventory:Lnet/minecraft/inventory/Inventory;intermediary field_7871Lnet/minecraft/class_1735;field_7871:Lnet/minecraft/class_1263;official cLcrq;c:Lbqk;
-
id
public int id- Mappings:
Namespace Name Mixin selector named idLnet/minecraft/screen/slot/Slot;id:Iintermediary field_7874Lnet/minecraft/class_1735;field_7874:Iofficial dLcrq;d:I
-
x
public final int x- Mappings:
Namespace Name Mixin selector named xLnet/minecraft/screen/slot/Slot;x:Iintermediary field_7873Lnet/minecraft/class_1735;field_7873:Iofficial eLcrq;e:I
-
y
public final int y- Mappings:
Namespace Name Mixin selector named yLnet/minecraft/screen/slot/Slot;y:Iintermediary field_7872Lnet/minecraft/class_1735;field_7872:Iofficial fLcrq;f:I
-
-
Constructor Details
-
Slot
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/screen/slot/Slot;<init>(Lnet/minecraft/inventory/Inventory;III)Vintermediary <init>Lnet/minecraft/class_1735;<init>(Lnet/minecraft/class_1263;III)Vofficial <init>Lcrq;<init>(Lbqk;III)V
-
-
Method Details
-
onQuickTransfer
- Mappings:
Namespace Name Mixin selector named onQuickTransferLnet/minecraft/screen/slot/Slot;onQuickTransfer(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Vintermediary method_7670Lnet/minecraft/class_1735;method_7670(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Vofficial bLcrq;b(Lcuq;Lcuq;)V
-
onCrafted
- Mappings:
Namespace Name Mixin selector named onCraftedLnet/minecraft/screen/slot/Slot;onCrafted(Lnet/minecraft/item/ItemStack;I)Vintermediary method_7678Lnet/minecraft/class_1735;method_7678(Lnet/minecraft/class_1799;I)Vofficial aLcrq;a(Lcuq;I)V
-
onTake
protected void onTake(int amount) - Mappings:
Namespace Name Mixin selector named onTakeLnet/minecraft/screen/slot/Slot;onTake(I)Vintermediary method_7672Lnet/minecraft/class_1735;method_7672(I)Vofficial bLcrq;b(I)V
-
onCrafted
- Mappings:
Namespace Name Mixin selector named onCraftedLnet/minecraft/screen/slot/Slot;onCrafted(Lnet/minecraft/item/ItemStack;)Vintermediary method_7669Lnet/minecraft/class_1735;method_7669(Lnet/minecraft/class_1799;)Vofficial b_Lcrq;b_(Lcuq;)V
-
onTakeItem
- Mappings:
Namespace Name Mixin selector named onTakeItemLnet/minecraft/screen/slot/Slot;onTakeItem(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)Vintermediary method_7667Lnet/minecraft/class_1735;method_7667(Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)Vofficial aLcrq;a(Lcmx;Lcuq;)V
-
canInsert
- Mappings:
Namespace Name Mixin selector named canInsertLnet/minecraft/screen/slot/Slot;canInsert(Lnet/minecraft/item/ItemStack;)Zintermediary method_7680Lnet/minecraft/class_1735;method_7680(Lnet/minecraft/class_1799;)Zofficial aLcrq;a(Lcuq;)Z
-
getStack
- Mappings:
Namespace Name Mixin selector named getStackLnet/minecraft/screen/slot/Slot;getStack()Lnet/minecraft/item/ItemStack;intermediary method_7677Lnet/minecraft/class_1735;method_7677()Lnet/minecraft/class_1799;official gLcrq;g()Lcuq;
-
hasStack
public boolean hasStack()- Mappings:
Namespace Name Mixin selector named hasStackLnet/minecraft/screen/slot/Slot;hasStack()Zintermediary method_7681Lnet/minecraft/class_1735;method_7681()Zofficial hLcrq;h()Z
-
setStack
- Mappings:
Namespace Name Mixin selector named setStackLnet/minecraft/screen/slot/Slot;setStack(Lnet/minecraft/item/ItemStack;)Vintermediary method_53512Lnet/minecraft/class_1735;method_53512(Lnet/minecraft/class_1799;)Vofficial eLcrq;e(Lcuq;)V
-
setStack
Sets the slot's stack tostackand marks the slot as dirty. Subclasses may override this method to perform additional operations.- Mappings:
Namespace Name Mixin selector named setStackLnet/minecraft/screen/slot/Slot;setStack(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Vintermediary method_48931Lnet/minecraft/class_1735;method_48931(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Vofficial aLcrq;a(Lcuq;Lcuq;)V
-
setStackNoCallbacks
- Mappings:
Namespace Name Mixin selector named setStackNoCallbacksLnet/minecraft/screen/slot/Slot;setStackNoCallbacks(Lnet/minecraft/item/ItemStack;)Vintermediary method_7673Lnet/minecraft/class_1735;method_7673(Lnet/minecraft/class_1799;)Vofficial fLcrq;f(Lcuq;)V
-
markDirty
public void markDirty()- Mappings:
Namespace Name Mixin selector named markDirtyLnet/minecraft/screen/slot/Slot;markDirty()Vintermediary method_7668Lnet/minecraft/class_1735;method_7668()Vofficial cLcrq;c()V
-
getMaxItemCount
public int getMaxItemCount()- Mappings:
Namespace Name Mixin selector named getMaxItemCountLnet/minecraft/screen/slot/Slot;getMaxItemCount()Iintermediary method_7675Lnet/minecraft/class_1735;method_7675()Iofficial aLcrq;a()I
-
getMaxItemCount
- Mappings:
Namespace Name Mixin selector named getMaxItemCountLnet/minecraft/screen/slot/Slot;getMaxItemCount(Lnet/minecraft/item/ItemStack;)Iintermediary method_7676Lnet/minecraft/class_1735;method_7676(Lnet/minecraft/class_1799;)Iofficial a_Lcrq;a_(Lcuq;)I
-
getBackgroundSprite
@Nullable public @Nullable com.mojang.datafixers.util.Pair<Identifier,Identifier> getBackgroundSprite()- Mappings:
Namespace Name Mixin selector named getBackgroundSpriteLnet/minecraft/screen/slot/Slot;getBackgroundSprite()Lcom/mojang/datafixers/util/Pair;intermediary method_7679Lnet/minecraft/class_1735;method_7679()Lcom/mojang/datafixers/util/Pair;official bLcrq;b()Lcom/mojang/datafixers/util/Pair;
-
takeStack
- Mappings:
Namespace Name Mixin selector named takeStackLnet/minecraft/screen/slot/Slot;takeStack(I)Lnet/minecraft/item/ItemStack;intermediary method_7671Lnet/minecraft/class_1735;method_7671(I)Lnet/minecraft/class_1799;official aLcrq;a(I)Lcuq;
-
canTakeItems
- Mappings:
Namespace Name Mixin selector named canTakeItemsLnet/minecraft/screen/slot/Slot;canTakeItems(Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_7674Lnet/minecraft/class_1735;method_7674(Lnet/minecraft/class_1657;)Zofficial aLcrq;a(Lcmx;)Z
-
isEnabled
public boolean isEnabled()- Mappings:
Namespace Name Mixin selector named isEnabledLnet/minecraft/screen/slot/Slot;isEnabled()Zintermediary method_7682Lnet/minecraft/class_1735;method_7682()Zofficial dLcrq;d()Z
-
tryTakeStackRange
- Mappings:
Namespace Name Mixin selector named tryTakeStackRangeLnet/minecraft/screen/slot/Slot;tryTakeStackRange(IILnet/minecraft/entity/player/PlayerEntity;)Ljava/util/Optional;intermediary method_34264Lnet/minecraft/class_1735;method_34264(IILnet/minecraft/class_1657;)Ljava/util/Optional;official aLcrq;a(IILcmx;)Ljava/util/Optional;
-
takeStackRange
- Mappings:
Namespace Name Mixin selector named takeStackRangeLnet/minecraft/screen/slot/Slot;takeStackRange(IILnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;intermediary method_32753Lnet/minecraft/class_1735;method_32753(IILnet/minecraft/class_1657;)Lnet/minecraft/class_1799;official bLcrq;b(IILcmx;)Lcuq;
-
insertStack
- Mappings:
Namespace Name Mixin selector named insertStackLnet/minecraft/screen/slot/Slot;insertStack(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;intermediary method_32756Lnet/minecraft/class_1735;method_32756(Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;official dLcrq;d(Lcuq;)Lcuq;
-
insertStack
- Mappings:
Namespace Name Mixin selector named insertStackLnet/minecraft/screen/slot/Slot;insertStack(Lnet/minecraft/item/ItemStack;I)Lnet/minecraft/item/ItemStack;intermediary method_32755Lnet/minecraft/class_1735;method_32755(Lnet/minecraft/class_1799;I)Lnet/minecraft/class_1799;official bLcrq;b(Lcuq;I)Lcuq;
-
canTakePartial
- Mappings:
Namespace Name Mixin selector named canTakePartialLnet/minecraft/screen/slot/Slot;canTakePartial(Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_32754Lnet/minecraft/class_1735;method_32754(Lnet/minecraft/class_1657;)Zofficial bLcrq;b(Lcmx;)Z
-
getIndex
public int getIndex()- Mappings:
Namespace Name Mixin selector named getIndexLnet/minecraft/screen/slot/Slot;getIndex()Iintermediary method_34266Lnet/minecraft/class_1735;method_34266()Iofficial iLcrq;i()I
-
canBeHighlighted
public boolean canBeHighlighted()- Mappings:
Namespace Name Mixin selector named canBeHighlightedLnet/minecraft/screen/slot/Slot;canBeHighlighted()Zintermediary method_51306Lnet/minecraft/class_1735;method_51306()Zofficial eLcrq;e()Z
-
disablesDynamicDisplay
public boolean disablesDynamicDisplay()Returnstrueto disable dynamic display for clocks and compasses.- Returns:
trueto disable dynamic display for clocks and compasses- Mappings:
Namespace Name Mixin selector named disablesDynamicDisplayLnet/minecraft/screen/slot/Slot;disablesDynamicDisplay()Zintermediary method_55059Lnet/minecraft/class_1735;method_55059()Zofficial fLcrq;f()Z
-