Class CircleGen
java.lang.Object
net.rodofire.easierworldcreator.shapeutil.ShapeBase
net.rodofire.easierworldcreator.shapeutil.ShapePlaceType
net.rodofire.easierworldcreator.shapeutil.ShapeLayer
net.rodofire.easierworldcreator.shapeutil.ShapeRotation
net.rodofire.easierworldcreator.shapeutil.Shape
net.rodofire.easierworldcreator.shapeutil.FillableShape
net.rodofire.easierworldcreator.shapegen.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 Shape which result in better performance;
-
Nested Class Summary
Nested classes/interfaces inherited from class net.rodofire.easierworldcreator.shapeutil.FillableShape
FillableShape.TypeNested classes/interfaces inherited from class net.rodofire.easierworldcreator.shapeutil.ShapeLayer
ShapeLayer.LayersTypeNested classes/interfaces inherited from class net.rodofire.easierworldcreator.shapeutil.ShapePlaceType
ShapePlaceType.LayerPlace, ShapePlaceType.PlaceTypeNested classes/interfaces inherited from class net.rodofire.easierworldcreator.shapeutil.ShapeBase
ShapeBase.PlaceMoment -
Field Summary
Fields inherited from class net.rodofire.easierworldcreator.shapeutil.ShapeBase
biggerThanChunk, THREAD_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionCircleGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, ShapeBase.PlaceMoment placeMoment, int radius) CircleGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, ShapeBase.PlaceMoment placeMoment, ShapePlaceType.LayerPlace layerPlace, ShapeLayer.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) voidaddRadiusY(int radiusY) method 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 the coordinates that will be placed laterintintList<net.minecraft.util.math.Vec3d> getVec3d()method to get the Vec3d that will be placed latervoidplaceFullOval(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) voidsetRadiusZ(int radiusZ) Methods inherited from class net.rodofire.easierworldcreator.shapeutil.FillableShape
getCustomFill, getFillingType, setCustomFill, setFill, setFillingTypeMethods inherited from class net.rodofire.easierworldcreator.shapeutil.Shape
getChunkCovered, place, place, placeWBlockListMethods inherited from class net.rodofire.easierworldcreator.shapeutil.ShapeRotation
addSecondXRotation, addXRotation, addYRotation, getCoordinatesRotation, getCoordinatesRotation, getCoordinatesRotationList, getSecondYRotation, getYRotation, getZRotation, setSecondYRotation, setXRotation, setYRotationMethods inherited from class net.rodofire.easierworldcreator.shapeutil.ShapeLayer
getDirectionalLayerDirection, getInnerCylindricalBlocks, getInnerRadialBlocks, getLayers, getLayersType, getOuterCylindricalBlocks, getOuterRadialBlocks, getRadialCenterPos, getRadialCenterVec3d, placeFirstSurfaceBlockLayers, placeInnerCylindricalBlocks, placeInnerRadialBlocks, placeLayers, placeOuterCylindricalBlocks, placeOuterRadialBlocks, placeSurfaceBlockLayer, setDirectionalLayerDirection, setLayerDirection, setLayersType, setRadialCenterPos, setRadialCenterVec3dMethods inherited from class net.rodofire.easierworldcreator.shapeutil.ShapePlaceType
getBlockToPlace, getBlockToPlace, getLayerPlace, getNoise, getPlaceType, placeBlocks, placeBlocks, placeBlocksWithVerification, placeBlocksWithVerification, placeBlocksWithVerification, setLayerPlace, setNoise, setPlaceType, verifyBlocksMethods inherited from class net.rodofire.easierworldcreator.shapeutil.ShapeBase
addBlockLayer, addBlockLayers, addPosOffset, getBlockLayer, getBlockLayers, getPlaceMoment, getPos, getWorld, removeBlockLayer, removeBlockLayer, removeBlockLayer, setBlockLayers, setBlockLayers, setPlaceMoment, setPos
-
Constructor Details
-
CircleGen
public CircleGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, ShapeBase.PlaceMoment placeMoment, ShapePlaceType.LayerPlace layerPlace, ShapeLayer.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, ShapeBase.PlaceMoment placeMoment, int radius) - 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() -
setRadiusX
public void setRadiusX(int radiusX) -
getRadiusZ
public int getRadiusZ() -
setRadiusZ
public void setRadiusZ(int radiusZ) -
addRadiusX
public void addRadiusX(int radiusX) -
addRadiusY
public void addRadiusY(int radiusY) -
getBlockPos
Description copied from class:Shapemethod to get the coordinates that will be placed later- Specified by:
getBlockPosin classShape- Returns:
- a list of blockPos for every shape
-
getVec3d
Description copied from class:Shapemethod to get the Vec3d that will be placed later -
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
-