Class AbstractBlockShape
java.lang.Object
net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapeBase
net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapePlaceType
net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapeLayer
net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapeRotation
net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShape
- Direct Known Subclasses:
AbstractFillableBlockShape,DefaultBlockShapeGen,LineGen,SpiralGen
Class to create custom shapes
- Since 2.1.0, the shape doesn't return a List<net.minecraft.util.math.BlockPos> but it returns instead a List<Set<BlockPos>>
- Before 2.1.0, the BlockPos list was a simple list.
- Starting from 2.1.0, the shapes return a list of ChunkPos that has a set of BlockPos
The change from List to Set was done to avoid duplicates BlockPos, which resulted in unnecessary calculations.
this allows easy multithreading for the Block assignment done in the AbstractBlockShape which result in better performance;
-
Nested Class Summary
Nested classes/interfaces inherited from class net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapeLayer
AbstractBlockShapeLayer.LayersTypeNested classes/interfaces inherited from class net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapePlaceType
AbstractBlockShapePlaceType.LayerPlaceNested classes/interfaces inherited from class net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapeBase
AbstractBlockShapeBase.PlaceMoment -
Field Summary
Fields inherited from class net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapeBase
biggerThanChunk, THREAD_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionAbstractBlockShape(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment) init the ShapeAbstractBlockShape(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment, AbstractBlockShapePlaceType.LayerPlace layerPlace, AbstractBlockShapeLayer.LayersType layersType, int yRotation, int zRotation, int secondYRotation, String featureName) init the Shape -
Method Summary
Modifier and TypeMethodDescriptiongetBlockListWithVerification(List<Set<net.minecraft.util.math.BlockPos>> posList) method to get the coordinates that will be placed laterprotected Set<net.minecraft.util.math.ChunkPos> getChunkCovered(net.minecraft.util.math.BlockPos pos, List<net.minecraft.util.math.ChunkPos> chunks) Method to get a chunk list to know if the structure can be placed during worldGen;net.minecraft.util.math.BlockPosvoidplace()This method allows you to place the structure in the world.voidThis method is the method to place the related BlocksvoidplaceWBlockList(List<Set<DefaultBlockList>> posList) voidsetAnimator(StructurePlaceAnimator animator) Method to set the animator.voidsetFeatureName(String featureName) Method to set a custom name for the structure.voidsetOffset(net.minecraft.util.math.BlockPos offset) method to set an offsetMethods inherited from class net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapeRotation
addSecondZRotation, addYRotation, addZRotation, getCoordinatesRotation, getCoordinatesRotation, getCoordinatesRotationList, getSecondYRotation, getYRotation, getZRotation, setSecondYRotation, setYRotation, setZRotationMethods inherited from class net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapeLayer
getDirectionalLayerDirection, getInnerCylindricalBlocks, getInnerRadialBlocks, getLayers, getLayersType, getLayersWithVerification, getOuterCylindricalBlocks, getOuterRadialBlocks, getRadialCenterPos, getVerifiedInnerCylindricalBlocks, getVerifiedInnerRadialBlocks, getVerifiedOuterCylindricalBlocks, getVerifiedOuterRadialBlocks, placeFirstSurfaceBlockLayers, placeInnerCylindricalBlocks, placeInnerRadialBlocks, placeLayers, placeOuterCylindricalBlocks, placeOuterRadialBlocks, placeSurfaceBlockLayer, setDirectionalLayerDirection, setLayerDirection, setLayersType, setRadialCenterPosMethods inherited from class net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapePlaceType
getBlockToPlace, getBlockToPlace, getLayerPlace, getNoise, placeBlocks, placeBlocks, placeBlocksWithVerification, placeBlocksWithVerification, placeBlocksWithVerification, setLayerPlace, setNoise, verifyBlocks, verifyBlocks, verifyBlocksMethods inherited from class net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapeBase
addPosOffset, getBlockLayer, getPlaceMoment, getPos, getWorld, setBlockLayer, setPlaceMoment, setPos
-
Constructor Details
-
AbstractBlockShape
public AbstractBlockShape(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, @NotNull @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment, AbstractBlockShapePlaceType.LayerPlace layerPlace, AbstractBlockShapeLayer.LayersType layersType, int yRotation, int zRotation, int secondYRotation, String featureName) init the Shape- Parameters:
world- the world the spiral will spawn inpos- the center of the spiralplaceMoment- define the moment where the shape will be placedlayerPlace- how the@BlockStatesinside of aBlockLayerwill be placedlayersType- how the Layers will be placedyRotation- first rotation around the y-axiszRotation- second rotation around the z-axissecondYRotation- last rotation around the y-axisfeatureName- the name of the feature
-
AbstractBlockShape
public AbstractBlockShape(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, @NotNull @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment) init the Shape- Parameters:
world- the world of the shapepos- the pos of the shape (usually the center of the structure)placeMoment- define the moment where the shape will be placed
-
-
Method Details
-
getAnimator
-
setAnimator
Method to set the animator. It is required whenPlaceMomentis defined onANIMATED_OTHER- Parameters:
animator- the animator that will be played
-
getFeatureName
-
setFeatureName
Method to set a custom name for the structure.
It is optional.
If no name is provided, one random name will be generated.
It allows better readibility in the generated files
- Parameters:
featureName- the name of the structure
-
getOffset
public net.minecraft.util.math.BlockPos getOffset() -
setOffset
public void setOffset(net.minecraft.util.math.BlockPos offset) method to set an offset- Parameters:
offset- the offset of the entire structure
-
place
public void place()This method allows you to place the structure in the world. Any changes done after this moment will not be taken in count except if you place another shape later -
place
This method is the method to place the related Blocks -
placeWBlockList
- Throws:
IOException
-
getBlockPos
method to get the coordinates that will be placed later- Returns:
- a list of blockPos for every shape
-
getBlockListWithVerification
public List<Set<DefaultBlockList>> getBlockListWithVerification(List<Set<net.minecraft.util.math.BlockPos>> posList) -
getChunkCovered
protected Set<net.minecraft.util.math.ChunkPos> getChunkCovered(net.minecraft.util.math.BlockPos pos, List<net.minecraft.util.math.ChunkPos> chunks) Method to get a chunk list to know if the structure can be placed during worldGen;- Parameters:
pos- the center pos
-