Class SpiralGen
java.lang.Object
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 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 ClassesModifier and TypeClassDescriptionstatic enumset every possible spiral shape of the modNested 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
ConstructorsConstructorDescriptionSpiralGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, Shape.PlaceMoment placeMoment, int radius, int height) SpiralGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, Shape.PlaceMoment placeMoment, List<BlockLayer> layers, boolean force, List<net.minecraft.block.Block> blocksToForce, int xrotation, int yrotation, int secondxrotation, net.minecraft.util.Pair<Integer, Integer> radiusx, net.minecraft.util.Pair<Integer, Integer> radiusz, int height, float turnNumber) -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateElipsoidSpiral(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 an helicoid if theSpiralGen.SpiralTypeis set toHELICOIDorDOUBLE_HELICOIDwith their variantsvoidgenerateLargeOutlineSpiral(Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) this allow the generation of a large outline spiral.intgetAngle(float percentage) this method returns thehelicoidAngledepending of 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 of the height we are atfloatgetZradius(float percentage) this method returns thezradiusdepending of 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
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
-
SpiralGen
public SpiralGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, Shape.PlaceMoment placeMoment, List<BlockLayer> layers, boolean force, List<net.minecraft.block.Block> blocksToForce, int xrotation, int yrotation, int secondxrotation, net.minecraft.util.Pair<Integer, Integer> radiusx, net.minecraft.util.Pair<Integer, Integer> radiusz, int height, float turnNumber) - 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 ifforce = 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-axisheight- the height of the spiralturnNumber- the number of turns that the structure will do before reaching the top
-
SpiralGen
public SpiralGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, Shape.PlaceMoment placeMoment, int radius, int height) - Parameters:
world- the world the spiral will spawn inpos- the center of the spiralradius- 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 -
generateElipsoidSpiral
public void generateElipsoidSpiral(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 allow 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 an helicoid if theSpiralGen.SpiralTypeis set toHELICOIDorDOUBLE_HELICOIDwith their variants -
getXradius
public float getXradius(float percentage) this method returns thexradiusdepending of 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 of 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 thehelicoidAngledepending of the height we are at- Parameters:
percentage- the percentage of the height we are at- Returns:
- the angle of the spiral
-