Class ShapeLayer

Direct Known Subclasses:
ShapeRotation

public abstract class ShapeLayer extends ShapePlaceType
  • Constructor Details

    • ShapeLayer

      public ShapeLayer(@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)
      init the ShapeLayer
      Parameters:
      world - the world the spiral will spawn in
      pos - the center of the spiral
      placeMoment - define the moment where the shape will be placed
      layerPlace - how the @BlockStates inside of a BlockLayer will be placed
      layersType - how the Layers will be placed
    • ShapeLayer

      public ShapeLayer(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, @NotNull @NotNull ShapeBase.PlaceMoment placeMoment)
      init the ShapeLayer
      Parameters:
      world - the world of the shape
      pos - the pos of the shape (usually the center of the structure)
      placeMoment - define the moment where the shape will be placed
  • Method Details

    • setLayerDirection

      public void setLayerDirection(net.minecraft.util.math.Vec3d vector)
      method to change the direction of the orthogonal vector used when layerType = ALONG_DIRECTION
      Parameters:
      vector - the vector that will be set
    • getLayersType

      public ShapeLayer.LayersType getLayersType()
      used to get the layerType initialized
      Returns:
      the layer type of the shape
    • setLayersType

      public void setLayersType(ShapeLayer.LayersType layersType)
      used to change the layerType
      Parameters:
      layersType - the layer type that will replace the actual one
    • getRadialCenterVec3d

      public net.minecraft.util.math.Vec3d getRadialCenterVec3d()
    • setRadialCenterVec3d

      public void setRadialCenterVec3d(net.minecraft.util.math.Vec3d radialCenterVec3d)
    • getRadialCenterPos

      public net.minecraft.util.math.BlockPos getRadialCenterPos()
    • setRadialCenterPos

      public void setRadialCenterPos(net.minecraft.util.math.BlockPos radialCenterPos)
    • getDirectionalLayerDirection

      public net.minecraft.util.math.Vec3d getDirectionalLayerDirection()
    • setDirectionalLayerDirection

      public void setDirectionalLayerDirection(net.minecraft.util.math.Vec3d directionalLayerDirection)
    • getLayers

      public Set<BlockList> getLayers(Set<net.minecraft.util.math.BlockPos> firstPosList)
      place the layers of the structure starting from the first layer to the second to the third
      Parameters:
      firstPosList - list of the BlockPos that compose the structure
    • placeLayers

      public void placeLayers(Set<net.minecraft.util.math.BlockPos> firstPosList)
      place the layers of the structure depending on the ShapeLayer.LayersType
      Parameters:
      firstPosList - list of the BlockPos that compose the structure
    • placeFirstSurfaceBlockLayers

      public Set<net.minecraft.util.math.BlockPos> placeFirstSurfaceBlockLayers(Set<net.minecraft.util.math.BlockPos> firstPosList)
      This method returns a temporary blockPos list of the first layer after verification. The first layer will the be placed in placeSurfaceBlockLayer(Set, int)
      Parameters:
      firstPosList - the list of BlockPos to verify at first
      Returns:
      the set of verified BlockPos
    • placeSurfaceBlockLayer

      public List<Set<net.minecraft.util.math.BlockPos>> placeSurfaceBlockLayer(Set<net.minecraft.util.math.BlockPos> posList, int layerIndex)

      This method is used to determine and place the layers of the structure

      It determines for every BlockPos provided if the pos can be replaced by the new Layer.

      To determine it, it gets the depth of the previous layer. It verifies if there is in the List the actual BlockPos with an offset of the depth

      -if there is, it adds the BlockPos in a new List and remove the BlockPos from the existing list.

      -If not, it does nothing.

      Parameters:
      posList - the list of BlockPos of the precedent Layer
      layerIndex - the index to get the depth
      Returns:
      two List. One corresponding to the final List<BlockPos> of the previous layer. The other one, the rest of the List<BlockPos> of the structure that will be used by the next iteration.
    • placeInnerCylindricalBlocks

      public void placeInnerCylindricalBlocks(Set<net.minecraft.util.math.BlockPos> posList)
    • placeOuterCylindricalBlocks

      public void placeOuterCylindricalBlocks(Set<net.minecraft.util.math.BlockPos> posList)
    • placeInnerRadialBlocks

      public void placeInnerRadialBlocks(Set<net.minecraft.util.math.BlockPos> posList)
    • placeOuterRadialBlocks

      public void placeOuterRadialBlocks(Set<net.minecraft.util.math.BlockPos> posList)
    • getInnerCylindricalBlocks

      public Set<BlockList> getInnerCylindricalBlocks(Set<net.minecraft.util.math.BlockPos> posList)
    • getOuterCylindricalBlocks

      public Set<BlockList> getOuterCylindricalBlocks(Set<net.minecraft.util.math.BlockPos> posList)
    • getInnerRadialBlocks

      public Set<BlockList> getInnerRadialBlocks(Set<net.minecraft.util.math.BlockPos> posList)
    • getOuterRadialBlocks

      public Set<BlockList> getOuterRadialBlocks(Set<net.minecraft.util.math.BlockPos> posList)