Class BlockLayer

java.lang.Object
net.rodofire.easierworldcreator.shapeutil.BlockLayer

public class BlockLayer extends Object
Represents a layer in a structure. Each layer consists of a list of BlockState objects and an integer. The list contains all the BlockState objects present in the layer, while the integer represents the depth of the layer.

Be cautious with the depth parameter: The depth should never be less than 0. There is no benefit to having a depth equal to 0.

  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockLayer(List<net.minecraft.block.BlockState> states)
    init the BlockLayer
    BlockLayer(List<net.minecraft.block.BlockState> states, boolean force)
    init the BlockLayer
    BlockLayer(List<net.minecraft.block.BlockState> states, int depth)
    init the BlockLayer
    BlockLayer(List<net.minecraft.block.BlockState> states, int depth, Set<net.minecraft.block.Block> blocksToForce)
    init the BlockLayer
    BlockLayer(net.minecraft.block.BlockState state)
    init the BlockLayer
    BlockLayer(net.minecraft.block.BlockState state, boolean force)
    init the BlockLayer
    BlockLayer(net.minecraft.block.BlockState state, int depth)
    init the BlockLayer
    BlockLayer(net.minecraft.block.BlockState state, int depth, Set<net.minecraft.block.Block> blocksToForce)
    init the BlockLayer
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addBlockState(net.minecraft.block.BlockState state)
    add a BlockState to the layer
    void
    addBlockStates(List<net.minecraft.block.BlockState> states)
    add multiple BlockStates to the layer
    void
    addBlocksToForce(Set<net.minecraft.block.Block> blocksToForce)
    add a set of blocks to the set
    void
    addBlocksToForce(net.minecraft.block.Block block)
    add a block to the set
    void
    addDepth(int depth)
    add a depth to the BlockLayer
    List<net.minecraft.block.BlockState>
    method used to get all the BlockState in a BlockLayer
    Set<net.minecraft.block.Block>
    gives you the Set of every block that can be forced
    int
    method used to get all the depth in a BlockLayer
    boolean
    get if any block can be replaced by any BlockState of this blockList
    void
    removeBlockState(int index)
    method used to remove a BlockState related to the index
    void
    removeBlockState(List<net.minecraft.block.BlockState> state)
    removes some BlockStates of the Layer
    void
    removeBlockState(net.minecraft.block.BlockState state)
    removes a BlockState of the Layer
    void
    removeBlocksToForce(Set<net.minecraft.block.Block> blocksToForce)
    remove a set of blocks to the set
    void
    removeBlocksToForce(net.minecraft.block.Block block)
    remove a block to the set
    void
    setBlockStates(List<net.minecraft.block.BlockState> blocks)
    method used to set all the BlockState in a BlockLayer
    void
    setBlocksToForce(Set<net.minecraft.block.Block> blocksToForce)
    sets all the blocks that can be forced in the case force == false
    void
    setDepth(int depth)
    set a depth to the BlockLayer
    void
    setForce(boolean force)
    sets if any block can be replaced by any BlockState of this blockList
    int
    method used to get the size of the BlockLayer
     

    Methods inherited from class java.lang.Object

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

    • BlockLayer

      public BlockLayer(List<net.minecraft.block.BlockState> states, int depth, Set<net.minecraft.block.Block> blocksToForce)
      init the BlockLayer
      Parameters:
      states - list of BlockStates
      depth - depth of the BlockStates
      blocksToForce - list of blocks that can be forced by any blockStates of this posList
    • BlockLayer

      public BlockLayer(List<net.minecraft.block.BlockState> states, boolean force)
      init the BlockLayer
      Parameters:
      states - list of BlockStates
      force - set if any block can be replaced by any blockState in this BlockList
    • BlockLayer

      public BlockLayer(net.minecraft.block.BlockState state, int depth, Set<net.minecraft.block.Block> blocksToForce)
      init the BlockLayer
      Parameters:
      state - if the layer is only composed of one BlockState, you don't necessary need to create a list (created automatically)
      depth - list of BlockStates
      blocksToForce - list of blocks that can be forced by any blockStates of this posList
    • BlockLayer

      public BlockLayer(net.minecraft.block.BlockState state, boolean force)
      init the BlockLayer
      Parameters:
      state - if the layer is only composed of one BlockState, you don't necessary need to create a list (created automatically)
      force - set if any block can be replaced by any blockState in this BlockList
    • BlockLayer

      public BlockLayer(List<net.minecraft.block.BlockState> states, int depth)
      init the BlockLayer
      Parameters:
      states - list of BlockStates
      depth - depth of the BlockStates
    • BlockLayer

      public BlockLayer(List<net.minecraft.block.BlockState> states)
      init the BlockLayer
      Parameters:
      states - list of BlockStates
    • BlockLayer

      public BlockLayer(net.minecraft.block.BlockState state, int depth)
      init the BlockLayer
      Parameters:
      state - if the layer is only composed of one BlockState, you don't necessary need to create a list (created automatically)
      depth - list of BlockStates
    • BlockLayer

      public BlockLayer(net.minecraft.block.BlockState state)
      init the BlockLayer
      Parameters:
      state - if the layer is only composed of one BlockState, you don't necessary need to create a list (created automatically)
  • Method Details

    • getDepth

      public int getDepth()
      method used to get all the depth in a BlockLayer
      Returns:
      the depth of the layer
    • setDepth

      public void setDepth(int depth)
      set a depth to the BlockLayer
      Parameters:
      depth - int to change the layer depth
    • addDepth

      public void addDepth(int depth)
      add a depth to the BlockLayer
      Parameters:
      depth - int added to the layer depth
    • getBlockStates

      public List<net.minecraft.block.BlockState> getBlockStates()
      method used to get all the BlockState in a BlockLayer
      Returns:
      the blockStates list of the layer
    • setBlockStates

      public void setBlockStates(List<net.minecraft.block.BlockState> blocks)
      method used to set all the BlockState in a BlockLayer
      Parameters:
      blocks - change the BlockStates of a layer
    • addBlockState

      public void addBlockState(net.minecraft.block.BlockState state)
      add a BlockState to the layer
      Parameters:
      state - BlockState to be added
    • addBlockStates

      public void addBlockStates(List<net.minecraft.block.BlockState> states)
      add multiple BlockStates to the layer
      Parameters:
      states - List of BlockState to be added
    • removeBlockState

      public void removeBlockState(List<net.minecraft.block.BlockState> state)
      removes some BlockStates of the Layer
      Parameters:
      state - list of BlockStates that will be removed
    • removeBlockState

      public void removeBlockState(net.minecraft.block.BlockState state)
      removes a BlockState of the Layer
      Parameters:
      state - BlockState that will be removed
    • removeBlockState

      public void removeBlockState(int index)
      method used to remove a BlockState related to the index
      Parameters:
      index - remove the BlockState at the index
    • size

      public int size()
      method used to get the size of the BlockLayer
      Returns:
      the size of the BlockStates
    • getBlocksToForce

      public Set<net.minecraft.block.Block> getBlocksToForce()
      gives you the Set of every block that can be forced
      Returns:
      the set of the blocks that can be forced
    • setBlocksToForce

      public void setBlocksToForce(Set<net.minecraft.block.Block> blocksToForce)
      sets all the blocks that can be forced in the case force == false
      Parameters:
      blocksToForce - the set of blocks that can be forced
    • addBlocksToForce

      public void addBlocksToForce(net.minecraft.block.Block block)
      add a block to the set
      Parameters:
      block - the block added
    • addBlocksToForce

      public void addBlocksToForce(Set<net.minecraft.block.Block> blocksToForce)
      add a set of blocks to the set
      Parameters:
      blocksToForce - the set that will be added
    • removeBlocksToForce

      public void removeBlocksToForce(net.minecraft.block.Block block)
      remove a block to the set
      Parameters:
      block - the block removed
    • removeBlocksToForce

      public void removeBlocksToForce(Set<net.minecraft.block.Block> blocksToForce)
      remove a set of blocks to the set
      Parameters:
      blocksToForce - the set that will be removed
    • isForce

      public boolean isForce()
      get if any block can be replaced by any BlockState of this blockList
      Returns:
      the boolean related to it
    • setForce

      public void setForce(boolean force)
      sets if any block can be replaced by any BlockState of this blockList
      Parameters:
      force - the boolean used
    • toString

      public String toString()
      Overrides:
      toString in class Object