Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5047

JavaDocs for InventoryType are incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • CraftBukkit version git-Spigot-df0eb25-649921e (MC: 1.14.2) (Implementing API version 1.14.2-R0.1-SNAPSHOT)
    • Yes

      According to the JavaDocs for InventoryType https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryType.html

      the various types have different SlotTypes, but in many cases the new 1.14 blocks are wrong. Also, the non-existent slot type INPUT is mentioned:

       

      Enum Constant Description Actual Comment
      ANVIL An anvil inventory, with 2 CRAFTING slots and 1 RESULT slot Correct  
      BARREL A barrel box inventory, with 27 slots of type CONTAINER. Correct  
      BEACON A beacon inventory, with 1 CRAFTING slot Correct  
      BLAST_FURNACE A blast furnace inventory, with a RESULT slot, a CRAFTING slot, and a FUEL slot. 3 x CONTAINER Furnace is correct, but Blast Furnace isn't.
      BREWING A brewing stand inventory, with one FUEL slot and three CRAFTING slots. FUEL, 4 x CONTAINER  
      CARTOGRAPHY Cartography inventory with 2 INPUT slots, and 1 RESULT slot. 3 x CONTAINER Actually, there is no INPUT slot type enum.
      CHEST A chest inventory, with 0, 9, 18, 27, 36, 45, or 54 slots of type CONTAINER. Correct  
      CRAFTING A player's crafting inventory, with 4 CRAFTING slots and a RESULT slot. Correct  
      CREATIVE The creative mode inventory, with only 9 QUICKBAR slots and nothing else. Correct  
      DISPENSER A dispenser inventory, with 9 slots of type CONTAINER. Correct  
      DROPPER A dropper inventory, with 9 slots of type CONTAINER. Correct  
      ENCHANTING An enchantment table inventory, with two CRAFTING slots and three enchanting buttons. Correct  
      ENDER_CHEST The ender chest inventory, with 27 slots. Correct  
      FURNACE A furnace inventory, with a RESULT slot, a CRAFTING slot, and a FUEL slot. Correct  
      GRINDSTONE Grindstone inventory with 2 INPUT slots, and 1 RESULT slot. 2 x CONTAINER Actually there are 3 slots. Result slot is missing from the TopInventory. There is no INPUT slot type.
      HOPPER A hopper inventory, with 5 slots of type CONTAINER. correct  
      LECTERN A lectern inventory, with 1 BOOK slot. ? No InventoryClickEvent
      LOOM Loom inventory, with 3 INPUT slots, and 1 RESULT slot. 3 x CONTAINER 4th result slot is missing from TopInventory. There is no INPUT slot type.
      MERCHANT The merchant inventory, with 2 TRADE-IN slots, and 1 RESULT slot. 2 x CRAFTING, 1 x RESULT There is no TRADE-IN slot type enum.
      PLAYER A player's inventory, with 9 QUICKBAR slots, 27 CONTAINER slots, 4 ARMOR slots and 1 offhand slot. Correct  
      SHULKER_BOX A shulker box inventory, with 27 slots of type CONTAINER. correct  
      SMOKER A smoker inventory, with a RESULT slot, a CRAFTING slot, and a FUEL slot. 3 x CONTAINER  
      STONECUTTER Stonecutter inventory with 1 INPUT slot, and 1 RESULT slot. 1 x CONTAINER There is no INPUT slot type. The RESULT slot is missing.
      WORKBENCH A workbench inventory, with 9 CRAFTING slots and a RESULT slot. Correct  

       

      Some of these differences look like potential bugs. The reason I was using this API was that I was trying to find out if an inventory had a RESULT slot or not and then do something with it, but I found that a lot of the newer blocks just have CONTAINER, or in some cases, the result slot is not actually there.

       

            Unassigned Unassigned
            tastybento tastybento
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: