Class ForgingScreenHandler
- Direct Known Subclasses:
AnvilScreenHandler,SmithingScreenHandler
- Mappings:
Namespace Name named net/minecraft/screen/ForgingScreenHandlerintermediary net/minecraft/class_4861official cqx
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ScreenHandlerContextprivate static final intprivate static final intprotected final Inventoryprotected final CraftingResultInventoryprotected final PlayerEntityprivate final intFields 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
ConstructorsConstructorDescriptionForgingScreenHandler(@Nullable ScreenHandlerType<?> type, int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddInputSlots(ForgingSlotsManager forgingSlotsManager) private voidaddPlayerInventorySlots(PlayerInventory playerInventory) private voidaddResultSlot(ForgingSlotsManager forgingSlotsManager) protected abstract booleancanTakeOutput(PlayerEntity player, boolean present) protected abstract booleancanUse(BlockState state) booleancanUse(PlayerEntity player) Returns whether the screen handler can be used.private SimpleInventorycreateInputInventory(int size) protected abstract ForgingSlotsManagerprivate intprivate intprivate intprivate intintintgetSlotFor(ItemStack stack) protected booleanisValidIngredient(ItemStack stack) voidonClosed(PlayerEntity player) Called when this screen handler is closed.voidonContentChanged(Inventory inventory) Called when a slot's content has changed.protected abstract voidonTakeOutput(PlayerEntity player, ItemStack stack) quickMove(PlayerEntity player, int slot) Quick-moves the stack atslotto other slots of the screen handler that belong to a different inventory or another section of the same inventory.abstract voidMethods 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 named field_41901Lnet/minecraft/screen/ForgingScreenHandler;field_41901:Iintermediary field_41901Lnet/minecraft/class_4861;field_41901:Iofficial kLcqx;k:I
-
field_41902
private static final int field_41902- See Also:
- Mappings:
Namespace Name Mixin selector named field_41902Lnet/minecraft/screen/ForgingScreenHandler;field_41902:Iintermediary field_41902Lnet/minecraft/class_4861;field_41902:Iofficial lLcqx;l:I
-
context
- Mappings:
Namespace Name Mixin selector named contextLnet/minecraft/screen/ForgingScreenHandler;context:Lnet/minecraft/screen/ScreenHandlerContext;intermediary field_22481Lnet/minecraft/class_4861;field_22481:Lnet/minecraft/class_3914;official oLcqx;o:Lcqg;
-
player
- Mappings:
Namespace Name Mixin selector named playerLnet/minecraft/screen/ForgingScreenHandler;player:Lnet/minecraft/entity/player/PlayerEntity;intermediary field_22482Lnet/minecraft/class_4861;field_22482:Lnet/minecraft/class_1657;official pLcqx;p:Lcmx;
-
input
- Mappings:
Namespace Name Mixin selector named inputLnet/minecraft/screen/ForgingScreenHandler;input:Lnet/minecraft/inventory/Inventory;intermediary field_22480Lnet/minecraft/class_4861;field_22480:Lnet/minecraft/class_1263;official qLcqx;q:Lbqk;
-
inputSlotIndices
- Mappings:
Namespace Name Mixin selector named inputSlotIndicesLnet/minecraft/screen/ForgingScreenHandler;inputSlotIndices:Ljava/util/List;intermediary field_41903Lnet/minecraft/class_4861;field_41903:Ljava/util/List;official mLcqx;m:Ljava/util/List;
-
output
- Mappings:
Namespace Name Mixin selector named outputLnet/minecraft/screen/ForgingScreenHandler;output:Lnet/minecraft/inventory/CraftingResultInventory;intermediary field_22479Lnet/minecraft/class_4861;field_22479:Lnet/minecraft/class_1731;official rLcqx;r:Lcrl;
-
resultSlotIndex
private final int resultSlotIndex- Mappings:
Namespace Name Mixin selector named resultSlotIndexLnet/minecraft/screen/ForgingScreenHandler;resultSlotIndex:Iintermediary field_41904Lnet/minecraft/class_4861;field_41904:Iofficial nLcqx;n:I
-
-
Constructor Details
-
ForgingScreenHandler
public ForgingScreenHandler(@Nullable @Nullable ScreenHandlerType<?> type, int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/screen/ForgingScreenHandler;<init>(Lnet/minecraft/screen/ScreenHandlerType;ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/screen/ScreenHandlerContext;)Vintermediary <init>Lnet/minecraft/class_4861;<init>(Lnet/minecraft/class_3917;ILnet/minecraft/class_1661;Lnet/minecraft/class_3914;)Vofficial <init>Lcqx;<init>(Lcrc;ILcmw;Lcqg;)V
-
-
Method Details
-
canTakeOutput
- Mappings:
Namespace Name Mixin selector named canTakeOutputLnet/minecraft/screen/ForgingScreenHandler;canTakeOutput(Lnet/minecraft/entity/player/PlayerEntity;Z)Zintermediary method_24927Lnet/minecraft/class_4861;method_24927(Lnet/minecraft/class_1657;Z)Zofficial aLcqx;a(Lcmx;Z)Z
-
onTakeOutput
- Mappings:
Namespace Name Mixin selector named onTakeOutputLnet/minecraft/screen/ForgingScreenHandler;onTakeOutput(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)Vintermediary method_24923Lnet/minecraft/class_4861;method_24923(Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)Vofficial aLcqx;a(Lcmx;Lcuq;)V
-
canUse
- Mappings:
Namespace Name Mixin selector named canUseLnet/minecraft/screen/ForgingScreenHandler;canUse(Lnet/minecraft/block/BlockState;)Zintermediary method_24925Lnet/minecraft/class_4861;method_24925(Lnet/minecraft/class_2680;)Zofficial aLcqx;a(Ldtc;)Z
-
addInputSlots
- Mappings:
Namespace Name Mixin selector named addInputSlotsLnet/minecraft/screen/ForgingScreenHandler;addInputSlots(Lnet/minecraft/screen/slot/ForgingSlotsManager;)Vintermediary method_48354Lnet/minecraft/class_4861;method_48354(Lnet/minecraft/class_8047;)Vofficial aLcqx;a(Lcqy;)V
-
addResultSlot
- Mappings:
Namespace Name Mixin selector named addResultSlotLnet/minecraft/screen/ForgingScreenHandler;addResultSlot(Lnet/minecraft/screen/slot/ForgingSlotsManager;)Vintermediary method_48355Lnet/minecraft/class_4861;method_48355(Lnet/minecraft/class_8047;)Vofficial bLcqx;b(Lcqy;)V
-
addPlayerInventorySlots
- Mappings:
Namespace Name Mixin selector named addPlayerInventorySlotsLnet/minecraft/screen/ForgingScreenHandler;addPlayerInventorySlots(Lnet/minecraft/entity/player/PlayerInventory;)Vintermediary method_48353Lnet/minecraft/class_4861;method_48353(Lnet/minecraft/class_1661;)Vofficial aLcqx;a(Lcmw;)V
-
updateResult
public abstract void updateResult()- Mappings:
Namespace Name Mixin selector named updateResultLnet/minecraft/screen/ForgingScreenHandler;updateResult()Vintermediary method_24928Lnet/minecraft/class_4861;method_24928()Vofficial mLcqx;m()V
-
getForgingSlotsManager
- Mappings:
Namespace Name Mixin selector named getForgingSlotsManagerLnet/minecraft/screen/ForgingScreenHandler;getForgingSlotsManager()Lnet/minecraft/screen/slot/ForgingSlotsManager;intermediary method_48352Lnet/minecraft/class_4861;method_48352()Lnet/minecraft/class_8047;official lLcqx;l()Lcqy;
-
createInputInventory
- Mappings:
Namespace Name Mixin selector named createInputInventoryLnet/minecraft/screen/ForgingScreenHandler;createInputInventory(I)Lnet/minecraft/inventory/SimpleInventory;intermediary method_48358Lnet/minecraft/class_4861;method_48358(I)Lnet/minecraft/class_1277;official eLcqx;e(I)Lbra;
-
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
InventorywhosemarkDirtymethod 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:
onContentChangedin classScreenHandler- Mappings:
Namespace Name Mixin selector named onContentChangedLnet/minecraft/screen/ScreenHandler;onContentChanged(Lnet/minecraft/inventory/Inventory;)Vintermediary method_7609Lnet/minecraft/class_1703;method_7609(Lnet/minecraft/class_1263;)Vofficial aLcpu;a(Lbqk;)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:
onClosedin classScreenHandler- Mappings:
Namespace Name Mixin selector named onClosedLnet/minecraft/screen/ScreenHandler;onClosed(Lnet/minecraft/entity/player/PlayerEntity;)Vintermediary method_7595Lnet/minecraft/class_1703;method_7595(Lnet/minecraft/class_1657;)Vofficial aLcpu;a(Lcmx;)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:
canUsein classScreenHandler- Returns:
- whether the screen handler can be used
- Mappings:
Namespace Name Mixin selector named canUseLnet/minecraft/screen/ScreenHandler;canUse(Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_7597Lnet/minecraft/class_1703;method_7597(Lnet/minecraft/class_1657;)Zofficial bLcpu;b(Lcmx;)Z
-
quickMove
Quick-moves the stack atslotto 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:
quickMovein classScreenHandler- Parameters:
slot- the index of the slot to quick-move from- Returns:
ItemStack.EMPTYwhen no stack can be transferred, otherwise the original stack- See Also:
- Mappings:
Namespace Name Mixin selector named quickMoveLnet/minecraft/screen/ScreenHandler;quickMove(Lnet/minecraft/entity/player/PlayerEntity;I)Lnet/minecraft/item/ItemStack;intermediary method_7601Lnet/minecraft/class_1703;method_7601(Lnet/minecraft/class_1657;I)Lnet/minecraft/class_1799;official bLcpu;b(Lcmx;I)Lcuq;
-
isValidIngredient
- Mappings:
Namespace Name Mixin selector named isValidIngredientLnet/minecraft/screen/ForgingScreenHandler;isValidIngredient(Lnet/minecraft/item/ItemStack;)Zintermediary method_48356Lnet/minecraft/class_4861;method_48356(Lnet/minecraft/class_1799;)Zofficial cLcqx;c(Lcuq;)Z
-
getSlotFor
- Mappings:
Namespace Name Mixin selector named getSlotForLnet/minecraft/screen/ForgingScreenHandler;getSlotFor(Lnet/minecraft/item/ItemStack;)Iintermediary method_48357Lnet/minecraft/class_4861;method_48357(Lnet/minecraft/class_1799;)Iofficial dLcqx;d(Lcuq;)I
-
getResultSlotIndex
public int getResultSlotIndex()- Mappings:
Namespace Name Mixin selector named getResultSlotIndexLnet/minecraft/screen/ForgingScreenHandler;getResultSlotIndex()Iintermediary method_48360Lnet/minecraft/class_4861;method_48360()Iofficial oLcqx;o()I
-
getPlayerInventoryStartIndex
private int getPlayerInventoryStartIndex()- Mappings:
Namespace Name Mixin selector named getPlayerInventoryStartIndexLnet/minecraft/screen/ForgingScreenHandler;getPlayerInventoryStartIndex()Iintermediary method_48359Lnet/minecraft/class_4861;method_48359()Iofficial nLcqx;n()I
-
getPlayerInventoryEndIndex
private int getPlayerInventoryEndIndex()- Mappings:
Namespace Name Mixin selector named getPlayerInventoryEndIndexLnet/minecraft/screen/ForgingScreenHandler;getPlayerInventoryEndIndex()Iintermediary method_48361Lnet/minecraft/class_4861;method_48361()Iofficial pLcqx;p()I
-
getPlayerHotbarStartIndex
private int getPlayerHotbarStartIndex()- Mappings:
Namespace Name Mixin selector named getPlayerHotbarStartIndexLnet/minecraft/screen/ForgingScreenHandler;getPlayerHotbarStartIndex()Iintermediary method_48362Lnet/minecraft/class_4861;method_48362()Iofficial qLcqx;q()I
-
getPlayerHotbarEndIndex
private int getPlayerHotbarEndIndex()- Mappings:
Namespace Name Mixin selector named getPlayerHotbarEndIndexLnet/minecraft/screen/ForgingScreenHandler;getPlayerHotbarEndIndex()Iintermediary method_48363Lnet/minecraft/class_4861;method_48363()Iofficial rLcqx;r()I
-