Class SpiralGen
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.shapegen.SpiralGen
Class to generate Spiral related shapes
Since 2.1.0, the shape doesn't return a List<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 return 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 ClassesModifier and TypeClassDescriptionstatic enumset every possible spiral shape of the modNested 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
ConstructorsConstructorDescriptionSpiralGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, ShapeBase.PlaceMoment placeMoment, int radius, int height) SpiralGen(@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, net.minecraft.util.Pair<Integer, Integer> radiusX, net.minecraft.util.Pair<Integer, Integer> radiusZ, int height, float turnNumber) init the Spiral Shape -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateEllipsoidSpiral(net.minecraft.util.math.BlockPos pos, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) generates a simple spiralvoidgenerateHelicoid(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) generates a helicoid if theSpiralGen.SpiralTypeis set toHELICOIDorDOUBLE_HELICOIDwith their variantsvoidgenerateLargeOutlineSpiral(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) this allows the generation of a large outline spiral.intgetAngle(float percentage) this method returns thehelicoïdAngledepending on the height we are atmethod to get the coordinates that will be placed laterintintintintintintfloatintintfloatList<net.minecraft.util.math.Vec3d> getVec3d()method to get the Vec3d that will be placed laterfloatgetXRadius(float percentage) this method returns thexRadiusdepending on the height we are atfloatgetZRadius(float percentage) this method returns thezRadiusdepending on the height we are atvoidsetEndRadiusX(int endRadiusX) voidsetEndRadiusZ(int endRadiusZ) voidsetHeight(int height) voidsetHelicoidAngle(net.minecraft.util.Pair<Integer, Integer> helicoidAngle) voidsetOffset(int offset) voidsetOutlineRadiusX(int outlineRadiusX) voidsetOutlineRadiusZ(int outlineRadiusZ) voidsetRadiusX(net.minecraft.util.Pair<Integer, Integer> radiusX) voidsetRadiusZ(net.minecraft.util.Pair<Integer, Integer> radiusZ) voidsetSpiralFilling(float spiralFilling) voidsetSpiralType(SpiralGen.SpiralType spiralType) voidsetStartRadiusX(int startRadiusX) voidsetStartRadiusZ(int startRadiusZ) voidsetTurnNumber(float turnNumber) Methods inherited from class net.rodofire.easierworldcreator.shapeutil.Shape
getChunkCovered, place, place, placeWBlockListMethods inherited from class net.rodofire.easierworldcreator.shapeutil.ShapeRotation
addSecondZRotation, addYRotation, addZRotation, getCoordinatesRotation, getCoordinatesRotation, getCoordinatesRotationList, getSecondYRotation, getYRotation, getZRotation, setSecondYRotation, setYRotation, setZRotationMethods 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
-
SpiralGen
public SpiralGen(@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, net.minecraft.util.Pair<Integer, Integer> radiusX, net.minecraft.util.Pair<Integer, Integer> radiusZ, int height, float turnNumber) init the Spiral 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-axis. The first value corresponding to the radius at the base of the spiral, the second, corresponding to the radius at the top of the spiralradiusZ- the radius on the z-axis. The first value corresponding to the radius at the base of the spiral, the second, corresponding to the radius at the top of the spiralheight- the height of the spiralturnNumber- the number of turn that the spiral will do (ex: 1 -> 1 turn, 3.5 -> 3.5 turn)
-
SpiralGen
public SpiralGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, ShapeBase.PlaceMoment placeMoment, int radius, int height) - 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 spiralheight- the height of the spiral
-
-
Method Details
-
getOutlineRadiusZ
public int getOutlineRadiusZ() -
setOutlineRadiusZ
public void setOutlineRadiusZ(int outlineRadiusZ) -
getOutlineRadiusX
public int getOutlineRadiusX() -
setOutlineRadiusX
public void setOutlineRadiusX(int outlineRadiusX) -
getSpiralFilling
public float getSpiralFilling() -
setSpiralFilling
public void setSpiralFilling(float spiralFilling) -
getSpiralType
-
setSpiralType
-
getHeight
public int getHeight() -
setHeight
public void setHeight(int height) -
getRadiusZ
-
getStartRadiusZ
public int getStartRadiusZ() -
getStartRadiusX
public int getStartRadiusX() -
getEndRadiusZ
public int getEndRadiusZ() -
getEndRadiusX
public int getEndRadiusX() -
setRadiusZ
-
getRadiusX
-
setRadiusX
-
setEndRadiusX
public void setEndRadiusX(int endRadiusX) -
setEndRadiusZ
public void setEndRadiusZ(int endRadiusZ) -
setStartRadiusX
public void setStartRadiusX(int startRadiusX) -
setStartRadiusZ
public void setStartRadiusZ(int startRadiusZ) -
getTurnNumber
public float getTurnNumber() -
setTurnNumber
public void setTurnNumber(float turnNumber) -
getOffset
public int getOffset() -
setOffset
public void setOffset(int offset) - Parameters:
offset- the offset of the start of the spiral
-
getHelicoidAngle
-
setHelicoidAngle
- Parameters:
helicoidAngle- the start and the end angle of the blocks on the side
-
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 -
generateEllipsoidSpiral
public void generateEllipsoidSpiral(net.minecraft.util.math.BlockPos pos, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) generates a simple spiral- Parameters:
pos- the center of the spiral. This can be changed to match certain needing like when generating a large outline
-
generateLargeOutlineSpiral
public void generateLargeOutlineSpiral(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) this allows the generation of a large outline spiral. -
generateHelicoid
public void generateHelicoid(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) generates a helicoid if theSpiralGen.SpiralTypeis set toHELICOIDorDOUBLE_HELICOIDwith their variants -
getXRadius
public float getXRadius(float percentage) this method returns thexRadiusdepending on the height we are at- Parameters:
percentage- the percentage of the height we are at- Returns:
- the x radius of the spiral
-
getZRadius
public float getZRadius(float percentage) this method returns thezRadiusdepending on the height we are at- Parameters:
percentage- the percentage of the height we are at- Returns:
- the x radius of the spiral
-
getAngle
public int getAngle(float percentage) this method returns thehelicoïdAngledepending on the height we are at- Parameters:
percentage- the percentage of the height we are at- Returns:
- the angle of the spiral
-