程序包 org.bukkit.event.inventory

# 枚举 InventoryType

java.lang.Object
java.lang.Enum<InventoryType>
org.bukkit.event.inventory.InventoryType

所有已实现的接口:
  `Serializable`, `Comparable<InventoryType>`, `Constable`

public enum InventoryType extends Enum<InventoryType>
Represents the different kinds of inventories available in Bukkit.
Only InventoryTypes marked `isCreatable()` can be created.
The current list of inventories that cannot be created via `Bukkit.createInventory(org.bukkit.inventory.InventoryHolder, org.bukkit.event.inventory.InventoryType)` are:

> `CREATIVE`, `CRAFTING` and `MERCHANT`

See `Bukkit.createInventory(org.bukkit.inventory.InventoryHolder, org.bukkit.event.inventory.InventoryType)` for more information.

另请参阅:
  - `Bukkit.createInventory(InventoryHolder, InventoryType)`

- ## 嵌套类概要

  嵌套类
  修饰符和类型
  类
  说明
  `static enum`
  `InventoryType.SlotType`

  ## 从类继承的嵌套类/接口 java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## 枚举常量概要

  枚举常量
  枚举常量
  说明
  `ANVIL`
  An anvil inventory, with 2 CRAFTING slots and 1 RESULT slot
  `BARREL`
  A barrel box inventory, with 27 slots of type CONTAINER.
  `BEACON`
  A beacon inventory, with 1 CRAFTING slot
  `BLAST_FURNACE`
  A blast furnace inventory, with a RESULT slot, a CRAFTING slot, and a FUEL slot.
  `BREWING`
  A brewing stand inventory, with one FUEL slot and four CRAFTING slots.
  `CARTOGRAPHY`
  Cartography inventory with 2 CRAFTING slots, and 1 RESULT slot.
  `CHEST`
  A chest inventory, with 0, 9, 18, 27, 36, 45, or 54 slots of type CONTAINER.
  `CHISELED_BOOKSHELF`
  Pseudo chiseled bookshelf inventory, with 6 slots of undefined type.
  `COMPOSTER`
  Pseudo composter inventory with 0 or 1 slots of undefined type.
  `CRAFTER`
  A crafter inventory, with 9 CRAFTING slots.
  `CRAFTING`
  A player's crafting inventory, with 4 CRAFTING slots and a RESULT slot.
  `CREATIVE`
  The creative mode inventory, with only 9 QUICKBAR slots and nothing else.
  `DISPENSER`
  A dispenser inventory, with 9 slots of type CONTAINER.
  `DROPPER`
  A dropper inventory, with 9 slots of type CONTAINER.
  `ENCHANTING`
  An enchantment table inventory, with two CRAFTING slots and three enchanting buttons.
  `ENDER_CHEST`
  The ender chest inventory, with 27 slots.
  `FURNACE`
  A furnace inventory, with a RESULT slot, a CRAFTING slot, and a FUEL slot.
  `GRINDSTONE`
  Grindstone inventory with 2 CRAFTING slots, and 1 RESULT slot.
  `HOPPER`
  A hopper inventory, with 5 slots of type CONTAINER.
  `JUKEBOX`
  Pseudo jukebox inventory with 1 slot of undefined type.
  `LECTERN`
  A lectern inventory, with 1 BOOK slot.
  `LOOM`
  Loom inventory, with 3 CRAFTING slots, and 1 RESULT slot.
  `MERCHANT`
  The merchant inventory, with 2 CRAFTING slots, and 1 RESULT slot.
  `PLAYER`
  A player's inventory, with 9 QUICKBAR slots, 27 CONTAINER slots, 4 ARMOR slots and 1 offhand slot.
  `SHULKER_BOX`
  A shulker box inventory, with 27 slots of type CONTAINER.
  `SMITHING`
  A smithing inventory, with 3 CRAFTING slots and 1 RESULT slot.
  `SMITHING_NEW`
  已过时。
  use `SMITHING`
  `SMOKER`
  A smoker inventory, with a RESULT slot, a CRAFTING slot, and a FUEL slot.
  `STONECUTTER`
  Stonecutter inventory with 1 CRAFTING slot, and 1 RESULT slot.
  `WORKBENCH`
  A workbench inventory, with 9 CRAFTING slots and a RESULT slot.

