Class CircleGen
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
net.rodofire.easierworldcreator.shape.block.instanciator.AbstractFillableBlockShape
net.rodofire.easierworldcreator.shape.block.gen.CircleGen
Class to generate Circle related 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 returns 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 allow 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.AbstractFillableBlockShape
AbstractFillableBlockShape.TypeNested 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
ConstructorsConstructorDescriptionCircleGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, AbstractBlockShapeBase.PlaceMoment placeMoment, int radius) init a circle generatorCircleGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, AbstractBlockShapeBase.PlaceMoment placeMoment, AbstractBlockShapePlaceType.LayerPlace layerPlace, AbstractBlockShapeLayer.LayersType layersType, int yRotation, int zRotation, int secondYRotation, String featureName, int radiusX, int radiusZ) init the Circle Shape -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOvalBlocks(int centerX, int centerZ, int x, int y, int z, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) Adds block positions to the chunkMap based on the given coordinates.voidaddRadiusX(int radiusX) method to add the radius of the circlevoidaddRadiusY(int radiusZ) method to add the radius of the circlemethod to create an empty oval with rotationsgenerateEmptyOval(int centerX, int centerZ, int y) This class is used when no rotation is present.method to create a full oval/ with custom fillingmethod to get all the pos of the circleintmethod to get the radius of the circleintmethod to get the radius of the circlevoidplaceFullOval(int centerX, int centerZ, int x, int y, int z, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) Fills in the lines between the blocks for a complete oval.voidsetRadiusX(int radiusX) method to set the radius of the circlevoidsetRadiusZ(int radiusZ) method to set the radius of the circleMethods inherited from class net.rodofire.easierworldcreator.shape.block.instanciator.AbstractFillableBlockShape
getCustomFill, getFillingType, setCustomFill, setFill, setFillingTypeMethods inherited from class net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShape
getAnimator, getBlockListWithVerification, getChunkCovered, getFeatureName, getOffset, place, place, placeWBlockList, setAnimator, setFeatureName, setOffsetMethods 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, getRadialCenterVec3d, getVerifiedInnerCylindricalBlocks, getVerifiedInnerRadialBlocks, getVerifiedOuterCylindricalBlocks, getVerifiedOuterRadialBlocks, placeFirstSurfaceBlockLayers, placeInnerCylindricalBlocks, placeInnerRadialBlocks, placeLayers, placeOuterCylindricalBlocks, placeOuterRadialBlocks, placeSurfaceBlockLayer, setDirectionalLayerDirection, setLayerDirection, setLayersType, setRadialCenterPos, setRadialCenterVec3dMethods 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
-
CircleGen
public CircleGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, AbstractBlockShapeBase.PlaceMoment placeMoment, AbstractBlockShapePlaceType.LayerPlace layerPlace, AbstractBlockShapeLayer.LayersType layersType, int yRotation, int zRotation, int secondYRotation, String featureName, int radiusX, int radiusZ) init the Circle 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 featureradiusX- the radius of the x-axisradiusZ- the radius of the z-axis
-
CircleGen
public CircleGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, AbstractBlockShapeBase.PlaceMoment placeMoment, int radius) init a circle generator- Parameters:
world- the world the spiral will spawn inpos- the center of the spiralplaceMoment- define the moment where the shape will be placedradius- the radius of the x-axis
-
-
Method Details
-
getRadiusX
public int getRadiusX()method to get the radius of the circle- Returns:
- the radius of the circle on the x-axis
-
setRadiusX
public void setRadiusX(int radiusX) method to set the radius of the circle- Parameters:
radiusX- the radius that will be set on the x-axis
-
getRadiusZ
public int getRadiusZ()method to get the radius of the circle- Returns:
- the radius of the circle on the z-axis
-
setRadiusZ
public void setRadiusZ(int radiusZ) method to set the radius of the circle- Parameters:
radiusZ- the radius that will be set on the z-axis
-
addRadiusX
public void addRadiusX(int radiusX) method to add the radius of the circle- Parameters:
radiusX- the radius that will be added on the x-axis
-
addRadiusY
public void addRadiusY(int radiusZ) method to add the radius of the circle- Parameters:
radiusZ- the radius that will be added on the z-axis
-
getBlockPos
method to get all the pos of the circle- Specified by:
getBlockPosin classAbstractBlockShape- Returns:
- the blockPos of the circle. The List is divided into chunkPos, allowing for parallel modification
-
generateFullOval
method to create a full oval/ with custom filling- Returns:
List<Set<BlockPos>>: set of BlockPos divided into a list of chunks
-
generateEmptyOval
method to create an empty oval with rotations- Returns:
List<Set<BlockPos>>: set of BlockPos divided into a list of chunks
-
generateEmptyOval
public List<Set<net.minecraft.util.math.BlockPos>> generateEmptyOval(int centerX, int centerZ, int y) This class is used when no rotation is present. This allows fast coordinates generation but doesn't work with rotations- Parameters:
centerX- the x coordinate of the center of the circlecenterZ- the z coordinate of the center of the circley- the height of the circle- Returns:
- a list of chunk represented by a set of BlockPos
-
addOvalBlocks
public void addOvalBlocks(int centerX, int centerZ, int x, int y, int z, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) Adds block positions to the chunkMap based on the given coordinates.- Parameters:
centerX- The x-coordinate of the center of the ovalcenterZ- The z-coordinate of the center of the ovalx- The x-coordinate in the context of the Bresenham algorithmy- The height of the ovalz- The z-coordinate in the context of the Bresenham algorithmchunkMap- The map of chunks with the block positions
-
placeFullOval
public void placeFullOval(int centerX, int centerZ, int x, int y, int z, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) Fills in the lines between the blocks for a complete oval.- Parameters:
centerX- The x-coordinate of the center of the ovalcenterZ- The z-coordinate of the center of the ovalx- The x-coordinate in the context of the Bresenham algorithmy- The height of the ovalz- The z-coordinate in the context of the Bresenham algorithmchunkMap- The map of chunks with the block positions
-