public interface ISelectionManager
Modifier and Type | Method and Description |
---|---|
ISelection |
addSelection(BetterBlockPos pos1,
BetterBlockPos pos2)
Adds a new
ISelection constructed from the given block positions. |
ISelection |
addSelection(ISelection selection)
Adds a new selection.
|
ISelection |
contract(ISelection selection,
net.minecraft.util.EnumFacing direction,
int blocks)
Replaces the specified
ISelection with one contracted in the specified direction by the specified number
of blocks. |
ISelection |
expand(ISelection selection,
net.minecraft.util.EnumFacing direction,
int blocks)
Replaces the specified
ISelection with one expanded in the specified direction by the specified number of
blocks. |
ISelection |
getLastSelection()
This method will always return the last selection.
|
ISelection |
getOnlySelection()
For anything expecting only one selection, this method is provided.
|
ISelection[] |
getSelections() |
ISelection[] |
removeAllSelections()
Removes all selections.
|
ISelection |
removeSelection(ISelection selection)
Removes the selection from the current selections.
|
ISelection |
shift(ISelection selection,
net.minecraft.util.EnumFacing direction,
int blocks)
Replaces the specified
ISelection with one shifted in the specified direction by the specified number of
blocks. |
ISelection addSelection(ISelection selection)
selection
- The new selection to add.ISelection addSelection(BetterBlockPos pos1, BetterBlockPos pos2)
ISelection
constructed from the given block positions. The new selection is returned.pos1
- One corner of the selectionpos2
- The new corner of the selectionISelection removeSelection(ISelection selection)
selection
- The selection to remove.ISelection[] removeAllSelections()
ISelection[] getSelections()
ISelection getOnlySelection()
ISelection getLastSelection()
getOnlySelection()
or, ideally,
getSelections()
for retrieving the content of selections.ISelection expand(ISelection selection, net.minecraft.util.EnumFacing direction, int blocks)
ISelection
with one expanded in the specified direction by the specified number of
blocks. Returns the new selection.selection
- The selection to expand.direction
- The direction to expand the selection.blocks
- How many blocks to expand it.ISelection contract(ISelection selection, net.minecraft.util.EnumFacing direction, int blocks)
ISelection
with one 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.
selection
- The selection to contract.direction
- The direction to contract the selection.blocks
- How many blocks to contract it.ISelection shift(ISelection selection, net.minecraft.util.EnumFacing direction, int blocks)
ISelection
with one shifted in the specified direction by the specified number of
blocks. This moves the whole selection.selection
- The selection to shift.direction
- The direction to shift the selection.blocks
- How many blocks to shift it.