Package net.minecraft.screen.slot
Class Slot
java.lang.Object
net.minecraft.screen.slot.Slot
- Direct Known Subclasses:
BeaconScreenHandler.PaymentSlot,BrewingStandScreenHandler.FuelSlot,BrewingStandScreenHandler.IngredientSlot,BrewingStandScreenHandler.PotionSlot,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 intermediary net/minecraft/class_1735official ccvnamed net/minecraft/screen/slot/Slot
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanTakeItems(PlayerEntity playerEntity) booleancanTakePartial(PlayerEntity player) @Nullable com.mojang.datafixers.util.Pair<Identifier,Identifier> intgetIndex()intintgetMaxItemCount(ItemStack stack) getStack()booleanhasStack()insertStack(ItemStack stack) insertStack(ItemStack stack, int count) booleanvoidbooleanprotected voidprotected voidvoidonQuickTransfer(ItemStack newItem, ItemStack original) protected voidonTake(int amount) voidonTakeItem(PlayerEntity player, ItemStack stack) voidSets 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 intermediary field_7875Lnet/minecraft/class_1735;field_7875:Iofficial aLccv;a:Inamed indexLnet/minecraft/screen/slot/Slot;index:I
-
inventory
- Mappings:
Namespace Name Mixin selector intermediary field_7871Lnet/minecraft/class_1735;field_7871:Lnet/minecraft/class_1263;official dLccv;d:Lbdp;named inventoryLnet/minecraft/screen/slot/Slot;inventory:Lnet/minecraft/inventory/Inventory;
-
id
public int id- Mappings:
Namespace Name Mixin selector intermediary field_7874Lnet/minecraft/class_1735;field_7874:Iofficial eLccv;e:Inamed idLnet/minecraft/screen/slot/Slot;id:I
-
x
public final int x- Mappings:
Namespace Name Mixin selector intermediary field_7873Lnet/minecraft/class_1735;field_7873:Iofficial fLccv;f:Inamed xLnet/minecraft/screen/slot/Slot;x:I
-
y
public final int y- Mappings:
Namespace Name Mixin selector intermediary field_7872Lnet/minecraft/class_1735;field_7872:Iofficial gLccv;g:Inamed yLnet/minecraft/screen/slot/Slot;y:I
-
-
Constructor Details
-
Slot
- Mappings:
Namespace Name Mixin selector intermediary <init>Lnet/minecraft/class_1735;<init>(Lnet/minecraft/class_1263;III)Vofficial <init>Lccv;<init>(Lbdp;III)Vnamed <init>Lnet/minecraft/screen/slot/Slot;<init>(Lnet/minecraft/inventory/Inventory;III)V
-
-
Method Details
-
onQuickTransfer
- Mappings:
Namespace Name Mixin selector intermediary method_7670Lnet/minecraft/class_1735;method_7670(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Vofficial aLccv;a(Lcfx;Lcfx;)Vnamed onQuickTransferLnet/minecraft/screen/slot/Slot;onQuickTransfer(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)V
-
onCrafted
- Mappings:
Namespace Name Mixin selector intermediary method_7678Lnet/minecraft/class_1735;method_7678(Lnet/minecraft/class_1799;I)Vofficial aLccv;a(Lcfx;I)Vnamed onCraftedLnet/minecraft/screen/slot/Slot;onCrafted(Lnet/minecraft/item/ItemStack;I)V
-
onTake
protected void onTake(int amount) - Mappings:
Namespace Name Mixin selector intermediary method_7672Lnet/minecraft/class_1735;method_7672(I)Vofficial bLccv;b(I)Vnamed onTakeLnet/minecraft/screen/slot/Slot;onTake(I)V
-
onCrafted
- Mappings:
Namespace Name Mixin selector intermediary method_7669Lnet/minecraft/class_1735;method_7669(Lnet/minecraft/class_1799;)Vofficial b_Lccv;b_(Lcfx;)Vnamed onCraftedLnet/minecraft/screen/slot/Slot;onCrafted(Lnet/minecraft/item/ItemStack;)V
-
onTakeItem
- Mappings:
Namespace Name Mixin selector intermediary method_7667Lnet/minecraft/class_1735;method_7667(Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)Vofficial aLccv;a(Lbym;Lcfx;)Vnamed onTakeItemLnet/minecraft/screen/slot/Slot;onTakeItem(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)V
-
canInsert
- Mappings:
Namespace Name Mixin selector intermediary method_7680Lnet/minecraft/class_1735;method_7680(Lnet/minecraft/class_1799;)Zofficial aLccv;a(Lcfx;)Znamed canInsertLnet/minecraft/screen/slot/Slot;canInsert(Lnet/minecraft/item/ItemStack;)Z
-
getStack
- Mappings:
Namespace Name Mixin selector intermediary method_7677Lnet/minecraft/class_1735;method_7677()Lnet/minecraft/class_1799;official eLccv;e()Lcfx;named getStackLnet/minecraft/screen/slot/Slot;getStack()Lnet/minecraft/item/ItemStack;
-
hasStack
public boolean hasStack()- Mappings:
Namespace Name Mixin selector intermediary method_7681Lnet/minecraft/class_1735;method_7681()Zofficial fLccv;f()Znamed hasStackLnet/minecraft/screen/slot/Slot;hasStack()Z
-
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 intermediary method_48931Lnet/minecraft/class_1735;method_48931(Lnet/minecraft/class_1799;)Vofficial dLccv;d(Lcfx;)Vnamed setStackLnet/minecraft/screen/slot/Slot;setStack(Lnet/minecraft/item/ItemStack;)V
-
setStackNoCallbacks
- Mappings:
Namespace Name Mixin selector intermediary method_7673Lnet/minecraft/class_1735;method_7673(Lnet/minecraft/class_1799;)Vofficial eLccv;e(Lcfx;)Vnamed setStackNoCallbacksLnet/minecraft/screen/slot/Slot;setStackNoCallbacks(Lnet/minecraft/item/ItemStack;)V
-
markDirty
public void markDirty()- Mappings:
Namespace Name Mixin selector intermediary method_7668Lnet/minecraft/class_1735;method_7668()Vofficial dLccv;d()Vnamed markDirtyLnet/minecraft/screen/slot/Slot;markDirty()V
-
getMaxItemCount
public int getMaxItemCount()- Mappings:
Namespace Name Mixin selector intermediary method_7675Lnet/minecraft/class_1735;method_7675()Iofficial aLccv;a()Inamed getMaxItemCountLnet/minecraft/screen/slot/Slot;getMaxItemCount()I
-
getMaxItemCount
- Mappings:
Namespace Name Mixin selector intermediary method_7676Lnet/minecraft/class_1735;method_7676(Lnet/minecraft/class_1799;)Iofficial a_Lccv;a_(Lcfx;)Inamed getMaxItemCountLnet/minecraft/screen/slot/Slot;getMaxItemCount(Lnet/minecraft/item/ItemStack;)I
-
getBackgroundSprite
@Nullable public @Nullable com.mojang.datafixers.util.Pair<Identifier,Identifier> getBackgroundSprite()- Mappings:
Namespace Name Mixin selector intermediary method_7679Lnet/minecraft/class_1735;method_7679()Lcom/mojang/datafixers/util/Pair;official cLccv;c()Lcom/mojang/datafixers/util/Pair;named getBackgroundSpriteLnet/minecraft/screen/slot/Slot;getBackgroundSprite()Lcom/mojang/datafixers/util/Pair;
-
takeStack
- Mappings:
Namespace Name Mixin selector intermediary method_7671Lnet/minecraft/class_1735;method_7671(I)Lnet/minecraft/class_1799;official aLccv;a(I)Lcfx;named takeStackLnet/minecraft/screen/slot/Slot;takeStack(I)Lnet/minecraft/item/ItemStack;
-
canTakeItems
- Mappings:
Namespace Name Mixin selector intermediary method_7674Lnet/minecraft/class_1735;method_7674(Lnet/minecraft/class_1657;)Zofficial aLccv;a(Lbym;)Znamed canTakeItemsLnet/minecraft/screen/slot/Slot;canTakeItems(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
isEnabled
public boolean isEnabled()- Mappings:
Namespace Name Mixin selector intermediary method_7682Lnet/minecraft/class_1735;method_7682()Zofficial bLccv;b()Znamed isEnabledLnet/minecraft/screen/slot/Slot;isEnabled()Z
-
tryTakeStackRange
- Mappings:
Namespace Name Mixin selector intermediary method_34264Lnet/minecraft/class_1735;method_34264(IILnet/minecraft/class_1657;)Ljava/util/Optional;official aLccv;a(IILbym;)Ljava/util/Optional;named tryTakeStackRangeLnet/minecraft/screen/slot/Slot;tryTakeStackRange(IILnet/minecraft/entity/player/PlayerEntity;)Ljava/util/Optional;
-
takeStackRange
- Mappings:
Namespace Name Mixin selector intermediary method_32753Lnet/minecraft/class_1735;method_32753(IILnet/minecraft/class_1657;)Lnet/minecraft/class_1799;official bLccv;b(IILbym;)Lcfx;named takeStackRangeLnet/minecraft/screen/slot/Slot;takeStackRange(IILnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;
-
insertStack
- Mappings:
Namespace Name Mixin selector intermediary method_32756Lnet/minecraft/class_1735;method_32756(Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;official fLccv;f(Lcfx;)Lcfx;named insertStackLnet/minecraft/screen/slot/Slot;insertStack(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;
-
insertStack
- Mappings:
Namespace Name Mixin selector intermediary method_32755Lnet/minecraft/class_1735;method_32755(Lnet/minecraft/class_1799;I)Lnet/minecraft/class_1799;official bLccv;b(Lcfx;I)Lcfx;named insertStackLnet/minecraft/screen/slot/Slot;insertStack(Lnet/minecraft/item/ItemStack;I)Lnet/minecraft/item/ItemStack;
-
canTakePartial
- Mappings:
Namespace Name Mixin selector intermediary method_32754Lnet/minecraft/class_1735;method_32754(Lnet/minecraft/class_1657;)Zofficial bLccv;b(Lbym;)Znamed canTakePartialLnet/minecraft/screen/slot/Slot;canTakePartial(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
getIndex
public int getIndex()- Mappings:
Namespace Name Mixin selector intermediary method_34266Lnet/minecraft/class_1735;method_34266()Iofficial gLccv;g()Inamed getIndexLnet/minecraft/screen/slot/Slot;getIndex()I
-
method_51306
public boolean method_51306()- Mappings:
Namespace Name Mixin selector intermediary method_51306Lnet/minecraft/class_1735;method_51306()Zofficial hLccv;h()Znamed method_51306Lnet/minecraft/screen/slot/Slot;method_51306()Z
-