Class BlockPlaceUtil

java.lang.Object
net.rodofire.easierworldcreator.worldgenutil.BlockPlaceUtil

public class BlockPlaceUtil extends Object
Useful class to verify and place the block in the world.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.block.BlockState
    getBlockWith2DNoise(List<net.minecraft.block.BlockState> blocksToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)
     
    static net.minecraft.block.BlockState
    getBlockWith3DNoise(List<net.minecraft.block.BlockState> blocksToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)
     
    static net.minecraft.block.BlockState
    getBlockWithOrder(List<net.minecraft.block.BlockState> blocksToPlace, int i)
     
    static net.minecraft.block.BlockState
    getRandomBlock(List<net.minecraft.block.BlockState> blocksToPlace)
     
    static void
    placeBlockWith2DNoise(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.block.BlockState> blocksToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)
     
    static void
    placeBlockWith3DNoise(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.block.BlockState> blocksToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)
     
    static void
    placeBlockWithOrder(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.block.BlockState> blocksToPlace, net.minecraft.util.math.BlockPos pos, int i)
    Place the block corresponding to the index 'i'.
    static void
    placeRandomBlock(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.block.BlockState> blockToPlace, net.minecraft.util.math.BlockPos pos)
     
    static boolean
    set2dNoiseBlockWithVerification(net.minecraft.world.StructureWorldAccess world, boolean force, List<net.minecraft.block.Block> blocksToForce, List<net.minecraft.block.BlockState> blockToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)
    verify if it can put the block before placing it
    static boolean
    set3dNoiseBlockWithVerification(net.minecraft.world.StructureWorldAccess world, boolean force, List<net.minecraft.block.Block> blocksToForce, List<net.minecraft.block.BlockState> blockToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)
    verify if it can put the block before placing it
    static boolean
    setBlockWithOrderWithVerification(net.minecraft.world.StructureWorldAccess world, boolean force, List<net.minecraft.block.Block> blocksToForce, List<net.minecraft.block.BlockState> blocktoplace, net.minecraft.util.math.BlockPos pos, int i)
    verify if it can put the block before placing it
    static boolean
    setRandomBlockWithVerification(net.minecraft.world.StructureWorldAccess world, boolean force, List<net.minecraft.block.Block> blocksToForce, List<net.minecraft.block.BlockState> blocktoplace, net.minecraft.util.math.BlockPos pos)
    verify if it can put the block before placing it
    static boolean
    verifyBlock(net.minecraft.world.StructureWorldAccess world, boolean force, List<net.minecraft.block.Block> blocksToForce, net.minecraft.util.math.BlockPos pos)
    method to verify that the block is not an unbreakable block or not and to verify if the block can be put or not.

    Methods inherited from class java.lang.Object

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

    • BlockPlaceUtil

      public BlockPlaceUtil()
  • Method Details

    • verifyBlock

      public static boolean verifyBlock(net.minecraft.world.StructureWorldAccess world, boolean force, List<net.minecraft.block.Block> blocksToForce, net.minecraft.util.math.BlockPos pos)
      method to verify that the block is not an unbreakable block or not and to verify if the block can be put or not.
      Parameters:
      world - the world where the Block will be placed
      force - force the pos
      blocksToForce - list of blocks that can still be forced
      pos - the position of the block
      Returns:
    • setBlockWithOrderWithVerification

      public static boolean setBlockWithOrderWithVerification(net.minecraft.world.StructureWorldAccess world, boolean force, List<net.minecraft.block.Block> blocksToForce, List<net.minecraft.block.BlockState> blocktoplace, net.minecraft.util.math.BlockPos pos, int i)
      verify if it can put the block before placing it
      Parameters:
      world - the world where the Block will be placed
      force - force the pos
      blocksToForce - list of blocks that can still be forced
      blocktoplace - list of blocks to place
      pos - the position of the block
      i - the index of the stage we're at
      Returns:
      boolean (true if the block was placed, else false)
    • setRandomBlockWithVerification

      public static boolean setRandomBlockWithVerification(net.minecraft.world.StructureWorldAccess world, boolean force, List<net.minecraft.block.Block> blocksToForce, List<net.minecraft.block.BlockState> blocktoplace, net.minecraft.util.math.BlockPos pos)
      verify if it can put the block before placing it
      Parameters:
      world - the world where the Block will be placed
      force - force the pos
      blocksToForce - list of blocks that can still be forced
      blocktoplace - list of blocks to place
      pos - the position of the block
      Returns:
      boolean (true if the block was placed, else false)
    • set2dNoiseBlockWithVerification

      public static boolean set2dNoiseBlockWithVerification(net.minecraft.world.StructureWorldAccess world, boolean force, List<net.minecraft.block.Block> blocksToForce, List<net.minecraft.block.BlockState> blockToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)
      verify if it can put the block before placing it
      Parameters:
      world - the world where the Block will be placed
      force - force the pos
      blocksToForce - list of blocks that can still be forced
      blockToPlace - list of blocks to place
      pos - the position of the block
      noise - the 2d noise that will determine if the block can be placed
      Returns:
      boolean (true if the block was placed, else false)
    • set3dNoiseBlockWithVerification

      public static boolean set3dNoiseBlockWithVerification(net.minecraft.world.StructureWorldAccess world, boolean force, List<net.minecraft.block.Block> blocksToForce, List<net.minecraft.block.BlockState> blockToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)
      verify if it can put the block before placing it
      Parameters:
      world - the world where the Block will be placed
      force - force the pos
      blocksToForce - list of blocks that can still be forced
      blockToPlace - list of blocks to place
      pos - the position of the block
      noise - the 2d noise that will determine if the block can be placed
      Returns:
      boolean (true if the block was placed, else false)
    • placeRandomBlock

      public static void placeRandomBlock(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.block.BlockState> blockToPlace, net.minecraft.util.math.BlockPos pos)
      Parameters:
      world - the world where the Block will be placed
      blockToPlace - list of blocks to place
      pos - the position of the block
    • placeBlockWithOrder

      public static void placeBlockWithOrder(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.block.BlockState> blocksToPlace, net.minecraft.util.math.BlockPos pos, int i)
      Place the block corresponding to the index 'i'. Generally, after that, the index 'i' will be incremented by one every time this method is called. But you can change it to place 2 same blocks then incrementing
    • placeBlockWith2DNoise

      public static void placeBlockWith2DNoise(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.block.BlockState> blocksToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)
    • placeBlockWith3DNoise

      public static void placeBlockWith3DNoise(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.block.BlockState> blocksToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)
    • getRandomBlock

      public static net.minecraft.block.BlockState getRandomBlock(List<net.minecraft.block.BlockState> blocksToPlace)
    • getBlockWithOrder

      public static net.minecraft.block.BlockState getBlockWithOrder(List<net.minecraft.block.BlockState> blocksToPlace, int i)
    • getBlockWith2DNoise

      public static net.minecraft.block.BlockState getBlockWith2DNoise(List<net.minecraft.block.BlockState> blocksToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)
    • getBlockWith3DNoise

      public static net.minecraft.block.BlockState getBlockWith3DNoise(List<net.minecraft.block.BlockState> blocksToPlace, net.minecraft.util.math.BlockPos pos, FastNoiseLite noise)