Class BlockLayerManager
java.lang.Object
net.rodofire.easierworldcreator.blockdata.layer.BlockLayerManager
The
BlockLayerComparator class provides utility methods to manage a collection of BlockLayer objects.
This class allows manipulation of individual layers and their properties, including adding, removing, and modifying
layers, as well as checking for specific conditions such as forced parameters.-
Constructor Summary
ConstructorsConstructorDescriptionBlockLayerManager(List<BlockLayer> layers) Constructs aBlockLayerComparatorwith the specified list of layers.BlockLayerManager(BlockLayer layer) Constructs aBlockLayerComparatorwith the specified layers.BlockLayerManager(BlockLayer... layers) BlockLayerManager(LayerPlacer placer, List<net.minecraft.block.BlockState> states) init the BlockLayerBlockLayerManager(LayerPlacer placer, List<net.minecraft.block.BlockState> states, int depth) init the BlockLayerBlockLayerManager(LayerPlacer placer, List<net.minecraft.block.BlockState> states, int depth, StructurePlacementRuleManager ruler) init the BlockLayerBlockLayerManager(LayerPlacer placer, List<net.minecraft.block.BlockState> states, List<Short> chances) init the BlockLayerBlockLayerManager(LayerPlacer placer, List<net.minecraft.block.BlockState> states, List<Short> chances, int depth, StructurePlacementRuleManager ruler) init the BlockLayerBlockLayerManager(LayerPlacer placer, List<net.minecraft.block.BlockState> states, StructurePlacementRuleManager ruler) init the BlockLayerBlockLayerManager(LayerPlacer placer, net.minecraft.block.BlockState state) init the BlockLayerBlockLayerManager(LayerPlacer placer, net.minecraft.block.BlockState state, int depth) init the BlockLayerBlockLayerManager(LayerPlacer placer, net.minecraft.block.BlockState state, int depth, StructurePlacementRuleManager ruler) init the BlockLayerBlockLayerManager(LayerPlacer placer, net.minecraft.block.BlockState state, short depth) Constructs aBlockLayerComparatorwith the specified layers.BlockLayerManager(LayerPlacer placer, net.minecraft.block.BlockState state, StructurePlacementRuleManager ruler) init the BlockLayer -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlockLayers(List<BlockLayer> layers) Adds a collection ofBlockLayerobjects to the list of layers.voidaddLayer(BlockLayer layer) Adds a singleBlockLayerto the list of layers.get(int index) Retrieves theBlockLayerat the specified index.Retrieves the firstBlockLayerin the list.Retrieves the lastBlockLayerin the list.Returns the list ofBlockLayerobjects.booleanisEmpty()Method to know if the BlockLayer List is emptybooleanmethod to know if the layers should repeatvoidmodifyBlocks(int index, List<net.minecraft.block.BlockState> states) Modifies the block states of theBlockLayerat the specified index.voidmodifyDepth(int index, int depth) Modifies the depth of theBlockLayerat the specified index.voidmodifyLayer(int index, BlockLayer layer) Replaces theBlockLayerat the specified index with a new one.remove(int index) Removes and returns theBlockLayerat the specified index.Removes and returns the firstBlockLayerin the list.Removes and returns the lastBlockLayerin the list.voidsetLayers(List<BlockLayer> layers) Replaces the current list ofBlockLayerobjects with the specified list.voidsetRepeatLayers(boolean repeatLayers) method to repeat the layer in the case the distance is bigger than the sum of all depth of all theBlockLayerintsize()Returns the number ofBlockLayerobjects in the list.
-
Constructor Details
-
BlockLayerManager
Constructs aBlockLayerComparatorwith the specified list of layers.- Parameters:
layers- the initial list ofBlockLayerobjects to manage
-
BlockLayerManager
-
BlockLayerManager
Constructs aBlockLayerComparatorwith the specified layers.- Parameters:
layer- the initialBlockLayerobjects to manage
-
BlockLayerManager
Constructs aBlockLayerComparatorwith the specified layers. -
BlockLayerManager
public BlockLayerManager(LayerPlacer placer, List<net.minecraft.block.BlockState> states, int depth, StructurePlacementRuleManager ruler) init the BlockLayer- Parameters:
states- list of BlockStatesdepth- depth of the BlockStates
-
BlockLayerManager
public BlockLayerManager(LayerPlacer placer, List<net.minecraft.block.BlockState> states, List<Short> chances, int depth, StructurePlacementRuleManager ruler) init the BlockLayer- Parameters:
states- list of BlockStateschances- the chance of the related blockStates being chosendepth- depth of the BlockStates
-
BlockLayerManager
public BlockLayerManager(LayerPlacer placer, List<net.minecraft.block.BlockState> states, StructurePlacementRuleManager ruler) init the BlockLayer- Parameters:
states- list of BlockStates
-
BlockLayerManager
public BlockLayerManager(LayerPlacer placer, net.minecraft.block.BlockState state, int depth, StructurePlacementRuleManager ruler) 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
-
BlockLayerManager
public BlockLayerManager(LayerPlacer placer, net.minecraft.block.BlockState state, StructurePlacementRuleManager ruler) 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)
-
BlockLayerManager
public BlockLayerManager(LayerPlacer placer, List<net.minecraft.block.BlockState> states, int depth) init the BlockLayer- Parameters:
states- list of BlockStatesdepth- depth of the BlockStates
-
BlockLayerManager
init the BlockLayer- Parameters:
states- list of BlockStates
-
BlockLayerManager
public BlockLayerManager(LayerPlacer placer, List<net.minecraft.block.BlockState> states, List<Short> chances) init the BlockLayer- Parameters:
states- list of BlockStateschances- the chance of the state being chosen
-
BlockLayerManager
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
-
BlockLayerManager
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
-
getLayers
Returns the list ofBlockLayerobjects.- Returns:
- the list of layers
-
setLayers
Replaces the current list ofBlockLayerobjects with the specified list.- Parameters:
layers- the new list ofBlockLayerobjects
-
addLayer
Adds a singleBlockLayerto the list of layers.- Parameters:
layer- theBlockLayerto add
-
addBlockLayers
Adds a collection ofBlockLayerobjects to the list of layers.- Parameters:
layers- the list ofBlockLayerobjects to add
-
get
Retrieves theBlockLayerat the specified index.- Parameters:
index- the index of theBlockLayerto retrieve- Returns:
- the
BlockLayerat the specified index
-
remove
Removes and returns theBlockLayerat the specified index.- Parameters:
index- the index of theBlockLayerto remove- Returns:
- the removed
BlockLayer
-
getFirstLayer
Retrieves the firstBlockLayerin the list.- Returns:
- the first
BlockLayer
-
removeFirstLayer
Removes and returns the firstBlockLayerin the list.- Returns:
- the removed first
BlockLayer
-
getLastLayer
Retrieves the lastBlockLayerin the list.- Returns:
- the last
BlockLayer
-
removeLastLayer
Removes and returns the lastBlockLayerin the list.- Returns:
- the removed last
BlockLayer
-
modifyBlocks
Modifies the block states of theBlockLayerat the specified index.- Parameters:
index- the index of theBlockLayerto modifystates- the new list ofBlockStateobjects
-
modifyDepth
public void modifyDepth(int index, int depth) Modifies the depth of theBlockLayerat the specified index.- Parameters:
index- the index of theBlockLayerto modifydepth- the new depth value
-
modifyLayer
Replaces theBlockLayerat the specified index with a new one.- Parameters:
index- the index of theBlockLayerto replacelayer- the newBlockLayer
-
size
public int size()Returns the number ofBlockLayerobjects in the list.- Returns:
- the size of the list
-
isEmpty
public boolean isEmpty()Method to know if the BlockLayer List is empty- Returns:
- true if it is empty, false if not
-
isRepeatLayers
public boolean isRepeatLayers()method to know if the layers should repeat- Returns:
- the boolean value
-
setRepeatLayers
public void setRepeatLayers(boolean repeatLayers) method to repeat the layer in the case the distance is bigger than the sum of all depth of all theBlockLayer- Parameters:
repeatLayers- boolean that manage if the layers have to be repeated
-