Class ForgingScreenHandler
- Direct Known Subclasses:
AnvilScreenHandler
,SmithingScreenHandler
- Mappings:
Namespace Name official cfl
intermediary net/minecraft/class_4861
named net/minecraft/screen/ForgingScreenHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ScreenHandlerContext
private static final int
private static final int
protected final Inventory
protected final CraftingResultInventory
protected final PlayerEntity
private final int
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
ConstructorDescriptionForgingScreenHandler
(@Nullable ScreenHandlerType<?> type, int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addInputSlots
(ForgingSlotsManager forgingSlotsManager) private void
addPlayerInventorySlots
(PlayerInventory playerInventory) private void
addResultSlot
(ForgingSlotsManager forgingSlotsManager) protected abstract boolean
canTakeOutput
(PlayerEntity player, boolean present) protected abstract boolean
canUse
(BlockState state) boolean
canUse
(PlayerEntity player) Returns whether the screen handler can be used.private SimpleInventory
createInputInventory
(int size) protected abstract ForgingSlotsManager
private int
private int
private int
private int
int
int
getSlotFor
(ItemStack stack) protected boolean
isValidIngredient
(ItemStack stack) void
onClosed
(PlayerEntity player) Called when this screen handler is closed.void
onContentChanged
(Inventory inventory) Called when a slot's content has changed.protected abstract void
onTakeOutput
(PlayerEntity player, ItemStack stack) 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.abstract void
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, onButtonClick, onSlotClick, packQuickCraftData, removeListener, sendContentUpdates, setCursorStack, setPreviousCursorStack, setPreviousTrackedSlot, setPreviousTrackedSlotMutable, setProperty, setStackInSlot, shouldQuickCraftContinue, syncState, unpackQuickCraftButton, unpackQuickCraftStage, updateSlotStacks, updateSyncHandler, updateToClient
-
Field Details
-
field_41901
private static final int field_41901- See Also:
- Mappings:
Namespace Name Mixin selector official k
Lcfl;k:I
intermediary field_41901
Lnet/minecraft/class_4861;field_41901:I
named field_41901
Lnet/minecraft/screen/ForgingScreenHandler;field_41901:I
-
field_41902
private static final int field_41902- See Also:
- Mappings:
Namespace Name Mixin selector official l
Lcfl;l:I
intermediary field_41902
Lnet/minecraft/class_4861;field_41902:I
named field_41902
Lnet/minecraft/screen/ForgingScreenHandler;field_41902:I
-
context
- Mappings:
Namespace Name Mixin selector official o
Lcfl;o:Lcew;
intermediary field_22481
Lnet/minecraft/class_4861;field_22481:Lnet/minecraft/class_3914;
named context
Lnet/minecraft/screen/ForgingScreenHandler;context:Lnet/minecraft/screen/ScreenHandlerContext;
-
player
- Mappings:
Namespace Name Mixin selector official p
Lcfl;p:Lcbu;
intermediary field_22482
Lnet/minecraft/class_4861;field_22482:Lnet/minecraft/class_1657;
named player
Lnet/minecraft/screen/ForgingScreenHandler;player:Lnet/minecraft/entity/player/PlayerEntity;
-
input
- Mappings:
Namespace Name Mixin selector official q
Lcfl;q:Lbgr;
intermediary field_22480
Lnet/minecraft/class_4861;field_22480:Lnet/minecraft/class_1263;
named input
Lnet/minecraft/screen/ForgingScreenHandler;input:Lnet/minecraft/inventory/Inventory;
-
inputSlotIndices
- Mappings:
Namespace Name Mixin selector official m
Lcfl;m:Ljava/util/List;
intermediary field_41903
Lnet/minecraft/class_4861;field_41903:Ljava/util/List;
named inputSlotIndices
Lnet/minecraft/screen/ForgingScreenHandler;inputSlotIndices:Ljava/util/List;
-
output
- Mappings:
Namespace Name Mixin selector official r
Lcfl;r:Lcfy;
intermediary field_22479
Lnet/minecraft/class_4861;field_22479:Lnet/minecraft/class_1731;
named output
Lnet/minecraft/screen/ForgingScreenHandler;output:Lnet/minecraft/inventory/CraftingResultInventory;
-
resultSlotIndex
private final int resultSlotIndex- Mappings:
Namespace Name Mixin selector official n
Lcfl;n:I
intermediary field_41904
Lnet/minecraft/class_4861;field_41904:I
named resultSlotIndex
Lnet/minecraft/screen/ForgingScreenHandler;resultSlotIndex:I
-
-
Constructor Details
-
ForgingScreenHandler
public ForgingScreenHandler(@Nullable @Nullable ScreenHandlerType<?> type, int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) - Mappings:
Namespace Name Mixin selector official <init>
Lcfl;<init>(Lcfq;ILcbt;Lcew;)V
intermediary <init>
Lnet/minecraft/class_4861;<init>(Lnet/minecraft/class_3917;ILnet/minecraft/class_1661;Lnet/minecraft/class_3914;)V
named <init>
Lnet/minecraft/screen/ForgingScreenHandler;<init>(Lnet/minecraft/screen/ScreenHandlerType;ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/screen/ScreenHandlerContext;)V
-
-
Method Details
-
canTakeOutput
- Mappings:
Namespace Name Mixin selector official a
Lcfl;a(Lcbu;Z)Z
intermediary method_24927
Lnet/minecraft/class_4861;method_24927(Lnet/minecraft/class_1657;Z)Z
named canTakeOutput
Lnet/minecraft/screen/ForgingScreenHandler;canTakeOutput(Lnet/minecraft/entity/player/PlayerEntity;Z)Z
-
onTakeOutput
- Mappings:
Namespace Name Mixin selector official a
Lcfl;a(Lcbu;Lcjf;)V
intermediary method_24923
Lnet/minecraft/class_4861;method_24923(Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)V
named onTakeOutput
Lnet/minecraft/screen/ForgingScreenHandler;onTakeOutput(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)V
-
canUse
- Mappings:
Namespace Name Mixin selector official a
Lcfl;a(Ldfj;)Z
intermediary method_24925
Lnet/minecraft/class_4861;method_24925(Lnet/minecraft/class_2680;)Z
named canUse
Lnet/minecraft/screen/ForgingScreenHandler;canUse(Lnet/minecraft/block/BlockState;)Z
-
addInputSlots
- Mappings:
Namespace Name Mixin selector official a
Lcfl;a(Lcfm;)V
intermediary method_48354
Lnet/minecraft/class_4861;method_48354(Lnet/minecraft/class_8047;)V
named addInputSlots
Lnet/minecraft/screen/ForgingScreenHandler;addInputSlots(Lnet/minecraft/screen/slot/ForgingSlotsManager;)V
-
addResultSlot
- Mappings:
Namespace Name Mixin selector official b
Lcfl;b(Lcfm;)V
intermediary method_48355
Lnet/minecraft/class_4861;method_48355(Lnet/minecraft/class_8047;)V
named addResultSlot
Lnet/minecraft/screen/ForgingScreenHandler;addResultSlot(Lnet/minecraft/screen/slot/ForgingSlotsManager;)V
-
addPlayerInventorySlots
- Mappings:
Namespace Name Mixin selector official a
Lcfl;a(Lcbt;)V
intermediary method_48353
Lnet/minecraft/class_4861;method_48353(Lnet/minecraft/class_1661;)V
named addPlayerInventorySlots
Lnet/minecraft/screen/ForgingScreenHandler;addPlayerInventorySlots(Lnet/minecraft/entity/player/PlayerInventory;)V
-
updateResult
public abstract void updateResult()- Mappings:
Namespace Name Mixin selector official m
Lcfl;m()V
intermediary method_24928
Lnet/minecraft/class_4861;method_24928()V
named updateResult
Lnet/minecraft/screen/ForgingScreenHandler;updateResult()V
-
getForgingSlotsManager
- Mappings:
Namespace Name Mixin selector official l
Lcfl;l()Lcfm;
intermediary method_48352
Lnet/minecraft/class_4861;method_48352()Lnet/minecraft/class_8047;
named getForgingSlotsManager
Lnet/minecraft/screen/ForgingScreenHandler;getForgingSlotsManager()Lnet/minecraft/screen/slot/ForgingSlotsManager;
-
createInputInventory
- Mappings:
Namespace Name Mixin selector official e
Lcfl;e(I)Lbhf;
intermediary method_48358
Lnet/minecraft/class_4861;method_48358(I)Lnet/minecraft/class_1277;
named createInputInventory
Lnet/minecraft/screen/ForgingScreenHandler;createInputInventory(I)Lnet/minecraft/inventory/SimpleInventory;
-
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 official a
Lcel;a(Lbgr;)V
intermediary method_7609
Lnet/minecraft/class_1703;method_7609(Lnet/minecraft/class_1263;)V
named onContentChanged
Lnet/minecraft/screen/ScreenHandler;onContentChanged(Lnet/minecraft/inventory/Inventory;)V
-
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 official b
Lcel;b(Lcbu;)V
intermediary method_7595
Lnet/minecraft/class_1703;method_7595(Lnet/minecraft/class_1657;)V
named onClosed
Lnet/minecraft/screen/ScreenHandler;onClosed(Lnet/minecraft/entity/player/PlayerEntity;)V
-
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 official a
Lcel;a(Lcbu;)Z
intermediary method_7597
Lnet/minecraft/class_1703;method_7597(Lnet/minecraft/class_1657;)Z
named canUse
Lnet/minecraft/screen/ScreenHandler;canUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
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 official a
Lcel;a(Lcbu;I)Lcjf;
intermediary method_7601
Lnet/minecraft/class_1703;method_7601(Lnet/minecraft/class_1657;I)Lnet/minecraft/class_1799;
named quickMove
Lnet/minecraft/screen/ScreenHandler;quickMove(Lnet/minecraft/entity/player/PlayerEntity;I)Lnet/minecraft/item/ItemStack;
-
isValidIngredient
- Mappings:
Namespace Name Mixin selector official c
Lcfl;c(Lcjf;)Z
intermediary method_48356
Lnet/minecraft/class_4861;method_48356(Lnet/minecraft/class_1799;)Z
named isValidIngredient
Lnet/minecraft/screen/ForgingScreenHandler;isValidIngredient(Lnet/minecraft/item/ItemStack;)Z
-
getSlotFor
- Mappings:
Namespace Name Mixin selector official d
Lcfl;d(Lcjf;)I
intermediary method_48357
Lnet/minecraft/class_4861;method_48357(Lnet/minecraft/class_1799;)I
named getSlotFor
Lnet/minecraft/screen/ForgingScreenHandler;getSlotFor(Lnet/minecraft/item/ItemStack;)I
-
getResultSlotIndex
public int getResultSlotIndex()- Mappings:
Namespace Name Mixin selector official o
Lcfl;o()I
intermediary method_48360
Lnet/minecraft/class_4861;method_48360()I
named getResultSlotIndex
Lnet/minecraft/screen/ForgingScreenHandler;getResultSlotIndex()I
-
getPlayerInventoryStartIndex
private int getPlayerInventoryStartIndex()- Mappings:
Namespace Name Mixin selector official n
Lcfl;n()I
intermediary method_48359
Lnet/minecraft/class_4861;method_48359()I
named getPlayerInventoryStartIndex
Lnet/minecraft/screen/ForgingScreenHandler;getPlayerInventoryStartIndex()I
-
getPlayerInventoryEndIndex
private int getPlayerInventoryEndIndex()- Mappings:
Namespace Name Mixin selector official p
Lcfl;p()I
intermediary method_48361
Lnet/minecraft/class_4861;method_48361()I
named getPlayerInventoryEndIndex
Lnet/minecraft/screen/ForgingScreenHandler;getPlayerInventoryEndIndex()I
-
getPlayerHotbarStartIndex
private int getPlayerHotbarStartIndex()- Mappings:
Namespace Name Mixin selector official q
Lcfl;q()I
intermediary method_48362
Lnet/minecraft/class_4861;method_48362()I
named getPlayerHotbarStartIndex
Lnet/minecraft/screen/ForgingScreenHandler;getPlayerHotbarStartIndex()I
-
getPlayerHotbarEndIndex
private int getPlayerHotbarEndIndex()- Mappings:
Namespace Name Mixin selector official r
Lcfl;r()I
intermediary method_48363
Lnet/minecraft/class_4861;method_48363()I
named getPlayerHotbarEndIndex
Lnet/minecraft/screen/ForgingScreenHandler;getPlayerHotbarEndIndex()I
-