Class Shape
- Direct Known Subclasses:
DefaultShapeGen,FillableShape,LineGen,SpiralGen
Class to create custom 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 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 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
ConstructorsConstructorDescriptionShape(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, @NotNull ShapeBase.PlaceMoment placeMoment) init the ShapeShape(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, @NotNull ShapeBase.PlaceMoment placeMoment, ShapePlaceType.LayerPlace layerPlace, ShapeLayer.LayersType layersType, int yRotation, int zRotation, int secondYRotation, String featureName) init the Shape -
Method Summary
Modifier and TypeMethodDescriptionmethod to get the coordinates that will be placed laterprotected Set<net.minecraft.util.math.ChunkPos> getChunkCovered(net.minecraft.util.math.BlockPos pos, List<net.minecraft.util.math.ChunkPos> chunks) Method to get a chunk list to know if the structure can be placed during worldGen;abstract List<net.minecraft.util.math.Vec3d> getVec3d()method to get the Vec3d that will be placed latervoidplace()This method allows you to place the structure in the world.voidThis method is the method to place the related BlocksvoidplaceWBlockList(List<Set<BlockList>> posList) Methods inherited from class net.rodofire.easierworldcreator.shapeutil.ShapeRotation
addSecondXRotation, addXRotation, addYRotation, getCoordinatesRotation, getCoordinatesRotation, getCoordinatesRotationList, getSecondYRotation, getYRotation, getZRotation, setSecondYRotation, setXRotation, setYRotationMethods 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
-
Shape
public Shape(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, @NotNull @NotNull ShapeBase.PlaceMoment placeMoment, ShapePlaceType.LayerPlace layerPlace, ShapeLayer.LayersType layersType, int yRotation, int zRotation, int secondYRotation, String featureName) init the 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 feature
-
Shape
public Shape(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, @NotNull @NotNull ShapeBase.PlaceMoment placeMoment) init the Shape- Parameters:
world- the world of the shapepos- the pos of the shape (usually the center of the structure)placeMoment- define the moment where the shape will be placed
-
-
Method Details
-
place
This method allows you to place the structure in the world. Any changes done after this moment will not be taken in count except if you place another shape later- Throws:
IOException
-
place
This method is the method to place the related Blocks- Parameters:
posList- theListofSetofBlockPoscalculated before, that will be placed- Throws:
IOException
-
placeWBlockList
- Throws:
IOException
-
getBlockPos
method to get the coordinates that will be placed later- Returns:
- a list of blockPos for every shape
-
getVec3d
method to get the Vec3d that will be placed later- Returns:
- a list of Vec3d for every shape
-
getChunkCovered
protected Set<net.minecraft.util.math.ChunkPos> getChunkCovered(net.minecraft.util.math.BlockPos pos, List<net.minecraft.util.math.ChunkPos> chunks) Method to get a chunk list to know if the structure can be placed during worldGen;- Parameters:
pos- the center pos
-