Class DefaultBlockList
java.lang.Object
net.rodofire.easierworldcreator.blockdata.blocklist.basic.DefaultBlockList
- All Implemented Interfaces:
BlockListManager
- Direct Known Subclasses:
CompoundBlockList,ForceBlockList
Class used to connect BlockPos to a BlockState.
the class is composed of a List<BlockPos> related to a BlockState.
This means that all the BlockPos of the object are connected to the BlockState
this is an easier version of the StructureTemplate.StructureBlockInfo
It also allows for better manipulation of how blocks behave and allows to save memory since that there is no double blockStates.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState blockState) init a BlockShapeManagerDefaultBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state) init a BlockShapeManager -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlockPos(List<net.minecraft.util.math.BlockPos> pos) allow you to add multiple BlockPos to the existing listvoidaddBlockPos(net.minecraft.util.math.BlockPos pos) allow you to add a BlockPos to the existing listnet.minecraft.block.BlockStateused to get the blockStatenet.minecraft.util.math.BlockPosmethod to get the first blockPos of the posListnet.minecraft.util.math.BlockPosmethod to get the last blockPos of the posListnet.minecraft.util.math.BlockPosgetPos(int index) method to get a certain pos from an index in the posListList<net.minecraft.util.math.BlockPos> used to get the list of blockPos related to a layernet.minecraft.util.math.BlockPosMethod to get a randomBlockPosin theposListby using a new minecraft Randomnet.minecraft.util.math.BlockPosgetRandomPos(net.minecraft.util.math.random.Random random) Method to get a randomBlockPosin theposListbased on a provided randomvoidremoveBlockPos(List<net.minecraft.util.math.BlockPos> pos) allow you to remove a list of BlockPos to the existing listvoidremoveBlockPos(net.minecraft.util.math.BlockPos pos) allow you to remove a BlockPos to the existing listvoidreplaceBlockPos(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 the blockState of the BlockShapeManagervoidsetPosList(List<net.minecraft.util.math.BlockPos> posList) It uses a list of blockPos to allow multiple BlockPos to have a BlockStateintsize()method to get the number ofBlockPospresent in the related BlockListtoString()
-
Constructor Details
-
DefaultBlockList
public DefaultBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState blockState) init a BlockShapeManager- Parameters:
posList- pos of the blockStateblockState- the blockState related to the pos list
-
DefaultBlockList
public DefaultBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state) init a BlockShapeManager- Parameters:
pos- pos of the blockStatestate- the blockState related to the pos list
-
-
Method Details
-
getPosList
used to get the list of blockPos related to a layer- Specified by:
getPosListin interfaceBlockListManager- Returns:
- the list of BlockPos
-
setPosList
It uses a list of blockPos to allow multiple BlockPos to have a BlockState- Specified by:
setPosListin interfaceBlockListManager- Parameters:
posList- a list of BlockPos
-
addBlockPos
public void addBlockPos(net.minecraft.util.math.BlockPos pos) allow you to add a BlockPos to the existing list- Specified by:
addBlockPosin interfaceBlockListManager- Parameters:
pos- the pos added
-
addBlockPos
allow you to add multiple BlockPos to the existing list- Specified by:
addBlockPosin interfaceBlockListManager- Parameters:
pos- the pos list added
-
removeBlockPos
public void removeBlockPos(net.minecraft.util.math.BlockPos pos) allow you to remove a BlockPos to the existing list- Specified by:
removeBlockPosin interfaceBlockListManager- Parameters:
pos- the pos removed
-
removeBlockPos
allow you to remove a list of BlockPos to the existing list- Specified by:
removeBlockPosin interfaceBlockListManager- Parameters:
pos- the list pos removed
-
replaceBlockPos
public void replaceBlockPos(net.minecraft.util.math.BlockPos oldPos, net.minecraft.util.math.BlockPos newPos) method to replace one blockPos to another one- Specified by:
replaceBlockPosin interfaceBlockListManager- Parameters:
oldPos- the oldPos that will be replacednewPos- the newPos that will replace the other blockPos
-
getPos
public net.minecraft.util.math.BlockPos getPos(int index) method to get a certain pos from an index in the posList- Specified by:
getPosin interfaceBlockListManager- Parameters:
index- the index of the BlockPos- Returns:
- the BlockPos of the index
-
getLastPos
public net.minecraft.util.math.BlockPos getLastPos()method to get the last blockPos of the posList- Specified by:
getLastPosin interfaceBlockListManager- Returns:
- the last blockPos of the posList
-
getFirstPos
public net.minecraft.util.math.BlockPos getFirstPos()method to get the first blockPos of the posList- Specified by:
getFirstPosin interfaceBlockListManager- Returns:
- the first blockPos of the posList
-
getRandomPos
public net.minecraft.util.math.BlockPos getRandomPos()Method to get a randomBlockPosin theposListby using a new minecraft Random- Specified by:
getRandomPosin interfaceBlockListManager- Returns:
- a random
BlockPos
-
getRandomPos
public net.minecraft.util.math.BlockPos getRandomPos(net.minecraft.util.math.random.Random random) Method to get a randomBlockPosin theposListbased on a provided random- Specified by:
getRandomPosin interfaceBlockListManager- Parameters:
random- the random object that will be used to get the index- Returns:
- a random
BlockPos
-
getBlockState
public net.minecraft.block.BlockState getBlockState()used to get the blockState- Specified by:
getBlockStatein interfaceBlockListManager- Returns:
- the blockState of the BlockShapeManager
-
setBlockState
public void setBlockState(net.minecraft.block.BlockState blockState) change the blockState of the BlockShapeManager- Specified by:
setBlockStatein interfaceBlockListManager- Parameters:
blockState- the blockState related to the BlockPos list
-
size
public int size()method to get the number ofBlockPospresent in the related BlockList- Specified by:
sizein interfaceBlockListManager- Returns:
- the number of
BlockPos
-
toString
-