Class LoomScreenHandler
- Mappings:
Namespace Name named net/minecraft/screen/LoomScreenHandler
intermediary net/minecraft/class_1726
official cqy
-
Field Summary
Modifier and TypeFieldDescriptionprivate final RegistryEntryLookup
<BannerPattern> private List
<RegistryEntry<BannerPattern>> (package private) final Slot
private final ScreenHandlerContext
(package private) final Slot
private static final int
private static final int
private final Inventory
private static final int
private static final int
(package private) Runnable
(package private) long
private static final int
private final Inventory
private final Slot
private final Slot
(package private) final Property
Fields inherited from class net.minecraft.screen.ScreenHandler
EMPTY_SPACE_SLOT_INDEX, field_30731, field_30732, field_30733, field_30734, field_30735, field_30736, field_30737, slots, syncId
-
Constructor Summary
ConstructorDescriptionLoomScreenHandler
(int syncId, PlayerInventory playerInventory) LoomScreenHandler
(int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canUse
(PlayerEntity player) Returns whether the screen handler can be used.private List
<RegistryEntry<BannerPattern>> getPatternsFor
(ItemStack stack) int
private boolean
isPatternIndexValid
(int index) boolean
onButtonClick
(PlayerEntity player, int id) Called whenplayer
clicks a button withid
.void
onClosed
(PlayerEntity player) Called when this screen handler is closed.void
onContentChanged
(Inventory inventory) Called when a slot's content has changed.quickMove
(PlayerEntity player, int slot) Quick-moves the stack atslot
to other slots of the screen handler that belong to a different inventory or another section of the same inventory.void
setInventoryChangeListener
(Runnable inventoryChangeListener) private void
updateOutputSlot
(RegistryEntry<BannerPattern> pattern) Methods inherited from class net.minecraft.screen.ScreenHandler
addListener, addProperties, addProperty, addSlot, calculateComparatorOutput, calculateComparatorOutput, calculateStackSize, canInsertIntoSlot, canInsertIntoSlot, canInsertItemIntoSlot, canUse, checkDataCount, checkSize, copySharedSlots, disableSyncing, dropInventory, enableSyncing, endQuickCraft, getCursorStack, getRevision, getSlot, getSlotIndex, getStacks, getType, insertItem, isValid, nextRevision, onSlotClick, packQuickCraftData, removeListener, sendContentUpdates, setCursorStack, setPreviousCursorStack, setPreviousTrackedSlot, setPreviousTrackedSlotMutable, setProperty, setStackInSlot, shouldQuickCraftContinue, syncState, unpackQuickCraftButton, unpackQuickCraftStage, updateSlotStacks, updateSyncHandler, updateToClient
-
Field Details
-
NO_PATTERN
private static final int NO_PATTERN- See Also:
- Mappings:
Namespace Name Mixin selector named NO_PATTERN
Lnet/minecraft/screen/LoomScreenHandler;NO_PATTERN:I
intermediary field_39120
Lnet/minecraft/class_1726;field_39120:I
official k
Lcqy;k:I
-
INVENTORY_START
private static final int INVENTORY_START- See Also:
- Mappings:
Namespace Name Mixin selector named INVENTORY_START
Lnet/minecraft/screen/LoomScreenHandler;INVENTORY_START:I
intermediary field_30826
Lnet/minecraft/class_1726;field_30826:I
official l
Lcqy;l:I
-
INVENTORY_END
private static final int INVENTORY_END- See Also:
- Mappings:
Namespace Name Mixin selector named INVENTORY_END
Lnet/minecraft/screen/LoomScreenHandler;INVENTORY_END:I
intermediary field_30827
Lnet/minecraft/class_1726;field_30827:I
official m
Lcqy;m:I
-
HOTBAR_START
private static final int HOTBAR_START- See Also:
- Mappings:
Namespace Name Mixin selector named HOTBAR_START
Lnet/minecraft/screen/LoomScreenHandler;HOTBAR_START:I
intermediary field_30828
Lnet/minecraft/class_1726;field_30828:I
official n
Lcqy;n:I
-
HOTBAR_END
private static final int HOTBAR_END- See Also:
- Mappings:
Namespace Name Mixin selector named HOTBAR_END
Lnet/minecraft/screen/LoomScreenHandler;HOTBAR_END:I
intermediary field_30829
Lnet/minecraft/class_1726;field_30829:I
official o
Lcqy;o:I
-
context
- Mappings:
Namespace Name Mixin selector named context
Lnet/minecraft/screen/LoomScreenHandler;context:Lnet/minecraft/screen/ScreenHandlerContext;
intermediary field_17316
Lnet/minecraft/class_1726;field_17316:Lnet/minecraft/class_3914;
official p
Lcqy;p:Lcqe;
-
selectedPattern
- Mappings:
Namespace Name Mixin selector named selectedPattern
Lnet/minecraft/screen/LoomScreenHandler;selectedPattern:Lnet/minecraft/screen/Property;
intermediary field_17317
Lnet/minecraft/class_1726;field_17317:Lnet/minecraft/class_3915;
official q
Lcqy;q:Lcql;
-
bannerPatterns
- Mappings:
Namespace Name Mixin selector named bannerPatterns
Lnet/minecraft/screen/LoomScreenHandler;bannerPatterns:Ljava/util/List;
intermediary field_39121
Lnet/minecraft/class_1726;field_39121:Ljava/util/List;
official r
Lcqy;r:Ljava/util/List;
-
inventoryChangeListener
Runnable inventoryChangeListener- Mappings:
Namespace Name Mixin selector named inventoryChangeListener
Lnet/minecraft/screen/LoomScreenHandler;inventoryChangeListener:Ljava/lang/Runnable;
intermediary field_17318
Lnet/minecraft/class_1726;field_17318:Ljava/lang/Runnable;
official s
Lcqy;s:Ljava/lang/Runnable;
-
bannerPatternLookup
- Mappings:
Namespace Name Mixin selector named bannerPatternLookup
Lnet/minecraft/screen/LoomScreenHandler;bannerPatternLookup:Lnet/minecraft/registry/RegistryEntryLookup;
intermediary field_49741
Lnet/minecraft/class_1726;field_49741:Lnet/minecraft/class_7871;
official t
Lcqy;t:Ljn;
-
bannerSlot
- Mappings:
Namespace Name Mixin selector named bannerSlot
Lnet/minecraft/screen/LoomScreenHandler;bannerSlot:Lnet/minecraft/screen/slot/Slot;
intermediary field_17319
Lnet/minecraft/class_1726;field_17319:Lnet/minecraft/class_1735;
official u
Lcqy;u:Lcro;
-
dyeSlot
- Mappings:
Namespace Name Mixin selector named dyeSlot
Lnet/minecraft/screen/LoomScreenHandler;dyeSlot:Lnet/minecraft/screen/slot/Slot;
intermediary field_17320
Lnet/minecraft/class_1726;field_17320:Lnet/minecraft/class_1735;
official v
Lcqy;v:Lcro;
-
patternSlot
- Mappings:
Namespace Name Mixin selector named patternSlot
Lnet/minecraft/screen/LoomScreenHandler;patternSlot:Lnet/minecraft/screen/slot/Slot;
intermediary field_17321
Lnet/minecraft/class_1726;field_17321:Lnet/minecraft/class_1735;
official w
Lcqy;w:Lcro;
-
outputSlot
- Mappings:
Namespace Name Mixin selector named outputSlot
Lnet/minecraft/screen/LoomScreenHandler;outputSlot:Lnet/minecraft/screen/slot/Slot;
intermediary field_17322
Lnet/minecraft/class_1726;field_17322:Lnet/minecraft/class_1735;
official x
Lcqy;x:Lcro;
-
lastTakeResultTime
long lastTakeResultTime- Mappings:
Namespace Name Mixin selector named lastTakeResultTime
Lnet/minecraft/screen/LoomScreenHandler;lastTakeResultTime:J
intermediary field_20383
Lnet/minecraft/class_1726;field_20383:J
official y
Lcqy;y:J
-
input
- Mappings:
Namespace Name Mixin selector named input
Lnet/minecraft/screen/LoomScreenHandler;input:Lnet/minecraft/inventory/Inventory;
intermediary field_7850
Lnet/minecraft/class_1726;field_7850:Lnet/minecraft/class_1263;
official z
Lcqy;z:Lbqj;
-
output
- Mappings:
Namespace Name Mixin selector named output
Lnet/minecraft/screen/LoomScreenHandler;output:Lnet/minecraft/inventory/Inventory;
intermediary field_17323
Lnet/minecraft/class_1726;field_17323:Lnet/minecraft/class_1263;
official A
Lcqy;A:Lbqj;
-
-
Constructor Details
-
LoomScreenHandler
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/screen/LoomScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;)V
intermediary <init>
Lnet/minecraft/class_1726;<init>(ILnet/minecraft/class_1661;)V
official <init>
Lcqy;<init>(ILcmu;)V
-
LoomScreenHandler
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/screen/LoomScreenHandler;<init>(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/screen/ScreenHandlerContext;)V
intermediary <init>
Lnet/minecraft/class_1726;<init>(ILnet/minecraft/class_1661;Lnet/minecraft/class_3914;)V
official <init>
Lcqy;<init>(ILcmu;Lcqe;)V
-
-
Method Details
-
canUse
Returns whether the screen handler can be used.Subclasses should call #canUse(ScreenHandlerContext, PlayerEntity, Block)} or implement the check itself. The implementation should check that the player is near the screen handler's source position (e.g. block position) and that the source (e.g. block) is not destroyed.
- Specified by:
canUse
in classScreenHandler
- Returns:
- whether the screen handler can be used
- Mappings:
Namespace Name Mixin selector named canUse
Lnet/minecraft/screen/ScreenHandler;canUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
intermediary method_7597
Lnet/minecraft/class_1703;method_7597(Lnet/minecraft/class_1657;)Z
official b
Lcps;b(Lcmv;)Z
-
onButtonClick
Called whenplayer
clicks a button withid
."Button click" is an abstract concept; it does not have to be triggered by a button. Examples of button clicks include selecting a recipe for a stonecutter, turning a page of a lectern's book, or selecting an enchantment on an enchanting table. Buttons are identified by an integer.
- Overrides:
onButtonClick
in classScreenHandler
- Returns:
- whether the button click is handled successfully
- Implementation Note:
- This is normally only called by the server; however, screens that use buttons can call this on the client.
- Mappings:
Namespace Name Mixin selector named onButtonClick
Lnet/minecraft/screen/ScreenHandler;onButtonClick(Lnet/minecraft/entity/player/PlayerEntity;I)Z
intermediary method_7604
Lnet/minecraft/class_1703;method_7604(Lnet/minecraft/class_1657;I)Z
official a
Lcps;a(Lcmv;I)Z
-
getPatternsFor
- Mappings:
Namespace Name Mixin selector named getPatternsFor
Lnet/minecraft/screen/LoomScreenHandler;getPatternsFor(Lnet/minecraft/item/ItemStack;)Ljava/util/List;
intermediary method_43705
Lnet/minecraft/class_1726;method_43705(Lnet/minecraft/class_1799;)Ljava/util/List;
official c
Lcqy;c(Lcuo;)Ljava/util/List;
-
isPatternIndexValid
private boolean isPatternIndexValid(int index) - Mappings:
Namespace Name Mixin selector named isPatternIndexValid
Lnet/minecraft/screen/LoomScreenHandler;isPatternIndexValid(I)Z
intermediary method_45016
Lnet/minecraft/class_1726;method_45016(I)Z
official e
Lcqy;e(I)Z
-
onContentChanged
Called when a slot's content has changed.This is not called by default; subclasses that override this method should also use a custom
Inventory
whosemarkDirty
method is overridden to call this method as a backing inventory of the slot.This can be used to update the output slot when input changes.
- Overrides:
onContentChanged
in classScreenHandler
- Mappings:
Namespace Name Mixin selector named onContentChanged
Lnet/minecraft/screen/ScreenHandler;onContentChanged(Lnet/minecraft/inventory/Inventory;)V
intermediary method_7609
Lnet/minecraft/class_1703;method_7609(Lnet/minecraft/class_1263;)V
official a
Lcps;a(Lbqj;)V
-
getBannerPatterns
- Mappings:
Namespace Name Mixin selector named getBannerPatterns
Lnet/minecraft/screen/LoomScreenHandler;getBannerPatterns()Ljava/util/List;
intermediary method_43706
Lnet/minecraft/class_1726;method_43706()Ljava/util/List;
official l
Lcqy;l()Ljava/util/List;
-
getSelectedPattern
public int getSelectedPattern()- Mappings:
Namespace Name Mixin selector named getSelectedPattern
Lnet/minecraft/screen/LoomScreenHandler;getSelectedPattern()I
intermediary method_7647
Lnet/minecraft/class_1726;method_7647()I
official m
Lcqy;m()I
-
setInventoryChangeListener
- Mappings:
Namespace Name Mixin selector named setInventoryChangeListener
Lnet/minecraft/screen/LoomScreenHandler;setInventoryChangeListener(Ljava/lang/Runnable;)V
intermediary method_17423
Lnet/minecraft/class_1726;method_17423(Ljava/lang/Runnable;)V
official a
Lcqy;a(Ljava/lang/Runnable;)V
-
quickMove
Quick-moves the stack atslot
to other slots of the screen handler that belong to a different inventory or another section of the same inventory. For example, items can be quick-moved between a chest's slots and the player inventory or between the main player inventory and the hotbar.Subclasses should call
ScreenHandler.insertItem(net.minecraft.item.ItemStack, int, int, boolean)
, and if the insertion was successful, clear the slot (if the stack is exhausted) or mark it as dirty. See the vanilla subclasses for basic implementation.Quick-moving is also known as "shift-clicking" since it's usually triggered using Shift+left click.
- Specified by:
quickMove
in classScreenHandler
- Parameters:
slot
- the index of the slot to quick-move from- Returns:
ItemStack.EMPTY
when no stack can be transferred, otherwise the original stack- See Also:
- Mappings:
Namespace Name Mixin selector named quickMove
Lnet/minecraft/screen/ScreenHandler;quickMove(Lnet/minecraft/entity/player/PlayerEntity;I)Lnet/minecraft/item/ItemStack;
intermediary method_7601
Lnet/minecraft/class_1703;method_7601(Lnet/minecraft/class_1657;I)Lnet/minecraft/class_1799;
official b
Lcps;b(Lcmv;I)Lcuo;
-
onClosed
Called when this screen handler is closed.To close a screen handler, call
PlayerEntity.closeHandledScreen()
on the server instead of this method.This drops the cursor stack by default. Subclasses that have slots not backed by a persistent inventory should call
ScreenHandler.dropInventory(net.minecraft.entity.player.PlayerEntity, net.minecraft.inventory.Inventory)
to drop the stacks.- Overrides:
onClosed
in classScreenHandler
- Mappings:
Namespace Name Mixin selector named onClosed
Lnet/minecraft/screen/ScreenHandler;onClosed(Lnet/minecraft/entity/player/PlayerEntity;)V
intermediary method_7595
Lnet/minecraft/class_1703;method_7595(Lnet/minecraft/class_1657;)V
official a
Lcps;a(Lcmv;)V
-
updateOutputSlot
- Mappings:
Namespace Name Mixin selector named updateOutputSlot
Lnet/minecraft/screen/LoomScreenHandler;updateOutputSlot(Lnet/minecraft/registry/entry/RegistryEntry;)V
intermediary method_7648
Lnet/minecraft/class_1726;method_7648(Lnet/minecraft/class_6880;)V
official a
Lcqy;a(Ljm;)V
-
getBannerSlot
- Mappings:
Namespace Name Mixin selector named getBannerSlot
Lnet/minecraft/screen/LoomScreenHandler;getBannerSlot()Lnet/minecraft/screen/slot/Slot;
intermediary method_17428
Lnet/minecraft/class_1726;method_17428()Lnet/minecraft/class_1735;
official n
Lcqy;n()Lcro;
-
getDyeSlot
- Mappings:
Namespace Name Mixin selector named getDyeSlot
Lnet/minecraft/screen/LoomScreenHandler;getDyeSlot()Lnet/minecraft/screen/slot/Slot;
intermediary method_17429
Lnet/minecraft/class_1726;method_17429()Lnet/minecraft/class_1735;
official o
Lcqy;o()Lcro;
-
getPatternSlot
- Mappings:
Namespace Name Mixin selector named getPatternSlot
Lnet/minecraft/screen/LoomScreenHandler;getPatternSlot()Lnet/minecraft/screen/slot/Slot;
intermediary method_17430
Lnet/minecraft/class_1726;method_17430()Lnet/minecraft/class_1735;
official p
Lcqy;p()Lcro;
-
getOutputSlot
- Mappings:
Namespace Name Mixin selector named getOutputSlot
Lnet/minecraft/screen/LoomScreenHandler;getOutputSlot()Lnet/minecraft/screen/slot/Slot;
intermediary method_17431
Lnet/minecraft/class_1726;method_17431()Lnet/minecraft/class_1735;
official q
Lcqy;q()Lcro;
-