Class AnvilInventoryImpl
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
net.minecraft.world.inventory.ItemCombinerMenu
net.minecraft.world.inventory.AnvilMenu
de.studiocode.inventoryaccess.r9.inventory.AnvilInventoryImpl
- All Implemented Interfaces:
de.studiocode.inventoryaccess.abstraction.inventory.AnvilInventory
public class AnvilInventoryImpl
extends net.minecraft.world.inventory.AnvilMenu
implements de.studiocode.inventoryaccess.abstraction.inventory.AnvilInventory
-
Field Summary
Fields inherited from class net.minecraft.world.inventory.AnvilMenu
cost, DEFAULT_DENIED_COST, itemName, MAX_NAME_LENGTH, maximumRepairCost, repairItemCountCostFields inherited from class net.minecraft.world.inventory.ItemCombinerMenu
access, ADDITIONAL_SLOT, INPUT_SLOT, inputSlots, RESULT_SLOT, resultSlotsFields inherited from class net.minecraft.world.inventory.AbstractContainerMenu
CARRIED_SLOT_SIZE, checkReachable, containerId, lastSlots, QUICKCRAFT_HEADER_CONTINUE, QUICKCRAFT_HEADER_END, QUICKCRAFT_HEADER_START, QUICKCRAFT_TYPE_CHARITABLE, QUICKCRAFT_TYPE_CLONE, QUICKCRAFT_TYPE_GREEDY, remoteSlots, SLOT_CLICKED_OUTSIDE, slots -
Constructor Summary
ConstructorsConstructorDescriptionAnvilInventoryImpl(net.minecraft.server.level.ServerPlayer player, net.minecraft.network.chat.Component title, Consumer<String> renameHandler) AnvilInventoryImpl(org.bukkit.entity.Player player, @NotNull net.md_5.bungee.api.chat.BaseComponent[] title, Consumer<String> renameHandler) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclearContainer(net.minecraft.world.entity.player.Player player, net.minecraft.world.Container container) Called when the container gets closed to put items back into a players inventory or drop them in the world.voidCalled when both items in theItemCombinerMenu.inputSlotswere set to create the resulting product, calculate the level cost and call thePrepareAnvilEvent.@NotNull org.bukkit.inventory.Inventoryorg.bukkit.craftbukkit.v1_18_R2.inventory.CraftInventoryViewbooleanisOpen()voidopen()voidremoved(net.minecraft.world.entity.player.Player player) Called when the container is closed to give the items back.voidsendItem(int slot) voidsetItem(int slot, net.minecraft.world.item.ItemStack item) voidsetItem(int slot, org.bukkit.inventory.ItemStack itemStack) voidCalled when the rename text gets changed.booleanstillValid(net.minecraft.world.entity.player.Player player) Called every tick to see if thePlayercan still use that container.Methods inherited from class net.minecraft.world.inventory.AnvilMenu
calculateIncreasedRepairCost, getCost, isValidBlock, mayPickup, onTakeMethods inherited from class net.minecraft.world.inventory.ItemCombinerMenu
quickMoveStack, shouldQuickMoveToAdditionalSlot, slotsChangedMethods inherited from class net.minecraft.world.inventory.AbstractContainerMenu
addDataSlot, addDataSlots, addSlot, addSlotListener, broadcastCarriedItem, broadcastChanges, broadcastFullState, canDragTo, canItemQuickReplace, canTakeItemForPickAll, checkContainerDataCount, checkContainerSize, clicked, clickMenuButton, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftSlotCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getTitle, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, moveItemStackTo, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, setTitle, stillValid, suppressRemoteUpdates, transferState, transferTo
-
Constructor Details
-
AnvilInventoryImpl
-
AnvilInventoryImpl
-
-
Method Details
-
open
public void open()- Specified by:
openin interfacede.studiocode.inventoryaccess.abstraction.inventory.AnvilInventory
-
sendItem
public void sendItem(int slot) -
setItem
public void setItem(int slot, net.minecraft.world.item.ItemStack item) -
setItem
public void setItem(int slot, org.bukkit.inventory.ItemStack itemStack) - Specified by:
setItemin interfacede.studiocode.inventoryaccess.abstraction.inventory.AnvilInventory
-
getBukkitInventory
@NotNull public @NotNull org.bukkit.inventory.Inventory getBukkitInventory()- Specified by:
getBukkitInventoryin interfacede.studiocode.inventoryaccess.abstraction.inventory.AnvilInventory
-
getRenameText
- Specified by:
getRenameTextin interfacede.studiocode.inventoryaccess.abstraction.inventory.AnvilInventory
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfacede.studiocode.inventoryaccess.abstraction.inventory.AnvilInventory
-
getBukkitView
public org.bukkit.craftbukkit.v1_18_R2.inventory.CraftInventoryView getBukkitView()- Overrides:
getBukkitViewin classnet.minecraft.world.inventory.AnvilMenu
-
stillValid
public boolean stillValid(net.minecraft.world.entity.player.Player player) Called every tick to see if thePlayercan still use that container. (Used to for checking the distance between thePlayerand the container and closing the window when the distance gets too big.)- Overrides:
stillValidin classnet.minecraft.world.inventory.ItemCombinerMenu- Parameters:
player- ThePlayer- Returns:
- If the
Playercan still use that container
-
setItemName
Called when the rename text gets changed.- Overrides:
setItemNamein classnet.minecraft.world.inventory.AnvilMenu- Parameters:
s- The new rename text
-
removed
public void removed(net.minecraft.world.entity.player.Player player) Called when the container is closed to give the items back.- Overrides:
removedin classnet.minecraft.world.inventory.ItemCombinerMenu- Parameters:
player- ThePlayerthat closed this container
-
clearContainer
protected void clearContainer(net.minecraft.world.entity.player.Player player, net.minecraft.world.Container container) Called when the container gets closed to put items back into a players inventory or drop them in the world.- Overrides:
clearContainerin classnet.minecraft.world.inventory.AbstractContainerMenu- Parameters:
player- ThePlayerthat closed this containercontainer- The container
-
createResult
public void createResult()Called when both items in theItemCombinerMenu.inputSlotswere set to create the resulting product, calculate the level cost and call thePrepareAnvilEvent.- Overrides:
createResultin classnet.minecraft.world.inventory.AnvilMenu
-