Class StructureData

java.lang.Object
redempt.redlib.multiblock.StructureData

public class StructureData extends Object
Cross-version wrapper for block data - BlockData in 1.13+, MaterialData otherwise
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
     
    StructureData(org.bukkit.block.data.BlockData data)
    Creates a StructureData from a BlockData, for 1.13+
     
    StructureData(org.bukkit.Material type)
     
     
    StructureData(org.bukkit.Material type, byte data)
    Creates a StructureData from a Material and byte data, for 1.12 and below
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    compare(org.bukkit.block.Block block, boolean strict, boolean ignoreAir)
    Compares this StructureData to a Block
     
    org.bukkit.block.BlockState
    getState(org.bukkit.block.Block block)
    Gets the BlockState to set for a given block
    org.bukkit.Material
     
    boolean
     
    void
    sendBlock(org.bukkit.entity.Player player, org.bukkit.Location loc)
    Sends a fake block change to a Player
    void
    setBlock(org.bukkit.block.Block block)
    Sets this StructureData at the given location

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StructureData

      protected StructureData(String string)
    • StructureData

      public StructureData(org.bukkit.Material type)
    • StructureData

      public StructureData(org.bukkit.block.data.BlockData data)
      Creates a StructureData from a BlockData, for 1.13+
      Parameters:
      data - The BlockData
    • StructureData

      public StructureData(org.bukkit.Material type, byte data)
      Creates a StructureData from a Material and byte data, for 1.12 and below
      Parameters:
      type - The block type
      data - The data byte
  • Method Details

    • getRotated

      public StructureData getRotated(Rotator rotator)
    • setBlock

      public void setBlock(org.bukkit.block.Block block)
      Sets this StructureData at the given location
      Parameters:
      block - The block to set
    • getState

      public org.bukkit.block.BlockState getState(org.bukkit.block.Block block)
      Gets the BlockState to set for a given block
      Parameters:
      block - The Block to get the BlockState at
      Returns:
      The BlockState that would be set
    • sendBlock

      public void sendBlock(org.bukkit.entity.Player player, org.bukkit.Location loc)
      Sends a fake block change to a Player
      Parameters:
      player - The Player to send the fake block change to
      loc - The Location of the fake block
    • isAir

      public boolean isAir()
      Returns:
      Whether the Material is air - for 1.15+, AIR, CAVE_AIR, or VOID_AIR
    • getType

      public org.bukkit.Material getType()
      Returns:
      The type of this StructureData
    • compare

      public boolean compare(org.bukkit.block.Block block, boolean strict, boolean ignoreAir)
      Compares this StructureData to a Block
      Parameters:
      block - The Block to compare with
      strict - Whether to compare strictly
      ignoreAir - Whether to return true automatically if this StructureData is air
      Returns:
      Whether the block matches this StructureData within the given parameters