Class CylinderGen
java.lang.Object
net.rodofire.easierworldcreator.shapeutil.Shape
net.rodofire.easierworldcreator.shapeutil.FillableShape
net.rodofire.easierworldcreator.shapegen.CylinderGen
Class to generate Sphere related shapes
the methods in this class basically stack multiple circles to generate a cylinder
- 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
ConstructorsConstructorDescriptionCylinderGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, int radius, int height, Shape.PlaceMoment placeMoment) -
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.voidgenerateEmptyCylinder(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) this generates a full cylindervoidgenerateFatsOval(int centerX, int centerZ, int y, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) this class is used when no rotation is present.voidgenerateFullCylinder(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) this generates a full cylinderintintintList<net.minecraft.util.math.Vec3d> getVec3d()voidplaceFullOval(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.voidsetHeight(int height) voidsetRadiusX(int radius) voidsetRadiusZ(int radius) 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, getCylindricalBlocks, getFirstSurfaceBlockLayers, getForce, getGenTime, getLayerPlace, getLayers, getLayersType, getNoise, getPlaceMoment, getPlaceType, getPos, getRadialBlocks, getRotations, getSecondXrotation, getWorld, getXrotation, getYrotation, place, place, placeBlocks, placeBlocks, placeBlocksWithVerification, placeBlocksWithVerification, placeCylindricalBlocks, placeFirstSurfaceBlockLayers, placeLayers, placeRadialBlocks, placeSurfaceBlockLayers, removeBlockLayer, removeBlockLayer, removeBlockLayer, setBlockLayers, setBlockLayers, setBlocksToForce, setForce, setLayerDirection, setLayerPlace, setLayersType, setNoise, setPlaceMoment, setPlaceType, setPos, setSecondxrotation, setXrotation, setYrotation, verifyBlocks
-
Constructor Details
-
CylinderGen
public CylinderGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, int radius, int height, Shape.PlaceMoment placeMoment)
-
-
Method Details
-
setHeight
public void setHeight(int height) -
getHeight
public int getHeight() -
setRadiusX
public void setRadiusX(int radius) -
getRadiusX
public int getRadiusX() -
setRadiusZ
public void setRadiusZ(int radius) -
getRadiusZ
public int getRadiusZ() -
getBlockPos
- Specified by:
getBlockPosin classShape
-
generateCylinder
-
generateFullCylinder
public void generateFullCylinder(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) this generates a full cylinder -
generateEmptyCylinder
public void generateEmptyCylinder(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) this generates a full cylinder -
generateFatsOval
public void generateFatsOval(int centerX, int centerZ, int y, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) this class is used when no rotation is present. This allow fast coordinates generation but don'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 circlechunkMap- the Map used to return the positions
-
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
-
getVec3d
-