Class ContainerMock

All Implemented Interfaces:
org.bukkit.block.BlockState, org.bukkit.block.Container, org.bukkit.block.Lockable, org.bukkit.block.TileState, org.bukkit.inventory.BlockInventoryHolder, org.bukkit.inventory.InventoryHolder, org.bukkit.metadata.Metadatable, org.bukkit.Nameable, org.bukkit.persistence.PersistentDataHolder
Direct Known Subclasses:
AbstractFurnaceMock, BarrelMock, BrewingStandMock, ChestMock, DispenserMock, DropperMock, HopperMock, LecternMock, ShulkerBoxMock

public abstract class ContainerMock extends TileStateMock implements org.bukkit.block.Container
The ContainerMock is an extension of a TileStateMock which can also hold an Inventory.
  • Constructor Details

    • ContainerMock

      protected ContainerMock(@NotNull @NotNull org.bukkit.Material material)
    • ContainerMock

      protected ContainerMock(@NotNull @NotNull org.bukkit.block.Block block)
    • ContainerMock

      protected ContainerMock(@NotNull @NotNull ContainerMock state)
  • Method Details

    • createInventory

      protected abstract InventoryMock createInventory()
    • getSnapshot

      @NotNull public abstract @NotNull org.bukkit.block.BlockState getSnapshot()
      Description copied from class: BlockStateMock
      This returns a copy of this BlockStateMock. Inheritents of this class should override this method!
      Specified by:
      getSnapshot in class TileStateMock
      Returns:
      A snapshot of this BlockStateMock.
    • isLocked

      public boolean isLocked()
      Specified by:
      isLocked in interface org.bukkit.block.Lockable
    • getLock

      @NotNull public @NotNull String getLock()
      Specified by:
      getLock in interface org.bukkit.block.Lockable
    • setLock

      public void setLock(@Nullable @Nullable String key)
      Specified by:
      setLock in interface org.bukkit.block.Lockable
    • customName

      @Nullable public @Nullable net.kyori.adventure.text.Component customName()
      Specified by:
      customName in interface org.bukkit.Nameable
    • customName

      public void customName(@Nullable @Nullable net.kyori.adventure.text.Component customName)
      Specified by:
      customName in interface org.bukkit.Nameable
    • getCustomName

      @Nullable public @Nullable String getCustomName()
      Specified by:
      getCustomName in interface org.bukkit.Nameable
    • setCustomName

      public void setCustomName(@Nullable @Nullable String name)
      Specified by:
      setCustomName in interface org.bukkit.Nameable
    • getInventory

      @NotNull public @NotNull org.bukkit.inventory.Inventory getInventory()
      Specified by:
      getInventory in interface org.bukkit.block.Container
      Specified by:
      getInventory in interface org.bukkit.inventory.InventoryHolder
    • getSnapshotInventory

      @NotNull public @NotNull org.bukkit.inventory.Inventory getSnapshotInventory()
      Specified by:
      getSnapshotInventory in interface org.bukkit.block.Container