Class BlockList
java.lang.Object
net.rodofire.easierworldcreator.shapeutil.BlockList
class used for the generation or the modification of a NBT file
this is an easier version of the
StructureTemplate.StructureBlockInfo-
Constructor Summary
ConstructorsConstructorDescriptioninit a blockListBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState blockState, boolean force) init a BlockListBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState blockState, Set<net.minecraft.block.Block> blocksToForce) init a BlockListBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state, @Nullable net.minecraft.nbt.NbtCompound tag) init a BlockListBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState blockState, @Nullable net.minecraft.nbt.NbtCompound tag, boolean force) init a BlockListBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState blockState, @Nullable net.minecraft.nbt.NbtCompound tag, Set<net.minecraft.block.Block> blocksToForce) init a BlockListBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state) init a BlockListBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState blockState, boolean force) init a BlockListBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState blockState, Set<net.minecraft.block.Block> blocksToForce) init a BlockListBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, @Nullable net.minecraft.nbt.NbtCompound tag) init a BlockList -
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 listvoidaddBlocksToForce(Set<net.minecraft.block.Block> blocksToForce) add a set of blocks to the setvoidaddBlocksToForce(net.minecraft.block.Block block) add a block to the setnet.minecraft.block.BlockStateused to get the blockStateSet<net.minecraft.block.Block> gives you the Set of every block that can be forcednet.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 layer@Nullable net.minecraft.nbt.NbtCompoundgetTag()used to get the NBT tag of the specified NBTbooleanisForce()get if any block can be replaced by any BlockState of this blockListvoidremoveBlockPos(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 listvoidremoveBlocksToForce(Set<net.minecraft.block.Block> blocksToForce) remove a set of blocks to the setvoidremoveBlocksToForce(net.minecraft.block.Block block) remove a block to the setvoidreplaceBlockPos(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 BlockListvoidsetBlocksToForce(Set<net.minecraft.block.Block> blocksToForce) sets all the blocks that can be forced in the case force == falsevoidsetForce(boolean force) sets if any block can be replaced by any BlockState of this blockListvoidsetPosList(List<net.minecraft.util.math.BlockPos> posList) It uses a list of blockPos to allow multiple BlockPos to have a BlockStatevoidsetTag(@Nullable net.minecraft.nbt.NbtCompound tag) allow you to change the tag of the relatedBlocktoString()
-
Constructor Details
-
BlockList
public BlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState blockState, @Nullable @Nullable net.minecraft.nbt.NbtCompound tag, boolean force) init a BlockList- Parameters:
posList- pos of the blockStateblockState- the blockState related to the pos listtag- the nbt of the block if it has a nbtforce- set if any block can be replaced by any blockState in this BlockList
-
BlockList
public BlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState blockState, @Nullable @Nullable net.minecraft.nbt.NbtCompound tag, Set<net.minecraft.block.Block> blocksToForce) init a BlockList- Parameters:
posList- pos of the blockStateblockState- the blockState related to the pos listtag- the nbt of the block if it has a nbtblocksToForce- list of blocks that can be forced by any blockStates of this posList
-
BlockList
public BlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState blockState, Set<net.minecraft.block.Block> blocksToForce) init a BlockList- Parameters:
posList- pos of the blockStateblockState- the blockState related to the pos listblocksToForce- list of blocks that can be forced by any blockStates of this posList
-
BlockList
public BlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState blockState, boolean force) init a BlockList- Parameters:
posList- pos of the blockStateblockState- the blockState related to the pos listforce- set if any block can be replaced by any blockState in this BlockList
-
BlockList
public BlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState blockState, boolean force) init a BlockList- Parameters:
pos- pos of the blockStateblockState- the blockState related to the pos listforce- set if any block can be replaced by any blockState in this BlockList
-
BlockList
public BlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState blockState, Set<net.minecraft.block.Block> blocksToForce) init a BlockList- Parameters:
pos- pos of the blockStateblockState- the blockState related to the pos listblocksToForce- list of blocks that can be forced by any blockStates of this posList
-
BlockList
public BlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state) init a BlockList- Parameters:
pos- pos of the blockStatestate- the blockState related to the pos list
-
BlockList
public BlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, @Nullable @Nullable net.minecraft.nbt.NbtCompound tag) init a BlockList- Parameters:
pos- pos of the blockStatestate- the blockState related to the pos listtag- the nbt of the block if it has a nbt
-
BlockList
public BlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state) init a blockList- Parameters:
posList- the list of pos of the blockStatestate- the blockState related to the pos
-
BlockList
public BlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state, @Nullable @Nullable net.minecraft.nbt.NbtCompound tag) init a BlockList- Parameters:
posList- the list of pos of the blockStatestate- the blockState related to the postag- the nbt of the block if it has a nbt
-
-
Method Details
-
getPosList
used to get the list of blockPos related to a layer- Returns:
- the list of BlockPos
-
getBlocksToForce
gives you the Set of every block that can be forced- Returns:
- the set of the blocks that can be forced
-
setBlocksToForce
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
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
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
-
setPosList
It uses a list of blockPos to allow multiple BlockPos to have a BlockState- 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- Parameters:
pos- the pos added
-
addBlockPos
allow you to add multiple BlockPos to the existing list- 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- Parameters:
pos- the pos removed
-
removeBlockPos
allow you to remove a list of BlockPos to the existing list- 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- 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- 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- Returns:
- the last blockPos of the posList
-
getFirstPos
public net.minecraft.util.math.BlockPos getFirstPos()method to get the first blockPos of the posList- Returns:
- the first blockPos of the posList
-
getBlockState
public net.minecraft.block.BlockState getBlockState()used to get the blockState- Returns:
- the blockState of the BlockList
-
setBlockState
public void setBlockState(net.minecraft.block.BlockState blockState) change the blockState of the BlockList- Parameters:
blockState- the blockState related to the BlockPos list
-
getTag
@Nullable public @Nullable net.minecraft.nbt.NbtCompound getTag()used to get the NBT tag of the specified NBT- Returns:
- the tag of the BlockList if it exists
-
setTag
public void setTag(@Nullable @Nullable net.minecraft.nbt.NbtCompound tag) allow you to change the tag of the relatedBlock- Parameters:
tag- the nbt parameter of the related Block
-
toString
-