Class SphereGen
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.SphereGen
Class to generate Sphere 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 ClassesModifier and TypeClassDescriptionstatic enumenum to define the type of the sphereNested 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
multiChunk, THREAD_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionSphereGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, AbstractBlockShapeBase.PlaceMoment placeMoment, int radius) init the shape generationSphereGen(@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 radiusY, int radiusZ, SphereGen.SphereType halfSphere) init the Sphere Shape -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateEmptyEllipsoid(int minLarge, int maxLarge, int minHeight, int maxHeight, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) voidgenerateEmptyEllipsoid(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) voidgenerateFullEllipsoid(int minX, int maxX, int minY, int maxY, int minZ, int maxZ, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) allow you to generate a full ellipsoidvoidgenerateFullEllipsoid(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) voidgenerateHalfEmptyEllipsoid(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) voidgenerateHalfFullEllipsoid(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) method to get the coordinates that will be placed laternet.minecraft.util.math.DirectionGets the direction of the half-sphere. * * @return The direction of the half-sphere.intGets the X radius of the sphere. * * @return The X radius.intGets the Y radius of the sphere. * * @return The Y radius.intGets the Z radius of the sphere. * * @return The Z radius.Checks if it is a half sphere. * * @return The type of the half-sphere.voidsetHalfSphere(SphereGen.SphereType halfSphere) Sets the half-sphere type. * * @param halfSphere The half-sphere type to set.voidsetHalfSphereDirection(net.minecraft.util.math.Direction direction) Sets the direction of the half-sphere. * * @param direction The direction to set.voidsetRadiusX(int radiusX) Sets the X radius of the sphere. * * @param radiusX The X radius to set.voidsetRadiusY(int radiusY) Sets the Y radius of the sphere. * * @param radiusY The Y radius to set.voidsetRadiusZ(int radiusZ) Sets the Z radius of the sphere. * * @param radiusZ The Z radius to set.Methods 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, 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, getBlockPosList, getPlaceMoment, getPos, getWorld, setBlockLayer, setPlaceMoment, setPos
-
Constructor Details
-
SphereGen
public SphereGen(@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 radiusY, int radiusZ, SphereGen.SphereType halfSphere) init the Sphere 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 on the x-axisradiusY- the radius on the y-axisradiusZ- the radius on the z-axishalfSphere- determines if the sphere is half or not
-
SphereGen
public SphereGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, AbstractBlockShapeBase.PlaceMoment placeMoment, int radius) init the shape generation- Parameters:
world- the world the shape will be generatedpos- the pos of the structure centerplaceMoment- define the moment where the shape will be placedradius- the radius of the sphere
-
-
Method Details
-
getHalfSphereDirection
public net.minecraft.util.math.Direction getHalfSphereDirection()Gets the direction of the half-sphere. * * @return The direction of the half-sphere. -
setHalfSphereDirection
public void setHalfSphereDirection(net.minecraft.util.math.Direction direction) Sets the direction of the half-sphere. * * @param direction The direction to set. -
isHalfSphere
Checks if it is a half sphere. * * @return The type of the half-sphere. -
setHalfSphere
Sets the half-sphere type. * * @param halfSphere The half-sphere type to set. -
getRadiusX
public int getRadiusX()Gets the X radius of the sphere. * * @return The X radius. -
setRadiusX
public void setRadiusX(int radiusX) Sets the X radius of the sphere. * * @param radiusX The X radius to set. -
getRadiusY
public int getRadiusY()Gets the Y radius of the sphere. * * @return The Y radius. -
setRadiusY
public void setRadiusY(int radiusY) Sets the Y radius of the sphere. * * @param radiusY The Y radius to set. -
getRadiusZ
public int getRadiusZ()Gets the Z radius of the sphere. * * @return The Z radius. -
setRadiusZ
public void setRadiusZ(int radiusZ) Sets the Z radius of the sphere. * * @param radiusZ The Z radius to set. -
getBlockPos
Description copied from class:AbstractBlockShapemethod to get the coordinates that will be placed later- Specified by:
getBlockPosin classAbstractBlockShape- Returns:
- a map of ChunkPos of blockPos for every shape
-
getSphereCoordinates
-
generateHalfEmptyEllipsoid
-
generateEmptyEllipsoid
-
generateEmptyEllipsoid
-
generateHalfFullEllipsoid
-
generateFullEllipsoid
-
generateFullEllipsoid
public void generateFullEllipsoid(int minX, int maxX, int minY, int maxY, int minZ, int maxZ, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) allow you to generate a full ellipsoid- Parameters:
minX- the start of the circle on the x-axismaxX- the end of the circle on the x-axisminY- the start of the circle on the y-axismaxY- the end of the circle on the y-axisminZ- the start of the circle on the z-axismaxZ- the end of the circle on the z-axis
-