Search in sources :

Example 6 with ISelection

use of baritone.api.selection.ISelection in project Spark-Client by Spark-Client-Development.

the class SelectionManager method expand.

@Override
public synchronized ISelection expand(ISelection selection, EnumFacing direction, int blocks) {
    for (ListIterator<ISelection> it = selections.listIterator(); it.hasNext(); ) {
        ISelection current = it.next();
        if (current == selection) {
            it.remove();
            it.add(current.expand(direction, blocks));
            resetSelectionsArr();
            return it.previous();
        }
    }
    return null;
}
Also used : ISelection(baritone.api.selection.ISelection)

Example 7 with ISelection

use of baritone.api.selection.ISelection in project Spark-Client by Spark-Client-Development.

the class SelectionManager method shift.

@Override
public synchronized ISelection shift(ISelection selection, EnumFacing direction, int blocks) {
    for (ListIterator<ISelection> it = selections.listIterator(); it.hasNext(); ) {
        ISelection current = it.next();
        if (current == selection) {
            it.remove();
            it.add(current.shift(direction, blocks));
            resetSelectionsArr();
            return it.previous();
        }
    }
    return null;
}
Also used : ISelection(baritone.api.selection.ISelection)

Example 8 with ISelection

use of baritone.api.selection.ISelection in project Spark-Client by Spark-Client-Development.

the class SelectionRenderer method renderSelections.

public static void renderSelections(ISelection[] selections) {
    float opacity = settings.selectionOpacity.getValue().floatValue();
    boolean ignoreDepth = settings.renderSelectionIgnoreDepth.getValue();
    float lineWidth = settings.selectionLineWidth.getValue().floatValue();
    if (!settings.renderSelection.getValue()) {
        return;
    }
    IRenderer.startLines(settings.colorSelection.getValue(), opacity, lineWidth, ignoreDepth);
    for (ISelection selection : selections) {
        IRenderer.drawAABB(selection.aabb(), SELECTION_BOX_EXPANSION);
    }
    if (settings.renderSelectionCorners.getValue()) {
        IRenderer.glColor(settings.colorSelectionPos1.getValue(), opacity);
        for (ISelection selection : selections) {
            IRenderer.drawAABB(new AxisAlignedBB(selection.pos1(), selection.pos1().add(1, 1, 1)));
        }
        IRenderer.glColor(settings.colorSelectionPos2.getValue(), opacity);
        for (ISelection selection : selections) {
            IRenderer.drawAABB(new AxisAlignedBB(selection.pos2(), selection.pos2().add(1, 1, 1)));
        }
    }
    IRenderer.endLines(ignoreDepth);
}
Also used : AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) ISelection(baritone.api.selection.ISelection)

Example 9 with ISelection

use of baritone.api.selection.ISelection in project baritone by cabaletta.

the class SelectionManager method shift.

@Override
public synchronized ISelection shift(ISelection selection, EnumFacing direction, int blocks) {
    for (ListIterator<ISelection> it = selections.listIterator(); it.hasNext(); ) {
        ISelection current = it.next();
        if (current == selection) {
            it.remove();
            it.add(current.shift(direction, blocks));
            resetSelectionsArr();
            return it.previous();
        }
    }
    return null;
}
Also used : ISelection(baritone.api.selection.ISelection)

Example 10 with ISelection

use of baritone.api.selection.ISelection in project baritone by cabaletta.

the class SelectionManager method contract.

@Override
public synchronized ISelection contract(ISelection selection, EnumFacing direction, int blocks) {
    for (ListIterator<ISelection> it = selections.listIterator(); it.hasNext(); ) {
        ISelection current = it.next();
        if (current == selection) {
            it.remove();
            it.add(current.contract(direction, blocks));
            resetSelectionsArr();
            return it.previous();
        }
    }
    return null;
}
Also used : ISelection(baritone.api.selection.ISelection)

Aggregations

ISelection (baritone.api.selection.ISelection)10 ForBlockOptionalMeta (baritone.api.command.datatypes.ForBlockOptionalMeta)2 ForEnumFacing (baritone.api.command.datatypes.ForEnumFacing)2 RelativeBlockPos (baritone.api.command.datatypes.RelativeBlockPos)2 CommandInvalidStateException (baritone.api.command.exception.CommandInvalidStateException)2 CommandInvalidTypeException (baritone.api.command.exception.CommandInvalidTypeException)2 BetterBlockPos (baritone.api.utils.BetterBlockPos)2 BlockOptionalMeta (baritone.api.utils.BlockOptionalMeta)2 BlockOptionalMetaLookup (baritone.api.utils.BlockOptionalMetaLookup)2 List (java.util.List)2 EnumFacing (net.minecraft.util.EnumFacing)2 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)2 BlockPos (net.minecraft.util.math.BlockPos)2 Vec3i (net.minecraft.util.math.Vec3i)2 BlockStateInterface (baritone.utils.BlockStateInterface)1 StaticSchematic (baritone.utils.schematic.StaticSchematic)1 IBlockState (net.minecraft.block.state.IBlockState)1