Interface BlockSetter


public interface BlockSetter
Manages setting blocks.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static int
    When placing the block, apply physics.
    static int
    Takes rotation or direction of the block (depending on the block) and attempts to place other parts of it according to those.
    static int
    Attempts to automatically correct rotation and direction of the block when setting it.
    static int
    Changes type of the block if that is needed to get the correct rotation.
    static int
    Overrides rotation and direction that might have been specified in block values when ROTATE is also set.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    sendBlockChange​(org.bukkit.entity.Player player, org.bukkit.Location location, org.bukkit.Material type, @Nullable BlockValues values)
    Send a block change to a player.
    void
    setBlock​(org.bukkit.block.Block block, org.bukkit.Material type, @Nullable BlockValues values, int flags)
    Sets the given block.
  • Field Details

    • ROTATE

      static final int ROTATE
      Attempts to automatically correct rotation and direction of the block when setting it. Note that this will NOT overwrite any existing data supplied in block values.
      See Also:
      Constant Field Values
    • ROTATE_FORCE

      static final int ROTATE_FORCE
      Overrides rotation and direction that might have been specified in block values when ROTATE is also set.
      See Also:
      Constant Field Values
    • ROTATE_FIX_TYPE

      static final int ROTATE_FIX_TYPE
      Changes type of the block if that is needed to get the correct rotation.
      See Also:
      Constant Field Values
    • MULTIPART

      static final int MULTIPART
      Takes rotation or direction of the block (depending on the block) and attempts to place other parts of it according to those. For example, placing beds and doors should be simple enough with this flag.
      See Also:
      Constant Field Values
    • APPLY_PHYSICS

      static final int APPLY_PHYSICS
      When placing the block, apply physics.
      See Also:
      Constant Field Values
  • Method Details

    • setBlock

      void setBlock(org.bukkit.block.Block block, org.bukkit.Material type, @Nullable BlockValues values, int flags)
      Sets the given block.
      Parameters:
      block - Block to set.
      type - New type of the block.
      values - Additional block data, such as block states.
      flags - Flags for block setter.
    • sendBlockChange

      void sendBlockChange(org.bukkit.entity.Player player, org.bukkit.Location location, org.bukkit.Material type, @Nullable BlockValues values)
      Send a block change to a player.

      This will send a fake block change to the player, and will not change the block on the server.

      Parameters:
      player - Player to send change to
      location - Location of block to change
      type - Material of change
      values - Additional block data, such as block states.