Class ChestMock

All Implemented Interfaces:
com.destroystokyo.paper.loottable.LootableBlockInventory, com.destroystokyo.paper.loottable.LootableInventory, io.papermc.paper.block.LockableTileState, org.bukkit.block.BlockState, org.bukkit.block.Chest, org.bukkit.block.Container, org.bukkit.block.Lidded, org.bukkit.block.Lockable, org.bukkit.block.TileState, org.bukkit.inventory.BlockInventoryHolder, org.bukkit.inventory.InventoryHolder, org.bukkit.loot.Lootable, org.bukkit.metadata.Metadatable, org.bukkit.Nameable, org.bukkit.persistence.PersistentDataHolder

public class ChestMock extends ContainerMock implements org.bukkit.block.Chest
Mock implementation of a Chest.
See Also:
  • Constructor Details

    • ChestMock

      public ChestMock(@NotNull @NotNull org.bukkit.Material material)
      Constructs a new ChestMock for the provided Material. Only supports Material.CHEST and Material.TRAPPED_CHEST.
      Parameters:
      material - The material this state is for.
    • ChestMock

      protected ChestMock(@NotNull @NotNull org.bukkit.block.Block block)
      Constructs a new ChestMock for the provided Block. Only supports Material.CHEST and Material.TRAPPED_CHEST.
      Parameters:
      block - The block this state is for.
    • ChestMock

      protected ChestMock(@NotNull @NotNull ChestMock state)
      Constructs a new ChestMock by cloning the data from an existing one.
      Parameters:
      state - The state to clone.
  • Method Details

    • setLootTable

      public void setLootTable(org.bukkit.loot.LootTable table)
      Specified by:
      setLootTable in interface org.bukkit.loot.Lootable
    • getLootTable

      public org.bukkit.loot.LootTable getLootTable()
      Specified by:
      getLootTable in interface org.bukkit.loot.Lootable
    • setLootTable

      public void setLootTable(@Nullable @Nullable org.bukkit.loot.LootTable lootTable, long l)
      Specified by:
      setLootTable in interface org.bukkit.loot.Lootable
    • setSeed

      public void setSeed(long seed)
      Specified by:
      setSeed in interface org.bukkit.loot.Lootable
    • getSeed

      public long getSeed()
      Specified by:
      getSeed in interface org.bukkit.loot.Lootable
    • open

      public void open()
      Specified by:
      open in interface org.bukkit.block.Lidded
    • close

      public void close()
      Specified by:
      close in interface org.bukkit.block.Lidded
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface org.bukkit.block.Lidded
    • getBlockInventory

      @NotNull public @NotNull org.bukkit.inventory.Inventory getBlockInventory()
      Specified by:
      getBlockInventory in interface org.bukkit.block.Chest
    • isBlocked

      public boolean isBlocked()
      Specified by:
      isBlocked in interface org.bukkit.block.Chest
    • createInventory

      @NotNull protected @NotNull InventoryMock createInventory()
      Specified by:
      createInventory in class ContainerMock
      Returns:
      A new inventory, of the correct type for the state.
    • getSnapshot

      @NotNull public @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 ContainerMock
      Returns:
      A snapshot of this BlockStateMock.
    • isRefillEnabled

      public boolean isRefillEnabled()
      Specified by:
      isRefillEnabled in interface com.destroystokyo.paper.loottable.LootableInventory
    • hasBeenFilled

      public boolean hasBeenFilled()
      Specified by:
      hasBeenFilled in interface com.destroystokyo.paper.loottable.LootableInventory
    • canPlayerLoot

      public boolean canPlayerLoot(@NotNull @NotNull UUID player)
      Specified by:
      canPlayerLoot in interface com.destroystokyo.paper.loottable.LootableInventory
    • hasPlayerLooted

      public boolean hasPlayerLooted(@NotNull @NotNull UUID player)
      Specified by:
      hasPlayerLooted in interface com.destroystokyo.paper.loottable.LootableInventory
    • getLastLooted

      @Nullable public @Nullable Long getLastLooted(@NotNull @NotNull UUID player)
      Specified by:
      getLastLooted in interface com.destroystokyo.paper.loottable.LootableInventory
    • setHasPlayerLooted

      public boolean setHasPlayerLooted(@NotNull @NotNull UUID player, boolean looted)
      Specified by:
      setHasPlayerLooted in interface com.destroystokyo.paper.loottable.LootableInventory
    • hasPendingRefill

      public boolean hasPendingRefill()
      Specified by:
      hasPendingRefill in interface com.destroystokyo.paper.loottable.LootableInventory
    • getLastFilled

      public long getLastFilled()
      Specified by:
      getLastFilled in interface com.destroystokyo.paper.loottable.LootableInventory
    • getNextRefill

      public long getNextRefill()
      Specified by:
      getNextRefill in interface com.destroystokyo.paper.loottable.LootableInventory
    • setNextRefill

      public long setNextRefill(long refillAt)
      Specified by:
      setNextRefill in interface com.destroystokyo.paper.loottable.LootableInventory