Class LineGen
java.lang.Object
Class to generate Line 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 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
ConstructorsConstructorDescriptionLineGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment, net.minecraft.util.math.BlockPos secondPos) init the Line ShapeLineGen(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment, AbstractBlockShapePlaceType.LayerPlace layerPlace, AbstractBlockShapeLayer.LayersType layersType, int yRotation, int zRotation, int secondYRotation, String featureName, net.minecraft.util.math.BlockPos secondPos) init the Line Shape -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidgenerateAxisLine(net.minecraft.util.math.Direction dir, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) this method generates the coordinatesmethod to get the coordinates that will be placed laternet.minecraft.util.math.BlockPosvoidsetSecondPos(net.minecraft.util.math.BlockPos secondPos) Methods 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
-
LineGen
public LineGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, @NotNull @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment, AbstractBlockShapePlaceType.LayerPlace layerPlace, AbstractBlockShapeLayer.LayersType layersType, int yRotation, int zRotation, int secondYRotation, String featureName, net.minecraft.util.math.BlockPos secondPos) init the Line 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 featuresecondPos- the second pos on which the line has to go
-
LineGen
public LineGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, @NotNull @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment, net.minecraft.util.math.BlockPos secondPos) init the Line Shape- Parameters:
world- the world the spiral will spawn inpos- the center of the spiralplaceMoment- define the moment where the shape will be placedsecondPos- the second pos on which the line has to go
-
-
Method Details
-
getSecondPos
public net.minecraft.util.math.BlockPos getSecondPos() -
setSecondPos
public void setSecondPos(net.minecraft.util.math.BlockPos secondPos) -
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
-
generateAxisLine
public void generateAxisLine(net.minecraft.util.math.Direction dir, Map<net.minecraft.util.math.ChunkPos, Set<net.minecraft.util.math.BlockPos>> chunkMap) this method generates the coordinates- Parameters:
dir- the direction of the linechunkMap- the map used to get the coordinates
-
drawLine
-