Class FullBlockList
java.lang.Object
net.rodofire.easierworldcreator.blockdata.blocklist.basic.DefaultBlockList
net.rodofire.easierworldcreator.blockdata.blocklist.basic.CompoundBlockList
net.rodofire.easierworldcreator.blockdata.blocklist.basic.FullBlockList
- All Implemented Interfaces:
BlockForceData,BlockListManager
add possibility of having force in compound blockList
-
Constructor Summary
ConstructorsConstructorDescriptionFullBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state) init a CompoundForceBlockListFullBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state, boolean force, Set<net.minecraft.block.Block> blocksToForce) init a CompoundForceBlockListFullBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state, @Nullable net.minecraft.nbt.NbtCompound tag) init a CompoundForceBlockListFullBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state, @Nullable net.minecraft.nbt.NbtCompound tag, boolean force, Set<net.minecraft.block.Block> blocksToForce) init a CompoundForceBlockListFullBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state) init a CompoundForceBlockListFullBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, boolean force, Set<net.minecraft.block.Block> blocksToForce) init a CompoundForceBlockListFullBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, @Nullable net.minecraft.nbt.NbtCompound tag) init a CompoundForceBlockListFullBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, @Nullable net.minecraft.nbt.NbtCompound tag, boolean force, Set<net.minecraft.block.Block> blocksToForce) init a CompoundForceBlockList -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlocksToForce(Set<net.minecraft.block.Block> blocksToForce) add a set of blocks to the setvoidaddBlocksToForce(net.minecraft.block.Block block) add a block to the setSet<net.minecraft.block.Block> gives you the Set of every block that can be forcedbooleanisForce()get if any block can be replaced by any BlockState of this BlockShapeManagerbooleanplaceFirstWithVerification(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.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.booleanplaceWithVerification(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.voidremoveBlocksToForce(Set<net.minecraft.block.Block> blocksToForce) remove a set of blocks to the setvoidremoveBlocksToForce(net.minecraft.block.Block block) remove a block to the setvoidsetBlocksToForce(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 BlockShapeManagerMethods inherited from class net.rodofire.easierworldcreator.blockdata.blocklist.basic.CompoundBlockList
getTag, place, placeFirst, placeFirstWithDeletion, placeLast, placeLastWithDeletion, placeWithDeletion, setTagMethods 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
-
FullBlockList
public FullBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state, boolean force, Set<net.minecraft.block.Block> blocksToForce) init a CompoundForceBlockList- Parameters:
posList- pos of the blockStatestate- the blockState related to the pos listforce- set if any block can be replaced by any blockState in this BlockListblocksToForce- set all blocks that can be forced by this BlockList
-
FullBlockList
public FullBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state, @Nullable @Nullable net.minecraft.nbt.NbtCompound tag, boolean force, Set<net.minecraft.block.Block> blocksToForce) init a CompoundForceBlockList- Parameters:
posList- pos of the blockStatestate- the blockState related to the pos listtag- the nbt tag that is related to the blockStateforce- set if any block can be replaced by any blockState in this BlockListblocksToForce- set all blocks that can be forced by this BlockList
-
FullBlockList
public FullBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, boolean force, Set<net.minecraft.block.Block> blocksToForce) init a CompoundForceBlockList- Parameters:
pos- pos of the blockStatestate- the blockState related to the pos listforce- set if any block can be replaced by any blockState in this BlockListblocksToForce- set all blocks that can be forced by this BlockList
-
FullBlockList
public FullBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, @Nullable @Nullable net.minecraft.nbt.NbtCompound tag, boolean force, Set<net.minecraft.block.Block> blocksToForce) init a CompoundForceBlockList- Parameters:
pos- pos of the blockStatestate- the blockState related to the pos listtag- the nbt tag that is related to the blockStateforce- set if any block can be replaced by any blockState in this BlockListblocksToForce- set all blocks that can be forced by this BlockList
-
FullBlockList
public FullBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state) init a CompoundForceBlockList- Parameters:
posList- pos of the blockStatestate- the blockState related to the pos list
-
FullBlockList
public FullBlockList(List<net.minecraft.util.math.BlockPos> posList, net.minecraft.block.BlockState state, @Nullable @Nullable net.minecraft.nbt.NbtCompound tag) init a CompoundForceBlockList- Parameters:
posList- pos of the blockStatestate- the blockState related to the pos listtag- the nbt tag that is related to the blockState
-
FullBlockList
public FullBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state) init a CompoundForceBlockList- Parameters:
pos- pos of the blockStatestate- the blockState related to the pos list
-
FullBlockList
public FullBlockList(net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, @Nullable @Nullable net.minecraft.nbt.NbtCompound tag) init a CompoundForceBlockList- Parameters:
pos- pos of the blockStatestate- the blockState related to the pos listtag- the nbt tag that is related to the blockState
-
-
Method Details
-
getBlocksToForce
gives you the Set of every block that can be forced- Specified by:
getBlocksToForcein interfaceBlockForceData- Returns:
- the set of the blocks that can be forced
-
setBlocksToForce
sets all the blocks that can be forced in the case force == false- Specified by:
setBlocksToForcein interfaceBlockForceData- 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- Specified by:
addBlocksToForcein interfaceBlockForceData- Parameters:
block- the block added
-
addBlocksToForce
add a set of blocks to the set- Specified by:
addBlocksToForcein interfaceBlockForceData- Parameters:
blocksToForce- the set that will be added
-
removeBlocksToForce
public void removeBlocksToForce(net.minecraft.block.Block block) remove a block to the set- Specified by:
removeBlocksToForcein interfaceBlockForceData- Parameters:
block- the block removed
-
removeBlocksToForce
remove a set of blocks to the set- Specified by:
removeBlocksToForcein interfaceBlockForceData- Parameters:
blocksToForce- the set that will be removed
-
isForce
public boolean isForce()get if any block can be replaced by any BlockState of this BlockShapeManager- Specified by:
isForcein interfaceBlockForceData- Returns:
- the boolean related to it
-
setForce
public void setForce(boolean force) sets if any block can be replaced by any BlockState of this BlockShapeManager- Specified by:
setForcein interfaceBlockForceData- Parameters:
force- the boolean used
-
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 classCompoundBlockList- 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 classCompoundBlockList- Parameters:
world- the world the block will be placedindex- the index of the block- Returns:
- true if the block was placed, false if not
-
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 classCompoundBlockList- 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 classCompoundBlockList- Parameters:
world- the world where the block will be placed- Returns:
- true if the block was placed, false if not.
-
placeLastWithVerification
public boolean placeLastWithVerification(net.minecraft.world.StructureWorldAccess world) Method to place the last Block.- Overrides:
placeLastWithVerificationin classCompoundBlockList- 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 classCompoundBlockList- Parameters:
world- the world the last block will be placed- Returns:
- true if the block was placed, false if not
-