Class CompoundBlockList
java.lang.Object
net.rodofire.easierworldcreator.blockdata.blocklist.basic.DefaultBlockList
net.rodofire.easierworldcreator.blockdata.blocklist.basic.CompoundBlockList
- All Implemented Interfaces:
BlockListManager
- Direct Known Subclasses:
FullBlockList
add possibility of having NbtCompound in compound blockList
-
Constructor Summary
ConstructorsConstructorDescriptionCompoundBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state) init a CompoundBlockListCompoundBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state, @Nullable net.minecraft.nbt.NbtCompound tag) init a CompoundBlockListCompoundBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state) init a CompoundBlockListCompoundBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, @Nullable net.minecraft.nbt.NbtCompound tag) init a CompoundBlockList -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.nbt.NbtCompoundgetTag()used to get the NBT tag of the specified NBTvoidplace(net.minecraft.world.StructureWorldAccess world, int index) method to place the Block related to the indexvoidplaceFirst(net.minecraft.world.StructureWorldAccess world) method to place the first BlockvoidplaceFirstWithDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the first Block and deleting it.booleanplaceFirstWithVerification(net.minecraft.world.StructureWorldAccess world) Method to place the first Block.booleanplaceFirstWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the first Block and deleting it.voidplaceLast(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator.voidplaceLastWithDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator and removing it then.booleanplaceLastWithVerification(net.minecraft.world.StructureWorldAccess world) Method to place the last Block.booleanplaceLastWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator and removing it then.voidplaceWithDeletion(net.minecraft.world.StructureWorldAccess world, int index) method to place the block with the deletion of the BlockPosbooleanplaceWithVerification(net.minecraft.world.StructureWorldAccess world, int index) Method to place the block related to the index.booleanplaceWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world, int index) Method to place the block with the deletion of the BlockPos The method also performs verification to know if the block can be placed.voidsetTag(@Nullable net.minecraft.nbt.NbtCompound tag) allow you to change the tag of the relatedBlockMethods inherited from class net.rodofire.easierworldcreator.blockdata.blocklist.basic.DefaultBlockList
addBlockPos, addBlockPos, getBlockState, getFirstPos, getJson, getLastPos, getPos, getPosList, getRandomPos, getRandomPos, placeAll, placeAllWithDeletion, placeAllWithVerification, placeAllWithVerificationDeletion, removeAll, removeFirstPos, removeLastPos, removePos, removePos, removePos, replacePos, setBlockState, setPosList, size, toJson, toString
-
Constructor Details
-
CompoundBlockList
public CompoundBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state) init a CompoundBlockList- Parameters:
posList- pos of the blockStatestate- the blockState related to the pos list
-
CompoundBlockList
public CompoundBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state, @Nullable @Nullable net.minecraft.nbt.NbtCompound tag) init a CompoundBlockList- Parameters:
posList- pos of the blockStatestate- the blockState related to the pos listtag- the nbt tag that is related to the blockState
-
CompoundBlockList
public CompoundBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state) init a CompoundBlockList- Parameters:
pos- pos of the blockStatestate- the blockState related to the pos list
-
CompoundBlockList
public CompoundBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, @Nullable @Nullable net.minecraft.nbt.NbtCompound tag) init a CompoundBlockList- Parameters:
pos- pos of the blockStatestate- the blockState related to the pos listtag- the nbt tag that is related to the blockState
-
-
Method Details
-
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
-
place
public void place(net.minecraft.world.StructureWorldAccess world, int index) method to place the Block related to the index- Overrides:
placein classDefaultBlockList- Parameters:
world- the world the block will be placedindex- the index of the BlockPos
-
placeWithDeletion
public void placeWithDeletion(net.minecraft.world.StructureWorldAccess world, int index) method to place the block with the deletion of the BlockPos- Overrides:
placeWithDeletionin classDefaultBlockList- Parameters:
world- the world the block will be placedindex- the index of the block
-
placeWithVerification
public boolean placeWithVerification(net.minecraft.world.StructureWorldAccess world, int index) Method to place the block related to the index. The method also performs verification to know if the block can be placed.- Overrides:
placeWithVerificationin classDefaultBlockList- Parameters:
world- the world the block will be placedindex- the index of the block- Returns:
- true if the block was placed, false if not
-
placeWithVerificationDeletion
public boolean placeWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world, int index) Method to place the block with the deletion of the BlockPos The method also performs verification to know if the block can be placed.- Overrides:
placeWithVerificationDeletionin classDefaultBlockList- Parameters:
world- the world the block will be placedindex- the index of the block- Returns:
- true if the block was placed, false if not
-
placeFirst
public void placeFirst(net.minecraft.world.StructureWorldAccess world) method to place the first Block- Overrides:
placeFirstin classDefaultBlockList- Parameters:
world- the world the block will be placed
-
placeFirstWithDeletion
public void placeFirstWithDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the first Block and deleting it. You shouldn't use this method in normal case since that the method is pretty costly O(n). Use insteadplaceLastWithDeletion()that is faster O(1).- Overrides:
placeFirstWithDeletionin classDefaultBlockList- Parameters:
world- the world where the block will be placed
-
placeFirstWithVerification
public boolean placeFirstWithVerification(net.minecraft.world.StructureWorldAccess world) Method to place the first Block.The method also performs verification to know if the block can be placed.
- Overrides:
placeFirstWithVerificationin classDefaultBlockList- Parameters:
world- the world where the block will be placed- Returns:
- true if the block was placed, false if not.
-
placeFirstWithVerificationDeletion
public boolean placeFirstWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the first Block and deleting it.
The method also performs verification to know if the block can be placed.
You shouldn't use this method in normal case since that the method is pretty costly O(n).
Use instead
placeLastWithDeletion()that is faster O(1).- Overrides:
placeFirstWithVerificationDeletionin classDefaultBlockList- Parameters:
world- the world where the block will be placed- Returns:
- true if the block was placed, false if not.
-
placeLastWithDeletion
public void placeLastWithDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator and removing it then. Consider using this method because it gives you better performance.- Overrides:
placeLastWithDeletionin classDefaultBlockList- Parameters:
world- the world the last block will be placed
-
placeLast
public void placeLast(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator.- Overrides:
placeLastin classDefaultBlockList- Parameters:
world- the world the last block will be placed
-
placeLastWithVerification
public boolean placeLastWithVerification(net.minecraft.world.StructureWorldAccess world) Method to place the last Block.- Overrides:
placeLastWithVerificationin classDefaultBlockList- Parameters:
world- the world the last block will be placed The method also performs verification to know if the block can be placed.- Returns:
- true if the block was placed, false if not
-
placeLastWithVerificationDeletion
public boolean placeLastWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator and removing it then. The method also performs verification to know if the block can be placed. Consider using this method because it gives you better performance.- Overrides:
placeLastWithVerificationDeletionin classDefaultBlockList- Parameters:
world- the world the last block will be placed- Returns:
- true if the block was placed, false if not
-