Interface BlockListManager
- All Known Implementing Classes:
CompoundBlockList,DefaultBlockList,ForceBlockList,FullBlockList
public interface BlockListManager
Interface to define the base of the BlockList.
BlockList are objects that are composed of at one BlockState and at least one BlockPos,
and eventually others parameters.
This allows saving memory by removing any duplicate BlockState
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlockPos(List<net.minecraft.util.math.BlockPos> pos) allow you to add multipleBlockPosto the existing listvoidaddBlockPos(net.minecraft.util.math.BlockPos pos) allow you to add aBlockPosto the existing listnet.minecraft.block.BlockStateused to get theBlockStatenet.minecraft.util.math.BlockPosmethod to get the firstBlockPosof the posListnet.minecraft.util.math.BlockPosmethod to get the lastBlockPosof the posListnet.minecraft.util.math.BlockPosgetPos(int index) method to get a certainBlockPosfrom an index in the posListList<net.minecraft.util.math.BlockPos> used to get the list ofBlockPosrelated to a layernet.minecraft.util.math.BlockPosmethod to get a randomBlockPosof the posListnet.minecraft.util.math.BlockPosgetRandomPos(net.minecraft.util.math.random.Random random) method to get a randomBlockPosof the posListnet.minecraft.util.math.BlockPosmethod to remove the last blockPos of a blockListvoidallow you to remove a list ofBlockPosto the existing listvoidremovePos(net.minecraft.util.math.BlockPos pos) allow you to remove aBlockPosto the existing listvoidreplacePos(net.minecraft.util.math.BlockPos oldPos, net.minecraft.util.math.BlockPos newPos) method to replace one blockPos to another onevoidsetBlockState(net.minecraft.block.BlockState blockState) change theBlockStateof the BlockShapeManagervoidsetPosList(List<net.minecraft.util.math.BlockPos> posList) It uses a list ofBlockPosto allow multiple BlockPos to have aBlockStateintsize()method to get the number ofBlockPospresent in the related BlockList
-
Method Details
-
getPosList
List<net.minecraft.util.math.BlockPos> getPosList()used to get the list ofBlockPosrelated to a layer- Returns:
- the list of
BlockPos
-
setPosList
It uses a list ofBlockPosto allow multiple BlockPos to have aBlockState- Parameters:
posList- a list ofBlockPos
-
addBlockPos
void addBlockPos(net.minecraft.util.math.BlockPos pos) allow you to add aBlockPosto the existing list- Parameters:
pos-BlockPospos added
-
addBlockPos
allow you to add multipleBlockPosto the existing list- Parameters:
pos- theBlockPoslist added
-
removePos
void removePos(net.minecraft.util.math.BlockPos pos) allow you to remove aBlockPosto the existing list- Parameters:
pos- the pos removed
-
removePos
allow you to remove a list ofBlockPosto the existing list- Parameters:
pos- the list pos removed
-
removeLastPos
net.minecraft.util.math.BlockPos removeLastPos()method to remove the last blockPos of a blockList- Returns:
- the BlockPos removed
-
replacePos
void replacePos(net.minecraft.util.math.BlockPos oldPos, net.minecraft.util.math.BlockPos newPos) method to replace one blockPos to another one- Parameters:
oldPos- the oldPos that will be replacednewPos- the newPos that will replace the otherBlockPos
-
getPos
net.minecraft.util.math.BlockPos getPos(int index) method to get a certainBlockPosfrom an index in the posList- Parameters:
index- the index of the BlockPos- Returns:
- the
BlockPosof the index
-
getLastPos
net.minecraft.util.math.BlockPos getLastPos()method to get the lastBlockPosof the posList- Returns:
- the last
BlockPosof the posList
-
getFirstPos
net.minecraft.util.math.BlockPos getFirstPos()method to get the firstBlockPosof the posList- Returns:
- the first
BlockPosof the posList
-
getRandomPos
net.minecraft.util.math.BlockPos getRandomPos()method to get a randomBlockPosof the posList- Returns:
- the first
BlockPosof the posList
-
getRandomPos
net.minecraft.util.math.BlockPos getRandomPos(net.minecraft.util.math.random.Random random) method to get a randomBlockPosof the posList- Parameters:
random- the random object that will be used to get the index- Returns:
- the first
BlockPosof the posList
-
getBlockState
net.minecraft.block.BlockState getBlockState()used to get theBlockState- Returns:
- the
BlockStateof the BlockShapeManager
-
setBlockState
void setBlockState(net.minecraft.block.BlockState blockState) change theBlockStateof the BlockShapeManager- Parameters:
blockState- theBlockStaterelated to theBlockPoslist
-
size
int size()method to get the number ofBlockPospresent in the related BlockList- Returns:
- the number of
BlockPos
-