Class CircleGen
java.lang.Object
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 wich 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.Shape
Shape.LayerPlace, Shape.LayersType, Shape.PlaceMoment, Shape.PlaceType -
Field Summary
Fields inherited from class net.rodofire.easierworldcreator.shapeutil.Shape
biggerThanChunk -
Constructor Summary
ConstructorsConstructorDescriptionCircleGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, int radius, Shape.PlaceMoment placeMoment) Deprecated, for removal: This API element is subject to removal in a future version.CircleGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, Shape.PlaceMoment placeMoment, int radius) CircleGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, Shape.PlaceMoment placeMoment, @NotNull List<BlockLayer> layers, boolean force, List<net.minecraft.block.Block> blocksToForce, int xrotation, int yrotation, int secondxrotation, int radiusx, int radiusz) -
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
addBlockLayer, addBlockLayers, addBlocksToForce, addBlocksToForce, addPosOffset, addSecondxrotation, addXrotation, addYrotation, getBlockLayer, getBlockLayers, getBlocksToForce, getBlockToPlace, getBlockToPlace, getChunkCovered, getCoordinatesRotation, getCoordinatesRotation, getCoordinatesRotationList, getFirstSurfaceBlockLayers, getForce, getInnerCylindricalBlocks, getInnerRadialBlocks, getLayerPlace, getLayers, getLayersType, getNoise, getOuterCylindricalBlocks, getOuterRadialBlocks, getPlaceMoment, getPlaceType, getPos, getRotations, getSecondXrotation, getWorld, getXrotation, getYrotation, place, place, placeBlocks, placeBlocks, placeBlocksWithVerification, placeBlocksWithVerification, placeFirstSurfaceBlockLayers, placeInnerCylindricalBlocks, placeInnerRadialBlocks, placeLayers, placeOuterCylindricalBlocks, placeOuterRadialBlocks, placeSurfaceBlockLayers, removeBlockLayer, removeBlockLayer, removeBlockLayer, setBlockLayers, setBlockLayers, setBlocksToForce, setForce, setLayerDirection, setLayerPlace, setLayersType, setNoise, setPlaceMoment, setPlaceType, setPos, setSecondxrotation, setXrotation, setYrotation, verifyBlocks
-
Constructor Details
-
CircleGen
public CircleGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, Shape.PlaceMoment placeMoment, @NotNull @NotNull List<BlockLayer> layers, boolean force, List<net.minecraft.block.Block> blocksToForce, int xrotation, int yrotation, int secondxrotation, int radiusx, int radiusz) - Parameters:
world- the world the spiral will spawn inpos- the center of the spirallayers- a list of layers that will be used for the structureforce- boolean to force the pos of the blocksblocksToForce- a list of blocks that the blocks of the spiral can still force if force = falsexrotation- first rotation around the x-axisyrotation- second rotation around the y-axissecondxrotation- last rotation around the x-axisradiusx- 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, Shape.PlaceMoment placeMoment, int radius) -
CircleGen
@Deprecated(forRemoval=true) public CircleGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, int radius, Shape.PlaceMoment placeMoment) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
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:
-
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
-