Interface ISelection


public interface ISelection
A selection is an immutable object representing the current selection. The selection is commonly used for certain types of build commands, however it can be used for anything.
  • Method Details

    • pos1

      Returns:
      The first corner of this selection. This is meant to preserve the user's original first corner.
    • pos2

      Returns:
      The second corner of this selection. This is meant to preserve the user's original second corner.
    • min

      Returns:
      The BetterBlockPos with the lowest x, y, and z position in the selection.
    • max

      Returns:
      The opposite corner from the min().
    • size

      net.minecraft.core.Vec3i size()
      Returns:
      The size of this ISelection.
    • aabb

      net.minecraft.world.phys.AABB aabb()
      Returns:
      An AABB encompassing all blocks in this selection.
    • expand

      ISelection expand(net.minecraft.core.Direction direction, int blocks)
      Returns a new ISelection expanded in the specified direction by the specified number of blocks.
      Parameters:
      direction - The direction to expand the selection.
      blocks - How many blocks to expand it.
      Returns:
      A new selection, expanded as specified.
    • contract

      ISelection contract(net.minecraft.core.Direction direction, int blocks)
      Returns a new ISelection contracted in the specified direction by the specified number of blocks.

      Note that, for example, if the direction specified is UP, the bottom of the selection will be shifted up. If it is DOWN, the top of the selection will be shifted down.

      Parameters:
      direction - The direction to contract the selection.
      blocks - How many blocks to contract it.
      Returns:
      A new selection, contracted as specified.
    • shift

      ISelection shift(net.minecraft.core.Direction direction, int blocks)
      Returns a new ISelection shifted in the specified direction by the specified number of blocks. This moves the whole selection.
      Parameters:
      direction - The direction to shift the selection.
      blocks - How many blocks to shift it.
      Returns:
      A new selection, shifted as specified.