java.lang.Object
net.rodofire.easierworldcreator.shape.block.layer.LayerManager
All Implemented Interfaces:
Layer

public class LayerManager extends Object implements Layer
Class to assign BlockStates based on coordinates. For that, we need a BlockLayerManager. It allows us to define which blocks will go where. This class will choose which block to assign depending on LayerManager.Type. For example based on this shape:
     
     BlockLayer layer1, layer2, layer3

     BlockLayerManager manager = new BlockLayerManager(
          List.of(layer1, layer2, layer3),
          List.of((short)1, (short)2, (short)5
     );

     LayerManager layerManager = new LayerManager(Type.SURFACE, manager);
     
     
The layer assignement will result on this:
       
             * * *                  1 1 1
         * * * * * *            1 1 2 2 2 1
       * * * * * * *          1 2 2 2 2 2 2
       * * * * * * *      ->  2 2 2 3 3 3 2
       * * * * * * * *        2 3 3 3 3 3 3 1
       * * * * * * * *        3 3 3 3 3 3 3 2
       
       
Then, after choosing the layer, we choose which block of the layer will be placed. For more information, see BlockLayer
  • Field Details

    • centerPos

      protected net.minecraft.util.math.Vec3d centerPos
    • directionVector

      protected net.minecraft.util.math.Vec3i directionVector
  • Constructor Details

  • Method Details

    • get

      public BlockListManager get(Map<net.minecraft.util.math.ChunkPos,it.unimi.dsi.fastutil.longs.LongOpenHashSet> posMap)
      Specified by:
      get in interface Layer
    • place

      public void place(net.minecraft.world.StructureWorldAccess world, Map<net.minecraft.util.math.ChunkPos,it.unimi.dsi.fastutil.longs.LongOpenHashSet> posMap)
      Specified by:
      place in interface Layer
    • getVerified

      public BlockListManager getVerified(net.minecraft.world.StructureWorldAccess world, Map<net.minecraft.util.math.ChunkPos,it.unimi.dsi.fastutil.longs.LongOpenHashSet> posMap)
      Specified by:
      getVerified in interface Layer
    • getDivided

      public DividedBlockListManager getDivided(Map<net.minecraft.util.math.ChunkPos,it.unimi.dsi.fastutil.longs.LongOpenHashSet> posMap)
      Specified by:
      getDivided in interface Layer
    • getVerifiedDivided

      public DividedBlockListManager getVerifiedDivided(net.minecraft.world.StructureWorldAccess world, Map<net.minecraft.util.math.ChunkPos,it.unimi.dsi.fastutil.longs.LongOpenHashSet> posMap)
      Specified by:
      getVerifiedDivided in interface Layer
    • get

      public <T extends Collection<net.minecraft.util.math.BlockPos>> BlockListManager get(T posList)
      Specified by:
      get in interface Layer
    • place

      public <T extends Collection<net.minecraft.util.math.BlockPos>> void place(net.minecraft.world.StructureWorldAccess world, T posList)
      Specified by:
      place in interface Layer
    • getVerified

      public <T extends Collection<net.minecraft.util.math.BlockPos>> BlockListManager getVerified(net.minecraft.world.StructureWorldAccess world, T posList)
      Specified by:
      getVerified in interface Layer
    • getDivided

      public <T extends Collection<net.minecraft.util.math.BlockPos>> DividedBlockListManager getDivided(T posList)
      Specified by:
      getDivided in interface Layer
    • getVerifiedDivided

      public <T extends Collection<net.minecraft.util.math.BlockPos>> DividedBlockListManager getVerifiedDivided(net.minecraft.world.StructureWorldAccess world, T posList)
      Specified by:
      getVerifiedDivided in interface Layer
    • get

      public <U extends it.unimi.dsi.fastutil.longs.AbstractLongCollection> BlockListManager get(U posList)
      Specified by:
      get in interface Layer
    • place

      public <U extends it.unimi.dsi.fastutil.longs.AbstractLongCollection> void place(net.minecraft.world.StructureWorldAccess world, U posList)
      Specified by:
      place in interface Layer
    • getVerified

      public <U extends it.unimi.dsi.fastutil.longs.AbstractLongCollection> BlockListManager getVerified(net.minecraft.world.StructureWorldAccess world, U posList)
      Specified by:
      getVerified in interface Layer
    • getDivided

      public <U extends it.unimi.dsi.fastutil.longs.AbstractLongCollection> DividedBlockListManager getDivided(U posList)
      Specified by:
      getDivided in interface Layer
    • getVerifiedDivided

      public <U extends it.unimi.dsi.fastutil.longs.AbstractLongCollection> DividedBlockListManager getVerifiedDivided(net.minecraft.world.StructureWorldAccess world, U posList)
      Specified by:
      getVerifiedDivided in interface Layer
    • getCenterPos

      public net.minecraft.util.math.Vec3d getCenterPos()
      Specified by:
      getCenterPos in interface Layer
    • setCenterPos

      public void setCenterPos(net.minecraft.util.math.Vec3d centerPos)
      Specified by:
      setCenterPos in interface Layer
    • getDirectionVector

      public net.minecraft.util.math.Vec3d getDirectionVector()
      Specified by:
      getDirectionVector in interface Layer
    • setDirectionVector

      public void setDirectionVector(net.minecraft.util.math.Vec3i directionVector)
      Specified by:
      setDirectionVector in interface Layer