Review 2
This commit is contained in:
parent
957f62ffbb
commit
aefc82e47c
@ -17,32 +17,14 @@
|
||||
|
||||
package baritone.api.schematic;
|
||||
|
||||
import baritone.api.IBaritone;
|
||||
import baritone.api.utils.IPlayerContext;
|
||||
import baritone.api.utils.ISchematic;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractSchematic implements ISchematic {
|
||||
protected final IBaritone baritone;
|
||||
protected final IPlayerContext ctx;
|
||||
protected int x;
|
||||
protected int y;
|
||||
protected int z;
|
||||
|
||||
public AbstractSchematic(IBaritone baritone, int x, int y, int z) {
|
||||
this.baritone = baritone;
|
||||
this.ctx = baritone == null ? null : baritone.getPlayerContext();
|
||||
public AbstractSchematic(int x, int y, int z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
package baritone.api.schematic;
|
||||
|
||||
import baritone.api.IBaritone;
|
||||
import baritone.api.utils.ISchematic;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
@ -38,8 +37,8 @@ public class CompositeSchematic extends AbstractSchematic {
|
||||
}
|
||||
}
|
||||
|
||||
public CompositeSchematic(IBaritone baritone, int x, int y, int z) {
|
||||
super(baritone, x, y, z);
|
||||
public CompositeSchematic(int x, int y, int z) {
|
||||
super(x, y, z);
|
||||
schematics = new ArrayList<>();
|
||||
recalcArr();
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
package baritone.api.schematic;
|
||||
|
||||
import baritone.api.IBaritone;
|
||||
import baritone.api.utils.BlockOptionalMeta;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
@ -27,8 +26,8 @@ import java.util.List;
|
||||
public class FillSchematic extends AbstractSchematic {
|
||||
private final BlockOptionalMeta bom;
|
||||
|
||||
public FillSchematic(IBaritone baritone, int x, int y, int z, BlockOptionalMeta bom) {
|
||||
super(baritone, x, y, z);
|
||||
public FillSchematic(int x, int y, int z, BlockOptionalMeta bom) {
|
||||
super(x, y, z);
|
||||
this.bom = bom;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
package baritone.api.schematic;
|
||||
|
||||
import baritone.api.IBaritone;
|
||||
import baritone.api.utils.ISchematic;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
@ -26,8 +25,8 @@ import java.util.List;
|
||||
public abstract class MaskSchematic extends AbstractSchematic {
|
||||
private final ISchematic schematic;
|
||||
|
||||
public MaskSchematic(IBaritone baritone, ISchematic schematic) {
|
||||
super(baritone, schematic.widthX(), schematic.heightY(), schematic.lengthZ());
|
||||
public MaskSchematic(ISchematic schematic) {
|
||||
super(schematic.widthX(), schematic.heightY(), schematic.lengthZ());
|
||||
this.schematic = schematic;
|
||||
}
|
||||
|
||||
@ -35,7 +34,7 @@ public abstract class MaskSchematic extends AbstractSchematic {
|
||||
|
||||
@Override
|
||||
public boolean inSchematic(int x, int y, int z, IBlockState currentState) {
|
||||
return schematic.inSchematic(x, y, z, currentState) && partOfMask(x, y, z, currentState);
|
||||
return partOfMask(x, y, z, currentState) && schematic.inSchematic(x, y, z, currentState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
package baritone.api.schematic;
|
||||
|
||||
import baritone.api.IBaritone;
|
||||
import baritone.api.utils.BlockOptionalMetaLookup;
|
||||
import baritone.api.utils.ISchematic;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@ -26,15 +25,18 @@ public class ReplaceSchematic extends MaskSchematic {
|
||||
private final BlockOptionalMetaLookup filter;
|
||||
private final Boolean[][][] cache;
|
||||
|
||||
public ReplaceSchematic(IBaritone baritone, ISchematic schematic, BlockOptionalMetaLookup filter) {
|
||||
super(baritone, schematic);
|
||||
public ReplaceSchematic(ISchematic schematic, BlockOptionalMetaLookup filter) {
|
||||
super(schematic);
|
||||
this.filter = filter;
|
||||
this.cache = new Boolean[widthX()][heightY()][lengthZ()];
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean partOfMask(int x, int y, int z, IBlockState currentState) {
|
||||
return cache[x][y][z] == null
|
||||
? cache[x][y][z] = filter.has(currentState)
|
||||
: cache[x][y][z];
|
||||
if (cache[x][y][z] == null) {
|
||||
cache[x][y][z] = filter.has(currentState);
|
||||
}
|
||||
|
||||
return cache[x][y][z];
|
||||
}
|
||||
}
|
||||
|
@ -17,15 +17,15 @@
|
||||
|
||||
package baritone.api.schematic;
|
||||
|
||||
import baritone.api.IBaritone;
|
||||
import baritone.api.utils.ISchematic;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
public class ShellSchematic extends MaskSchematic {
|
||||
public ShellSchematic(IBaritone baritone, ISchematic schematic) {
|
||||
super(baritone, schematic);
|
||||
public ShellSchematic(ISchematic schematic) {
|
||||
super(schematic);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean partOfMask(int x, int y, int z, IBlockState currentState) {
|
||||
return x == 0 || y == 0 || z == 0 || x == widthX() - 1 || y == heightY() - 1 || z == lengthZ() - 1;
|
||||
}
|
||||
|
@ -17,15 +17,15 @@
|
||||
|
||||
package baritone.api.schematic;
|
||||
|
||||
import baritone.api.IBaritone;
|
||||
import baritone.api.utils.ISchematic;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
public class WallsSchematic extends MaskSchematic {
|
||||
public WallsSchematic(IBaritone baritone, ISchematic schematic) {
|
||||
super(baritone, schematic);
|
||||
public WallsSchematic(ISchematic schematic) {
|
||||
super(schematic);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean partOfMask(int x, int y, int z, IBlockState currentState) {
|
||||
return x == 0 || z == 0 || x == widthX() - 1 || z == lengthZ() - 1;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class ArgParserManager {
|
||||
public static final Registry<ArgParser> REGISTRY = new Registry<>();
|
||||
|
||||
static {
|
||||
DefaultArgParsers.all.forEach(REGISTRY::register);
|
||||
DefaultArgParsers.ALL.forEach(REGISTRY::register);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -113,7 +113,7 @@ public class DefaultArgParsers {
|
||||
}
|
||||
}
|
||||
|
||||
public static final List<ArgParser<?>> all = asList(
|
||||
public static final List<ArgParser<?>> ALL = asList(
|
||||
IntArgumentParser.INSTANCE,
|
||||
LongArgumentParser.INSTANCE,
|
||||
FloatArgumentParser.INSTANCE,
|
||||
|
@ -28,7 +28,6 @@ import net.minecraft.util.EnumFacing;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@ -67,15 +66,10 @@ public class CommandArgument {
|
||||
* @see ArgConsumer#getEnumOrNull(Class)
|
||||
*/
|
||||
public <E extends Enum<?>> E getEnum(Class<E> enumClass) {
|
||||
try {
|
||||
//noinspection OptionalGetWithoutIsPresent
|
||||
return Arrays.stream(enumClass.getEnumConstants())
|
||||
.filter(e -> e.name().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.get();
|
||||
} catch (NoSuchElementException e) {
|
||||
throw new CommandInvalidTypeException(this, enumClass.getSimpleName());
|
||||
}
|
||||
return Arrays.stream(enumClass.getEnumConstants())
|
||||
.filter(e -> e.name().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new CommandInvalidTypeException(this, enumClass.getSimpleName()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,8 +25,6 @@ import baritone.api.utils.command.helpers.tabcomplete.TabCompleteHelper;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class ForWaypoints implements IDatatypeFor<IWaypoint[]> {
|
||||
@ -88,14 +86,8 @@ public class ForWaypoints implements IDatatypeFor<IWaypoint[]> {
|
||||
}
|
||||
|
||||
public static IWaypoint[] getWaypointsByName(String name) {
|
||||
Set<IWaypoint> found = new HashSet<>();
|
||||
|
||||
for (IWaypoint waypoint : getWaypoints()) {
|
||||
if (waypoint.getName().equalsIgnoreCase(name)) {
|
||||
found.add(waypoint);
|
||||
}
|
||||
}
|
||||
|
||||
return found.toArray(new IWaypoint[0]);
|
||||
return Arrays.stream(getWaypoints())
|
||||
.filter(waypoint -> waypoint.getName().equalsIgnoreCase(name))
|
||||
.toArray(IWaypoint[]::new);
|
||||
}
|
||||
}
|
||||
|
@ -39,13 +39,13 @@ public class PlayerByUsername implements IDatatypeFor<EntityPlayer> {
|
||||
public PlayerByUsername(ArgConsumer consumer) {
|
||||
String username = consumer.getString();
|
||||
|
||||
if (isNull(
|
||||
player = players
|
||||
.stream()
|
||||
.filter(s -> s.getName().equalsIgnoreCase(username))
|
||||
.findFirst()
|
||||
.orElse(null)
|
||||
)) {
|
||||
player = players
|
||||
.stream()
|
||||
.filter(s -> s.getName().equalsIgnoreCase(username))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (isNull(player)) {
|
||||
throw new IllegalArgumentException("no player found by that username");
|
||||
}
|
||||
}
|
||||
|
@ -420,22 +420,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @param datatype The datatype to get
|
||||
* @return The datatype instance
|
||||
* @see IDatatype
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T extends IDatatype> T peekDatatype(Class<T> datatype) {
|
||||
return clone().getDatatype(datatype);
|
||||
@ -453,22 +437,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @param datatype The datatype to get
|
||||
* @return The datatype instance, or {@code null} if it throws an exception
|
||||
* @see IDatatype
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T extends IDatatype> T peekDatatypeOrNull(Class<T> datatype) {
|
||||
return clone().getDatatypeOrNull(datatype);
|
||||
@ -487,22 +455,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance
|
||||
* @see IDatatype
|
||||
* @see IDatatypePost
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, O, D extends IDatatypePost<T, O>> T peekDatatypePost(Class<D> datatype, O original) {
|
||||
return clone().getDatatypePost(datatype, original);
|
||||
@ -522,22 +474,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance, or {@code def} if it throws an exception
|
||||
* @see IDatatype
|
||||
* @see IDatatypePost
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, O, D extends IDatatypePost<T, O>> T peekDatatypePostOrDefault(Class<D> datatype, O original, T def) {
|
||||
return clone().getDatatypePostOrDefault(datatype, original, def);
|
||||
@ -556,22 +492,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance, or {@code null} if it throws an exception
|
||||
* @see IDatatype
|
||||
* @see IDatatypePost
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, O, D extends IDatatypePost<T, O>> T peekDatatypePostOrNull(Class<D> datatype, O original) {
|
||||
return peekDatatypePostOrDefault(datatype, original, null);
|
||||
@ -590,22 +510,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance
|
||||
* @see IDatatype
|
||||
* @see IDatatypeFor
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, D extends IDatatypeFor<T>> T peekDatatypeFor(Class<D> datatype) {
|
||||
return clone().peekDatatypeFor(datatype);
|
||||
@ -625,22 +529,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance, or {@code def} if it throws an exception
|
||||
* @see IDatatype
|
||||
* @see IDatatypeFor
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, D extends IDatatypeFor<T>> T peekDatatypeForOrDefault(Class<D> datatype, T def) {
|
||||
return clone().peekDatatypeForOrDefault(datatype, def);
|
||||
@ -659,22 +547,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance, or {@code null} if it throws an exception
|
||||
* @see IDatatype
|
||||
* @see IDatatypeFor
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, D extends IDatatypeFor<T>> T peekDatatypeForOrNull(Class<D> datatype) {
|
||||
return peekDatatypeForOrDefault(datatype, null);
|
||||
@ -849,22 +721,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @param datatype The datatype to get
|
||||
* @return The datatype instance
|
||||
* @see IDatatype
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T extends IDatatype> T getDatatype(Class<T> datatype) {
|
||||
try {
|
||||
@ -888,22 +744,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @param datatype The datatype to get
|
||||
* @return The datatype instance, or {@code null} if it throws an exception
|
||||
* @see IDatatype
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T extends IDatatype> T getDatatypeOrNull(Class<T> datatype) {
|
||||
List<CommandArgument> argsSnapshot = new ArrayList<>(args);
|
||||
@ -932,22 +772,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance
|
||||
* @see IDatatype
|
||||
* @see IDatatypePost
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, O, D extends IDatatypePost<T, O>> T getDatatypePost(Class<D> datatype, O original) {
|
||||
return getDatatype(datatype).apply(original);
|
||||
@ -967,22 +791,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance, or {@code def} if it throws an exception
|
||||
* @see IDatatype
|
||||
* @see IDatatypePost
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, O, D extends IDatatypePost<T, O>> T getDatatypePostOrDefault(Class<D> datatype, O original, T def) {
|
||||
List<CommandArgument> argsSnapshot = new ArrayList<>(args);
|
||||
@ -1013,22 +821,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance, or {@code null} if it throws an exception
|
||||
* @see IDatatype
|
||||
* @see IDatatypePost
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, O, D extends IDatatypePost<T, O>> T getDatatypePostOrNull(Class<D> datatype, O original) {
|
||||
return getDatatypePostOrDefault(datatype, original, null);
|
||||
@ -1045,22 +837,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance
|
||||
* @see IDatatype
|
||||
* @see IDatatypeFor
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, D extends IDatatypeFor<T>> T getDatatypeFor(Class<D> datatype) {
|
||||
return getDatatype(datatype).get();
|
||||
@ -1080,22 +856,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance, or {@code def} if it throws an exception
|
||||
* @see IDatatype
|
||||
* @see IDatatypeFor
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, D extends IDatatypeFor<T>> T getDatatypeForOrDefault(Class<D> datatype, T def) {
|
||||
List<CommandArgument> argsSnapshot = new ArrayList<>(args);
|
||||
@ -1126,22 +886,6 @@ public class ArgConsumer implements Cloneable {
|
||||
* @return The datatype instance, or {@code null} if it throws an exception
|
||||
* @see IDatatype
|
||||
* @see IDatatypeFor
|
||||
* @see #getDatatype(Class)
|
||||
* @see #getDatatypeOrNull(Class)
|
||||
* @see #getDatatypePost(Class, Object)
|
||||
* @see #getDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #getDatatypePostOrNull(Class, Object)
|
||||
* @see #getDatatypeFor(Class)
|
||||
* @see #getDatatypeForOrDefault(Class, Object)
|
||||
* @see #getDatatypeForOrNull(Class)
|
||||
* @see #peekDatatype(Class)
|
||||
* @see #peekDatatypeOrNull(Class)
|
||||
* @see #peekDatatypePost(Class, Object)
|
||||
* @see #peekDatatypePostOrDefault(Class, Object, Object)
|
||||
* @see #peekDatatypePostOrNull(Class, Object)
|
||||
* @see #peekDatatypeFor(Class)
|
||||
* @see #peekDatatypeForOrDefault(Class, Object)
|
||||
* @see #peekDatatypeForOrNull(Class)
|
||||
*/
|
||||
public <T, D extends IDatatypeFor<T>> T getDatatypeForOrNull(Class<D> datatype) {
|
||||
return getDatatypeForOrDefault(datatype, null);
|
||||
|
@ -47,12 +47,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.GL_LIGHTING_BIT;
|
||||
import static org.lwjgl.opengl.GL11.GL_LINES;
|
||||
import static org.lwjgl.opengl.GL11.GL_LINE_LOOP;
|
||||
import static org.lwjgl.opengl.GL11.GL_LINE_STRIP;
|
||||
import static org.lwjgl.opengl.GL11.glPopAttrib;
|
||||
import static org.lwjgl.opengl.GL11.glPushAttrib;
|
||||
import static org.lwjgl.opengl.GL11.*;
|
||||
|
||||
/**
|
||||
* @author Brady
|
||||
|
@ -137,7 +137,7 @@ public class SelCommand extends Command {
|
||||
}
|
||||
|
||||
BetterBlockPos origin = selections[0].min();
|
||||
CompositeSchematic composite = new CompositeSchematic(baritone, 0, 0, 0);
|
||||
CompositeSchematic composite = new CompositeSchematic(0, 0, 0);
|
||||
|
||||
for (ISelection selection : selections) {
|
||||
BetterBlockPos min = selection.min();
|
||||
@ -152,14 +152,14 @@ public class SelCommand extends Command {
|
||||
Vec3i size = selection.size();
|
||||
BetterBlockPos min = selection.min();
|
||||
|
||||
ISchematic schematic = new FillSchematic(baritone, size.getX(), size.getY(), size.getZ(), type);
|
||||
ISchematic schematic = new FillSchematic(size.getX(), size.getY(), size.getZ(), type);
|
||||
|
||||
if (action == Action.WALLS) {
|
||||
schematic = new WallsSchematic(baritone, schematic);
|
||||
schematic = new WallsSchematic(schematic);
|
||||
} else if (action == Action.SHELL) {
|
||||
schematic = new ShellSchematic(baritone, schematic);
|
||||
schematic = new ShellSchematic(schematic);
|
||||
} else if (action == Action.REPLACE) {
|
||||
schematic = new ReplaceSchematic(baritone, schematic, replaces);
|
||||
schematic = new ReplaceSchematic(schematic, replaces);
|
||||
}
|
||||
|
||||
composite.put(schematic, min.x - origin.x, min.y - origin.y, min.z - origin.z);
|
||||
|
Loading…
x
Reference in New Issue
Block a user