Class AbstractBlockShapeBase

java.lang.Object
net.rodofire.easierworldcreator.shape.block.instanciator.AbstractBlockShapeBase
Direct Known Subclasses:
AbstractBlockShapePlaceType

public abstract class AbstractBlockShapeBase extends Object
Basic Class for Block Shape generation. This includes the basic needs for the shape generation.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Define the moment the shape will be placed.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    boolean used to determine if we have to use the custom chunk building provided by the mod or not
    protected static final int
    get the number of availible threads
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractBlockShapeBase(@NotNull net.minecraft.world.StructureWorldAccess world, @NotNull net.minecraft.util.math.BlockPos pos, @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment)
    init the ShapeBase
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addPosOffset(net.minecraft.util.math.BlockPos pos1)
    Adds the given offset to the current BlockPos.
    protected boolean
    canPlaceMultiChunk(Set<net.minecraft.util.math.ChunkPos> chunkPosSet)
     
    Returns the BlockLayerComparator associated with this object.
    List<Set<net.minecraft.util.math.BlockPos>>
    getBlockPosList(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> posSetMap)
    method to get the list of a set of blockPos based on a Map with chunkPos
    net.minecraft.util.math.BlockPos
     
    Retrieves the PlaceMoment associated with this object.
    @NotNull net.minecraft.util.math.BlockPos
    Retrieves the BlockPos associated with this object.
    @NotNull net.minecraft.world.StructureWorldAccess
    Retrieves the StructureWorldAccess associated with this object.
    boolean
    isMultiChunk(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> posSetMap)
    method to know if the shape should use multi-chunk feature
    void
    Sets the BlockLayerComparator for this object.
    void
    setOffset(net.minecraft.util.math.BlockPos offset)
    method to set an offset
    void
    allow you to set and change the place moment
    void
    setPos(@NotNull net.minecraft.util.math.BlockPos pos)
    Sets the BlockPos for this object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • multiChunk

      protected boolean multiChunk
      boolean used to determine if we have to use the custom chunk building provided by the mod or not
    • THREAD_COUNT

      protected static final int THREAD_COUNT
      get the number of availible threads
  • Constructor Details

    • AbstractBlockShapeBase

      public AbstractBlockShapeBase(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, @NotNull @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment)
      init the ShapeBase
      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

    • getOffset

      public net.minecraft.util.math.BlockPos getOffset()
    • setOffset

      public void setOffset(net.minecraft.util.math.BlockPos offset)
      method to set an offset
      Parameters:
      offset - the offset of the entire structure
    • getBlockLayer

      public BlockLayerComparator getBlockLayer()
      Returns the BlockLayerComparator associated with this object.
      Returns:
      the current BlockLayerComparator
    • setBlockLayer

      public void setBlockLayer(BlockLayerComparator blockLayer)
      Sets the BlockLayerComparator for this object.
      Parameters:
      blockLayer - the BlockLayerComparator to set
    • getPos

      @NotNull public @NotNull net.minecraft.util.math.BlockPos getPos()
      Retrieves the BlockPos associated with this object.
      Returns:
      the current BlockPos
    • setPos

      public void setPos(@NotNull @NotNull net.minecraft.util.math.BlockPos pos)
      Sets the BlockPos for this object.
      Parameters:
      pos - the BlockPos to set
      Throws:
      NullPointerException - if the provided pos is null
    • addPosOffset

      public void addPosOffset(net.minecraft.util.math.BlockPos pos1)
      Adds the given offset to the current BlockPos.
      Parameters:
      pos1 - the BlockPos to add as an offset
    • getWorld

      @NotNull public @NotNull net.minecraft.world.StructureWorldAccess getWorld()
      Retrieves the StructureWorldAccess associated with this object.
      Returns:
      the current StructureWorldAccess
    • getPlaceMoment

      @NotNull public @NotNull AbstractBlockShapeBase.PlaceMoment getPlaceMoment()
      Retrieves the PlaceMoment associated with this object.
      Returns:
      the current PlaceMoment
    • setPlaceMoment

      public void setPlaceMoment(@NotNull @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment)
      allow you to set and change the place moment
      Parameters:
      placeMoment - the changed parameter
    • getBlockPosList

      public List<Set<net.minecraft.util.math.BlockPos>> getBlockPosList(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> posSetMap)
      method to get the list of a set of blockPos based on a Map with chunkPos
      Parameters:
      posSetMap - the map that will be converted
      Returns:
      the converted collection
    • isMultiChunk

      public boolean isMultiChunk(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> posSetMap)
      method to know if the shape should use multi-chunk feature
      Parameters:
      posSetMap - the map that will determine if the shape is multi-chunk
      Returns:
      true if it is, false if not
    • canPlaceMultiChunk

      protected boolean canPlaceMultiChunk(Set<net.minecraft.util.math.ChunkPos> chunkPosSet)