Package baritone.api.selection
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 Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.phys.AABBaabb()contract(net.minecraft.core.Direction direction, int blocks) Returns a newISelectioncontracted in the specified direction by the specified number of blocks.expand(net.minecraft.core.Direction direction, int blocks) Returns a newISelectionexpanded in the specified direction by the specified number of blocks.max()min()pos1()pos2()shift(net.minecraft.core.Direction direction, int blocks) Returns a newISelectionshifted in the specified direction by the specified number of blocks.net.minecraft.core.Vec3isize()
-
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
BetterBlockPoswith 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
AABBencompassing all blocks in this selection.
-
expand
Returns a newISelectionexpanded 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
Returns a newISelectioncontracted 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
Returns a newISelectionshifted 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.
-