Class BlockLayer
java.lang.Object
net.rodofire.easierworldcreator.shapeutil.BlockLayer
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
ConstructorsConstructorDescriptionBlockLayer(List<net.minecraft.block.BlockState> states) init the BlockLayerBlockLayer(List<net.minecraft.block.BlockState> states, int depth) init the BlockLayerBlockLayer(net.minecraft.block.BlockState state) init the BlockLayerBlockLayer(net.minecraft.block.BlockState state, int depth) init the BlockLayer -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlockState(net.minecraft.block.BlockState state) add a BlockState to the layervoidaddBlockStates(List<net.minecraft.block.BlockState> states) add multiple BlockStates to the layervoidaddDepth(int depth) List<net.minecraft.block.BlockState> intgetDepth()voidremoveBlockState(int index) voidremoveBlockState(List<net.minecraft.block.BlockState> state) removes some BlockStates of the LayervoidremoveBlockState(net.minecraft.block.BlockState state) removes a BlockState of the LayervoidsetBlockStates(List<net.minecraft.block.BlockState> blocks) voidsetDepth(int depth) intsize()toString()
-
Constructor Details
-
BlockLayer
init the BlockLayer- Parameters:
states- list of BlockStatesdepth- depth of the BlockStates
-
BlockLayer
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()- Returns:
- the depth of the layer
-
setDepth
public void setDepth(int depth) - Parameters:
depth- int to change the layer depth
-
addDepth
public void addDepth(int depth) - Parameters:
depth- int added to the layer depth
-
getBlockStates
- Returns:
- the blockStates list of the layer
-
setBlockStates
- 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
add multiple BlockStates to the layer- Parameters:
states- List of BlockState to be added
-
removeBlockState
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) - Parameters:
index- remove the BlockState at the index
-
size
public int size()- Returns:
- the size of the BlockStates
-
toString
-