Class ForgingScreenHandler
- Direct Known Subclasses:
AnvilScreenHandler,SmithingScreenHandler
- Mappings:
Namespace Name official bxmintermediary net/minecraft/class_4861named net/minecraft/screen/ForgingScreenHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ScreenHandlerContextprivate static final intprivate static final intstatic final intprotected final Inventoryprotected final CraftingResultInventorystatic final intprotected final PlayerEntityprivate static final intprivate static final intstatic 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 TypeMethodDescriptionprotected abstract booleancanTakeOutput(PlayerEntity player, boolean present) protected abstract booleancanUse(BlockState state) booleancanUse(PlayerEntity player) Returns whether the screen handler can be used.voidclose(PlayerEntity player) Closes this screen handler.protected booleanisUsableAsAddition(ItemStack stack) voidonContentChanged(Inventory inventory) Called when a slot's content has changed.protected abstract voidonTakeOutput(PlayerEntity player, ItemStack stack) transferSlot(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindexto other slots of the screen handler that belong to a different 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
-
FIRST_INPUT_SLOT_INDEX
public static final int FIRST_INPUT_SLOT_INDEX- See Also:
- Mappings:
Namespace Name Mixin selector official lLbxm;l:Iintermediary field_30814Lnet/minecraft/class_4861;field_30814:Inamed FIRST_INPUT_SLOT_INDEXLnet/minecraft/screen/ForgingScreenHandler;FIRST_INPUT_SLOT_INDEX:I
-
SECOND_INPUT_SLOT_INDEX
public static final int SECOND_INPUT_SLOT_INDEX- See Also:
- Mappings:
Namespace Name Mixin selector official mLbxm;m:Iintermediary field_30815Lnet/minecraft/class_4861;field_30815:Inamed SECOND_INPUT_SLOT_INDEXLnet/minecraft/screen/ForgingScreenHandler;SECOND_INPUT_SLOT_INDEX:I
-
OUTPUT_SLOT_INDEX
public static final int OUTPUT_SLOT_INDEX- See Also:
- Mappings:
Namespace Name Mixin selector official nLbxm;n:Iintermediary field_30816Lnet/minecraft/class_4861;field_30816:Inamed OUTPUT_SLOT_INDEXLnet/minecraft/screen/ForgingScreenHandler;OUTPUT_SLOT_INDEX:I
-
PLAYER_INVENTORY_START_INDEX
private static final int PLAYER_INVENTORY_START_INDEX- See Also:
- Mappings:
Namespace Name Mixin selector official kLbxm;k:Iintermediary field_30813Lnet/minecraft/class_4861;field_30813:Inamed PLAYER_INVENTORY_START_INDEXLnet/minecraft/screen/ForgingScreenHandler;PLAYER_INVENTORY_START_INDEX:I
-
field_30817
private static final int field_30817- See Also:
- Mappings:
Namespace Name Mixin selector official sLbxm;s:Iintermediary field_30817Lnet/minecraft/class_4861;field_30817:Inamed field_30817Lnet/minecraft/screen/ForgingScreenHandler;field_30817:I
-
field_30818
private static final int field_30818- See Also:
- Mappings:
Namespace Name Mixin selector official tLbxm;t:Iintermediary field_30818Lnet/minecraft/class_4861;field_30818:Inamed field_30818Lnet/minecraft/screen/ForgingScreenHandler;field_30818:I
-
PLAYER_INVENTORY_END_INDEX
private static final int PLAYER_INVENTORY_END_INDEX- See Also:
- Mappings:
Namespace Name Mixin selector official uLbxm;u:Iintermediary field_30819Lnet/minecraft/class_4861;field_30819:Inamed PLAYER_INVENTORY_END_INDEXLnet/minecraft/screen/ForgingScreenHandler;PLAYER_INVENTORY_END_INDEX:I
-
output
- Mappings:
Namespace Name Mixin selector official oLbxm;o:Lbxy;intermediary field_22479Lnet/minecraft/class_4861;field_22479:Lnet/minecraft/class_1731;named outputLnet/minecraft/screen/ForgingScreenHandler;output:Lnet/minecraft/inventory/CraftingResultInventory;
-
input
- Mappings:
Namespace Name Mixin selector official pLbxm;p:Lbac;intermediary field_22480Lnet/minecraft/class_4861;field_22480:Lnet/minecraft/class_1263;named inputLnet/minecraft/screen/ForgingScreenHandler;input:Lnet/minecraft/inventory/Inventory;
-
context
- Mappings:
Namespace Name Mixin selector official qLbxm;q:Lbwx;intermediary field_22481Lnet/minecraft/class_4861;field_22481:Lnet/minecraft/class_3914;named contextLnet/minecraft/screen/ForgingScreenHandler;context:Lnet/minecraft/screen/ScreenHandlerContext;
-
player
- Mappings:
Namespace Name Mixin selector official rLbxm;r:Lbuc;intermediary field_22482Lnet/minecraft/class_4861;field_22482:Lnet/minecraft/class_1657;named playerLnet/minecraft/screen/ForgingScreenHandler;player:Lnet/minecraft/entity/player/PlayerEntity;
-
-
Constructor Details
-
ForgingScreenHandler
public ForgingScreenHandler(@Nullable @Nullable ScreenHandlerType<?> type, int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) - Mappings:
Namespace Name Mixin selector official <init>Lbxm;<init>(Lbxq;ILbub;Lbwx;)Vintermediary <init>Lnet/minecraft/class_4861;<init>(Lnet/minecraft/class_3917;ILnet/minecraft/class_1661;Lnet/minecraft/class_3914;)Vnamed <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 aLbxm;a(Lbuc;Z)Zintermediary method_24927Lnet/minecraft/class_4861;method_24927(Lnet/minecraft/class_1657;Z)Znamed canTakeOutputLnet/minecraft/screen/ForgingScreenHandler;canTakeOutput(Lnet/minecraft/entity/player/PlayerEntity;Z)Z
-
onTakeOutput
- Mappings:
Namespace Name Mixin selector official aLbxm;a(Lbuc;Lcax;)Vintermediary method_24923Lnet/minecraft/class_4861;method_24923(Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)Vnamed onTakeOutputLnet/minecraft/screen/ForgingScreenHandler;onTakeOutput(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)V
-
canUse
- Mappings:
Namespace Name Mixin selector official aLbxm;a(Lcvo;)Zintermediary method_24925Lnet/minecraft/class_4861;method_24925(Lnet/minecraft/class_2680;)Znamed canUseLnet/minecraft/screen/ForgingScreenHandler;canUse(Lnet/minecraft/block/BlockState;)Z
-
updateResult
public abstract void updateResult()- Mappings:
Namespace Name Mixin selector official lLbxm;l()Vintermediary method_24928Lnet/minecraft/class_4861;method_24928()Vnamed updateResultLnet/minecraft/screen/ForgingScreenHandler;updateResult()V
-
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 official aLbwm;a(Lbac;)Vintermediary method_7609Lnet/minecraft/class_1703;method_7609(Lnet/minecraft/class_1263;)Vnamed onContentChangedLnet/minecraft/screen/ScreenHandler;onContentChanged(Lnet/minecraft/inventory/Inventory;)V
-
close
Closes this screen handler.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:
closein classScreenHandler- Mappings:
Namespace Name Mixin selector official bLbwm;b(Lbuc;)Vintermediary method_7595Lnet/minecraft/class_1703;method_7595(Lnet/minecraft/class_1657;)Vnamed closeLnet/minecraft/screen/ScreenHandler;close(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:
canUsein classScreenHandler- Returns:
- whether the screen handler can be used
- Mappings:
Namespace Name Mixin selector official aLbwm;a(Lbuc;)Zintermediary method_7597Lnet/minecraft/class_1703;method_7597(Lnet/minecraft/class_1657;)Znamed canUseLnet/minecraft/screen/ScreenHandler;canUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
isUsableAsAddition
- Mappings:
Namespace Name Mixin selector official cLbxm;c(Lcax;)Zintermediary method_30025Lnet/minecraft/class_4861;method_30025(Lnet/minecraft/class_1799;)Znamed isUsableAsAdditionLnet/minecraft/screen/ForgingScreenHandler;isUsableAsAddition(Lnet/minecraft/item/ItemStack;)Z
-
transferSlot
Transfers (or "quick-moves") the stack at slotindexto other slots of the screen handler that belong to a different inventory.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.- Specified by:
transferSlotin classScreenHandler- Returns:
ItemStack.EMPTYwhen no stack can be transferred, otherwise the original stack- See Also:
- Mappings:
Namespace Name Mixin selector official aLbwm;a(Lbuc;I)Lcax;intermediary method_7601Lnet/minecraft/class_1703;method_7601(Lnet/minecraft/class_1657;I)Lnet/minecraft/class_1799;named transferSlotLnet/minecraft/screen/ScreenHandler;transferSlot(Lnet/minecraft/entity/player/PlayerEntity;I)Lnet/minecraft/item/ItemStack;
-