Class AbstractBlockShapePlaceType

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

public abstract class AbstractBlockShapePlaceType extends AbstractBlockShapeBase
  • Constructor Details

    • AbstractBlockShapePlaceType

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

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

    • setLayerPlace

      public void setLayerPlace(AbstractBlockShapePlaceType.LayerPlace layerPlace)
    • getLayerPlace

    • setNoise

      public void setNoise(FastNoiseLite noise)
    • getNoise

      public FastNoiseLite getNoise()
    • placeBlocks

      public void placeBlocks(int index, net.minecraft.util.math.BlockPos pos)
      place blocks without verification
      Parameters:
      index - the index of the the BlockLayer
      pos - the pos of the block
    • placeBlocks

      public void placeBlocks(List<net.minecraft.block.BlockState> states, net.minecraft.util.math.BlockPos pos)
      Place blocks without verification. Used for precomputed List<BlockStates> instead of searching it on the BlockLayer
      Parameters:
      states - states the states that will be chosen
      pos - the pos of the block
    • placeBlocksWithVerification

      public boolean placeBlocksWithVerification(int index, net.minecraft.util.math.BlockPos pos)
      place a block in the this.getWorld() at the pos if it is able to
      Parameters:
      index - the index of the the BlockLayer
      pos - the pos of the block
      Returns:
      boolean if the block was placed
    • placeBlocksWithVerification

      public boolean placeBlocksWithVerification(List<net.minecraft.block.BlockState> states, net.minecraft.util.math.BlockPos pos, boolean force, Set<net.minecraft.block.Block> blocksToForce)
      place a block in the this.getWorld() at the pos if it is able to. precomputed list for little performance improvement
      Parameters:
      states - the states that will be chosen
      pos - the pos of the block
      force - determine if the block can be posed on top of any block
      blocksToForce - set of blocks that determine the blocks that can be still forced
      Returns:
      boolean if the block was placed
    • placeBlocksWithVerification

      public boolean placeBlocksWithVerification(List<net.minecraft.block.BlockState> states, net.minecraft.util.math.BlockPos pos)
      place a block in the this.getWorld() at the pos if it is able to. precomputed list for little performance improvement
      Parameters:
      states - the states that will be chosen
      pos - the pos of the block
      Returns:
      boolean if the block was placed
    • getBlockToPlace

      public net.minecraft.block.BlockState getBlockToPlace(int index, net.minecraft.util.math.BlockPos pos)
      Used to get the blocksState notably used during this.getWorld() gen, this doesn't place anything
      Parameters:
      index - the index of the the BlockLayer
      pos - the pos of the block
      Returns:
      the BlockState related to the pos
    • getBlockToPlace

      public net.minecraft.block.BlockState getBlockToPlace(List<net.minecraft.block.BlockState> states, net.minecraft.util.math.BlockPos pos)
      Used to get the blocksState notably used during this.getWorld() gen, this doesn't place anything. Used for a precomputed BlockState list
      Parameters:
      states - the states that will be chosen
      pos - the pos of the block
      Returns:
      the BlockState related to the pos
    • verifyBlocks

      public boolean verifyBlocks(net.minecraft.util.math.BlockPos pos)
      method to know if the block can be placed
      Parameters:
      pos - the blockPos that will be tested
      Returns:
      true if it can be placed, false if not
    • verifyBlocks

      public boolean verifyBlocks(net.minecraft.util.math.BlockPos pos, Set<net.minecraft.block.Block> blocksToForce, boolean force)
      method to know if the block can be placed
      Parameters:
      pos - the blockPos that will be tested
      blocksToForce - the blocks that can be forced
      force - if true, all blocks will be forced, except blocks like bedrock or end portals
      Returns:
      true if it can be placed, false if not
    • verifyBlocks

      public boolean verifyBlocks(net.minecraft.util.math.BlockPos pos, Set<net.minecraft.block.Block> blocksToForce, boolean force, Map<net.minecraft.util.math.BlockPos,net.minecraft.block.BlockState> blockStateMap)