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, repairItemCountCost

    Fields inherited from class net.minecraft.world.inventory.ItemCombinerMenu

    access, ADDITIONAL_SLOT, INPUT_SLOT, inputSlots, RESULT_SLOT, resultSlots

    Fields 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

    Constructors
    Constructor
    Description
    AnvilInventoryImpl(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 Type
    Method
    Description
    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.
    void
    Called when both items in the ItemCombinerMenu.inputSlots were set to create the resulting product, calculate the level cost and call the PrepareAnvilEvent.
    @NotNull org.bukkit.inventory.Inventory
     
    org.bukkit.craftbukkit.v1_18_R2.inventory.CraftInventoryView
     
     
    boolean
     
    void
     
    void
    removed(net.minecraft.world.entity.player.Player player)
    Called when the container is closed to give the items back.
    void
    sendItem(int slot)
     
    void
    setItem(int slot, net.minecraft.world.item.ItemStack item)
     
    void
    setItem(int slot, org.bukkit.inventory.ItemStack itemStack)
     
    void
    Called when the rename text gets changed.
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
    Called every tick to see if the Player can still use that container.

    Methods inherited from class net.minecraft.world.inventory.AnvilMenu

    calculateIncreasedRepairCost, getCost, isValidBlock, mayPickup, onTake

    Methods inherited from class net.minecraft.world.inventory.ItemCombinerMenu

    quickMoveStack, shouldQuickMoveToAdditionalSlot, slotsChanged

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AnvilInventoryImpl

      public AnvilInventoryImpl(org.bukkit.entity.Player player, @NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent[] title, Consumer<String> renameHandler)
    • AnvilInventoryImpl

      public AnvilInventoryImpl(net.minecraft.server.level.ServerPlayer player, net.minecraft.network.chat.Component title, Consumer<String> renameHandler)
  • Method Details

    • open

      public void open()
      Specified by:
      open in interface de.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:
      setItem in interface de.studiocode.inventoryaccess.abstraction.inventory.AnvilInventory
    • getBukkitInventory

      @NotNull public @NotNull org.bukkit.inventory.Inventory getBukkitInventory()
      Specified by:
      getBukkitInventory in interface de.studiocode.inventoryaccess.abstraction.inventory.AnvilInventory
    • getRenameText

      public String getRenameText()
      Specified by:
      getRenameText in interface de.studiocode.inventoryaccess.abstraction.inventory.AnvilInventory
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface de.studiocode.inventoryaccess.abstraction.inventory.AnvilInventory
    • getBukkitView

      public org.bukkit.craftbukkit.v1_18_R2.inventory.CraftInventoryView getBukkitView()
      Overrides:
      getBukkitView in class net.minecraft.world.inventory.AnvilMenu
    • stillValid

      public boolean stillValid(net.minecraft.world.entity.player.Player player)
      Called every tick to see if the Player can still use that container. (Used to for checking the distance between the Player and the container and closing the window when the distance gets too big.)
      Overrides:
      stillValid in class net.minecraft.world.inventory.ItemCombinerMenu
      Parameters:
      player - The Player
      Returns:
      If the Player can still use that container
    • setItemName

      public void setItemName(String s)
      Called when the rename text gets changed.
      Overrides:
      setItemName in class net.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:
      removed in class net.minecraft.world.inventory.ItemCombinerMenu
      Parameters:
      player - The Player that 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:
      clearContainer in class net.minecraft.world.inventory.AbstractContainerMenu
      Parameters:
      player - The Player that closed this container
      container - The container
    • createResult

      public void createResult()
      Called when both items in the ItemCombinerMenu.inputSlots were set to create the resulting product, calculate the level cost and call the PrepareAnvilEvent.
      Overrides:
      createResult in class net.minecraft.world.inventory.AnvilMenu