- ## 方法概要

  修饰符和类型
  方法
  说明
  `int`
  `getDefaultSize()`
  `@NotNull String`
  `getDefaultTitle()`
  `boolean`
  `isCreatable()`
  Denotes that this InventoryType can be created via the normal `Bukkit.createInventory(org.bukkit.inventory.InventoryHolder, org.bukkit.event.inventory.InventoryType)` methods.
  `static InventoryType`
  `valueOf(String name)`
  返回带有指定名称的该类型的枚举常量。
  `static InventoryType[]`
  `values()`
  按照声明该枚举类型的常量的顺序, 返回一个包含这些常量的数组。

  ### 从类继承的方法 java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### 从类继承的方法 java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## 枚举常量详细资料

  - ### CHEST

    public static final InventoryType CHEST
    A chest inventory, with 0, 9, 18, 27, 36, 45, or 54 slots of type CONTAINER.

  - ### DISPENSER

    public static final InventoryType DISPENSER
    A dispenser inventory, with 9 slots of type CONTAINER.

  - ### DROPPER

    public static final InventoryType DROPPER
    A dropper inventory, with 9 slots of type CONTAINER.

  - ### FURNACE

    public static final InventoryType FURNACE
    A furnace inventory, with a RESULT slot, a CRAFTING slot, and a FUEL slot.

  - ### WORKBENCH

    public static final InventoryType WORKBENCH
    A workbench inventory, with 9 CRAFTING slots and a RESULT slot.

  - ### CRAFTING

    public static final InventoryType CRAFTING
    A player's crafting inventory, with 4 CRAFTING slots and a RESULT slot. Also implies that the 4 ARMOR slots are accessible.

  - ### ENCHANTING

    public static final InventoryType ENCHANTING
    An enchantment table inventory, with two CRAFTING slots and three enchanting buttons.

  - ### BREWING

    public static final InventoryType BREWING
    A brewing stand inventory, with one FUEL slot and four CRAFTING slots.

  - ### PLAYER

    public static final InventoryType PLAYER
    A player's inventory, with 9 QUICKBAR slots, 27 CONTAINER slots, 4 ARMOR slots and 1 offhand slot. The ARMOR and offhand slots may not be visible to the player, though.

  - ### CREATIVE

    public static final InventoryType CREATIVE
    The creative mode inventory, with only 9 QUICKBAR slots and nothing else. (The actual creative interface with the items is client-side and cannot be altered by the server.)

  - ### MERCHANT

    public static final InventoryType MERCHANT
    The merchant inventory, with 2 CRAFTING slots, and 1 RESULT slot.

  - ### ENDER_CHEST

    public static final InventoryType ENDER_CHEST
    The ender chest inventory, with 27 slots.

  - ### ANVIL

    public static final InventoryType ANVIL
    An anvil inventory, with 2 CRAFTING slots and 1 RESULT slot

  - ### SMITHING

    public static final InventoryType SMITHING
    A smithing inventory, with 3 CRAFTING slots and 1 RESULT slot.

  - ### BEACON

    public static final InventoryType BEACON
    A beacon inventory, with 1 CRAFTING slot

  - ### HOPPER

    public static final InventoryType HOPPER
    A hopper inventory, with 5 slots of type CONTAINER.

  - ### SHULKER_BOX

    public static final InventoryType SHULKER_BOX
    A shulker box inventory, with 27 slots of type CONTAINER.

  - ### BARREL

    public static final InventoryType BARREL
    A barrel box inventory, with 27 slots of type CONTAINER.

  - ### BLAST_FURNACE

    public static final InventoryType BLAST_FURNACE
    A blast furnace inventory, with a RESULT slot, a CRAFTING slot, and a FUEL slot.

  - ### LECTERN

    public static final InventoryType LECTERN
    A lectern inventory, with 1 BOOK slot.

  - ### SMOKER

    public static final InventoryType SMOKER
    A smoker inventory, with a RESULT slot, a CRAFTING slot, and a FUEL slot.

  - ### LOOM

    public static final InventoryType LOOM
    Loom inventory, with 3 CRAFTING slots, and 1 RESULT slot.

  - ### CARTOGRAPHY

    public static final InventoryType CARTOGRAPHY
    Cartography inventory with 2 CRAFTING slots, and 1 RESULT slot.

  - ### GRINDSTONE

    public static final InventoryType GRINDSTONE
    Grindstone inventory with 2 CRAFTING slots, and 1 RESULT slot.

  - ### STONECUTTER

    public static final InventoryType STONECUTTER
    Stonecutter inventory with 1 CRAFTING slot, and 1 RESULT slot.

  - ### COMPOSTER

    public static final InventoryType COMPOSTER
    Pseudo composter inventory with 0 or 1 slots of undefined type.

  - ### CHISELED_BOOKSHELF

    public static final InventoryType CHISELED_BOOKSHELF
    Pseudo chiseled bookshelf inventory, with 6 slots of undefined type.

  - ### JUKEBOX

    public static final InventoryType JUKEBOX
    Pseudo jukebox inventory with 1 slot of undefined type.

  - ### CRAFTER

    @Experimental public static final InventoryType CRAFTER
    A crafter inventory, with 9 CRAFTING slots.

  - ### SMITHING_NEW

    @Deprecated public static final InventoryType SMITHING_NEW
    已过时。
    use `SMITHING`
    The new smithing inventory, with 3 CRAFTING slots and 1 RESULT slot.

- ## 方法详细资料

  - ### values

    public static InventoryType[] values()
    按照声明该枚举类型的常量的顺序, 返回一个包含这些常量的数组。
    返回:
      按照声明该枚举类型的常量的顺序返回的包含这些常量的数组

  - ### valueOf

    public static InventoryType valueOf(String name)
    返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
    参数:
      `name` - 要返回的枚举常量的名称。
    返回:
      返回带有指定名称的枚举常量
    抛出:
      `IllegalArgumentException` - 如果该枚举类型没有带有指定名称的常量
      `NullPointerException` - 如果参数为空值

  - ### getDefaultSize

    public int getDefaultSize()

  - ### getDefaultTitle

    @NotNull public @NotNull String getDefaultTitle()

  - ### isCreatable

    public boolean isCreatable()
    Denotes that this InventoryType can be created via the normal `Bukkit.createInventory(org.bukkit.inventory.InventoryHolder, org.bukkit.event.inventory.InventoryType)` methods.
    返回:
      if this InventoryType can be created and shown to a player