Class AbstractBlockShapeLayer

Direct Known Subclasses:
AbstractBlockShapeRotation

public abstract class AbstractBlockShapeLayer extends AbstractBlockShapePlaceType
  • Constructor Details

    • AbstractBlockShapeLayer

      public AbstractBlockShapeLayer(@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)
      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
    • AbstractBlockShapeLayer

      public AbstractBlockShapeLayer(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, @NotNull @NotNull AbstractBlockShapeBase.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 AbstractBlockShapeLayer.LayersType getLayersType()
      used to get the layerType initialized
      Returns:
      the layer type of the shape
    • setLayersType

      public void setLayersType(AbstractBlockShapeLayer.LayersType layersType)
      used to change the layerType
      Parameters:
      layersType - the layer type that will replace the actual one
    • 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 DefaultBlockListComparator 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
    • getLayersWithVerification

      public DefaultBlockListComparator getLayersWithVerification(Set<net.minecraft.util.math.BlockPos> firstPosList, Map<net.minecraft.util.math.BlockPos,net.minecraft.block.BlockState> blockStateMap)
    • placeLayers

      public void placeLayers(Set<net.minecraft.util.math.BlockPos> firstPosList)
      place the layers of the structure depending on the AbstractBlockShapeLayer.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)
    • getVerifiedInnerCylindricalBlocks

      public void getVerifiedInnerCylindricalBlocks(Set<net.minecraft.util.math.BlockPos> posList, Map<net.minecraft.util.math.BlockPos,net.minecraft.block.BlockState> blockStateMap, DefaultBlockListComparator comparator)
    • getVerifiedOuterCylindricalBlocks

      public void getVerifiedOuterCylindricalBlocks(Set<net.minecraft.util.math.BlockPos> posList, Map<net.minecraft.util.math.BlockPos,net.minecraft.block.BlockState> blockStateMap, DefaultBlockListComparator comparator)
    • getVerifiedInnerRadialBlocks

      public void getVerifiedInnerRadialBlocks(Set<net.minecraft.util.math.BlockPos> posList, Map<net.minecraft.util.math.BlockPos,net.minecraft.block.BlockState> blockStateMap, DefaultBlockListComparator comparator)
    • getVerifiedOuterRadialBlocks

      public void getVerifiedOuterRadialBlocks(Set<net.minecraft.util.math.BlockPos> posList, Map<net.minecraft.util.math.BlockPos,net.minecraft.block.BlockState> blockStateMap, DefaultBlockListComparator comparator)
    • getInnerCylindricalBlocks

      public void getInnerCylindricalBlocks(Set<net.minecraft.util.math.BlockPos> posList, DefaultBlockListComparator comparator)
    • getOuterCylindricalBlocks

      public void getOuterCylindricalBlocks(Set<net.minecraft.util.math.BlockPos> posList, DefaultBlockListComparator comparator)
    • getInnerRadialBlocks

      public void getInnerRadialBlocks(Set<net.minecraft.util.math.BlockPos> posList, DefaultBlockListComparator comparator)
    • getOuterRadialBlocks

      public void getOuterRadialBlocks(Set<net.minecraft.util.math.BlockPos> posList, DefaultBlockListComparator comparator)