Class CommandBlockMock

All Implemented Interfaces:
CommandBlockHolderMock, io.papermc.paper.command.CommandBlockHolder, org.bukkit.block.BlockState, org.bukkit.block.CommandBlock, org.bukkit.block.TileState, org.bukkit.metadata.Metadatable, org.bukkit.persistence.PersistentDataHolder

public class CommandBlockMock extends TileStateMock implements org.bukkit.block.CommandBlock, CommandBlockHolderMock
Mock implementation of a CommandBlock.
See Also:
  • Constructor Details

    • CommandBlockMock

      public CommandBlockMock(@NotNull @NotNull org.bukkit.Material material)
      Constructs a new CommandBlockMock for the provided Material. Only supports Material.COMMAND_BLOCK, Material.REPEATING_COMMAND_BLOCK, and Material.CHAIN_COMMAND_BLOCK.
      Parameters:
      material - The material this state is for.
    • CommandBlockMock

      protected CommandBlockMock(@NotNull @NotNull org.bukkit.block.Block block)
      Constructs a new CommandBlockMock for the provided Block. Only supports Material.COMMAND_BLOCK, Material.REPEATING_COMMAND_BLOCK, and Material.CHAIN_COMMAND_BLOCK.
      Parameters:
      block - The block this state is for.
    • CommandBlockMock

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

    • getSnapshot

      @NotNull public @NotNull CommandBlockMock 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.
    • getCommand

      @NotNull public @NotNull String getCommand()
      Specified by:
      getCommand in interface org.bukkit.block.CommandBlock
      Specified by:
      getCommand in interface io.papermc.paper.command.CommandBlockHolder
    • setCommand

      public void setCommand(@Nullable @Nullable String command)
      Specified by:
      setCommand in interface org.bukkit.block.CommandBlock
      Specified by:
      setCommand in interface io.papermc.paper.command.CommandBlockHolder
    • getName

      @NotNull public @NotNull String getName()
      Specified by:
      getName in interface org.bukkit.block.CommandBlock
    • setName

      public void setName(@Nullable @Nullable String name)
      Specified by:
      setName in interface org.bukkit.block.CommandBlock
    • name

      @NotNull public @NotNull net.kyori.adventure.text.Component name()
      Specified by:
      name in interface org.bukkit.block.CommandBlock
    • name

      public void name(@Nullable @Nullable net.kyori.adventure.text.Component name)
      Specified by:
      name in interface org.bukkit.block.CommandBlock