"stAnDaRd" ConTinuATion InDEnT
This commit is contained in:
parent
9db07faf49
commit
c54dcdba24
@ -88,15 +88,15 @@ public class BaritoneChatControl implements Helper, AbstractGameEventListener {
|
||||
|
||||
ITextComponent component = new TextComponentString(String.format("> %s", toDisplay));
|
||||
component.getStyle()
|
||||
.setColor(TextFormatting.WHITE)
|
||||
.setHoverEvent(new HoverEvent(
|
||||
HoverEvent.Action.SHOW_TEXT,
|
||||
new TextComponentString("Click to rerun command")
|
||||
))
|
||||
.setClickEvent(new ClickEvent(
|
||||
ClickEvent.Action.RUN_COMMAND,
|
||||
FORCE_COMMAND_PREFIX + msg
|
||||
));
|
||||
.setColor(TextFormatting.WHITE)
|
||||
.setHoverEvent(new HoverEvent(
|
||||
HoverEvent.Action.SHOW_TEXT,
|
||||
new TextComponentString("Click to rerun command")
|
||||
))
|
||||
.setClickEvent(new ClickEvent(
|
||||
ClickEvent.Action.RUN_COMMAND,
|
||||
FORCE_COMMAND_PREFIX + msg
|
||||
));
|
||||
|
||||
logDirect(component);
|
||||
}
|
||||
@ -195,10 +195,10 @@ public class BaritoneChatControl implements Helper, AbstractGameEventListener {
|
||||
if (argc.hasAtMost(2)) {
|
||||
if (argc.hasExactly(1)) {
|
||||
return new TabCompleteHelper()
|
||||
.addCommands()
|
||||
.addSettings()
|
||||
.filterPrefix(argc.getString())
|
||||
.stream();
|
||||
.addCommands()
|
||||
.addSettings()
|
||||
.filterPrefix(argc.getString())
|
||||
.stream();
|
||||
}
|
||||
|
||||
Settings.Setting setting = settings.byLowerName.get(argc.getString().toLowerCase(Locale.US));
|
||||
|
@ -51,8 +51,8 @@ public abstract class Command implements Helper, AbstractGameEventListener {
|
||||
*/
|
||||
protected Command(List<String> names) {
|
||||
this.names = names.stream()
|
||||
.map(s -> s.toLowerCase(Locale.US))
|
||||
.collect(Collectors.toList());
|
||||
.map(s -> s.toLowerCase(Locale.US))
|
||||
.collect(Collectors.toList());
|
||||
baritone.getGameEventHandler().registerEventListener(this);
|
||||
}
|
||||
|
||||
|
@ -38,11 +38,11 @@ public class ArgParserManager {
|
||||
public static <T> ArgParser.Stateless<T> getParserStateless(Class<T> klass) {
|
||||
//noinspection unchecked
|
||||
return REGISTRY.descendingStream()
|
||||
.filter(ArgParser.Stateless.class::isInstance)
|
||||
.map(ArgParser.Stateless.class::cast)
|
||||
.filter(parser -> parser.getKlass().isAssignableFrom(klass))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
.filter(ArgParser.Stateless.class::isInstance)
|
||||
.map(ArgParser.Stateless.class::cast)
|
||||
.filter(parser -> parser.getKlass().isAssignableFrom(klass))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,13 +52,13 @@ public class ArgParserManager {
|
||||
public static <T, S> ArgParser.Stated<T, S> getParserStated(Class<T> klass, Class<S> stateKlass) {
|
||||
//noinspection unchecked
|
||||
return REGISTRY.descendingStream()
|
||||
.filter(ArgParser.Stated.class::isInstance)
|
||||
.map(ArgParser.Stated.class::cast)
|
||||
.filter(parser -> parser.getKlass().isAssignableFrom(klass))
|
||||
.filter(parser -> parser.getStateKlass().isAssignableFrom(stateKlass))
|
||||
.map(ArgParser.Stated.class::cast)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
.filter(ArgParser.Stated.class::isInstance)
|
||||
.map(ArgParser.Stated.class::cast)
|
||||
.filter(parser -> parser.getKlass().isAssignableFrom(klass))
|
||||
.filter(parser -> parser.getStateKlass().isAssignableFrom(stateKlass))
|
||||
.map(ArgParser.Stated.class::cast)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -114,10 +114,10 @@ public class DefaultArgParsers {
|
||||
}
|
||||
|
||||
public static final List<ArgParser<?>> ALL = asList(
|
||||
IntArgumentParser.INSTANCE,
|
||||
LongArgumentParser.INSTANCE,
|
||||
FloatArgumentParser.INSTANCE,
|
||||
DoubleArgumentParser.INSTANCE,
|
||||
BooleanArgumentParser.INSTANCE
|
||||
IntArgumentParser.INSTANCE,
|
||||
LongArgumentParser.INSTANCE,
|
||||
FloatArgumentParser.INSTANCE,
|
||||
DoubleArgumentParser.INSTANCE,
|
||||
BooleanArgumentParser.INSTANCE
|
||||
);
|
||||
}
|
||||
|
@ -67,9 +67,9 @@ public class CommandArgument {
|
||||
*/
|
||||
public <E extends Enum<?>> E getEnum(Class<E> enumClass) {
|
||||
return Arrays.stream(enumClass.getEnumConstants())
|
||||
.filter(e -> e.name().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new CommandInvalidTypeException(this, enumClass.getSimpleName()));
|
||||
.filter(e -> e.name().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new CommandInvalidTypeException(this, enumClass.getSimpleName()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,9 +145,9 @@ public class CommandArgument {
|
||||
int lastEnd = -1;
|
||||
while (argMatcher.find()) {
|
||||
args.add(new CommandArgument(
|
||||
args.size(),
|
||||
argMatcher.group(),
|
||||
string.substring(argMatcher.start())
|
||||
args.size(),
|
||||
argMatcher.group(),
|
||||
string.substring(argMatcher.start())
|
||||
));
|
||||
|
||||
lastEnd = argMatcher.end();
|
||||
|
@ -48,13 +48,13 @@ public class BlockById implements IDatatypeFor<Block> {
|
||||
@Override
|
||||
public Stream<String> tabComplete(ArgConsumer consumer) {
|
||||
return new TabCompleteHelper()
|
||||
.append(
|
||||
Block.REGISTRY.getKeys()
|
||||
.stream()
|
||||
.map(Object::toString)
|
||||
)
|
||||
.filterPrefixNamespaced(consumer.getString())
|
||||
.sortAlphabetically()
|
||||
.stream();
|
||||
.append(
|
||||
Block.REGISTRY.getKeys()
|
||||
.stream()
|
||||
.map(Object::toString)
|
||||
)
|
||||
.filterPrefixNamespaced(consumer.getString())
|
||||
.sortAlphabetically()
|
||||
.stream();
|
||||
}
|
||||
}
|
||||
|
@ -50,13 +50,13 @@ public class EntityClassById implements IDatatypeFor<Class<? extends Entity>> {
|
||||
@Override
|
||||
public Stream<String> tabComplete(ArgConsumer consumer) {
|
||||
return new TabCompleteHelper()
|
||||
.append(
|
||||
EntityList.getEntityNameList()
|
||||
.stream()
|
||||
.map(Object::toString)
|
||||
)
|
||||
.filterPrefixNamespaced(consumer.getString())
|
||||
.sortAlphabetically()
|
||||
.stream();
|
||||
.append(
|
||||
EntityList.getEntityNameList()
|
||||
.stream()
|
||||
.map(Object::toString)
|
||||
)
|
||||
.filterPrefixNamespaced(consumer.getString())
|
||||
.sortAlphabetically()
|
||||
.stream();
|
||||
}
|
||||
}
|
||||
|
@ -44,12 +44,12 @@ public class ForEnumFacing implements IDatatypeFor<EnumFacing> {
|
||||
@Override
|
||||
public Stream<String> tabComplete(ArgConsumer consumer) {
|
||||
return new TabCompleteHelper()
|
||||
.append(
|
||||
Arrays.stream(EnumFacing.values())
|
||||
.map(EnumFacing::getName)
|
||||
.map(String::toLowerCase)
|
||||
)
|
||||
.filterPrefix(consumer.getString())
|
||||
.stream();
|
||||
.append(
|
||||
Arrays.stream(EnumFacing.values())
|
||||
.map(EnumFacing::getName)
|
||||
.map(String::toLowerCase)
|
||||
)
|
||||
.filterPrefix(consumer.getString())
|
||||
.stream();
|
||||
}
|
||||
}
|
||||
|
@ -51,43 +51,43 @@ public class ForWaypoints implements IDatatypeFor<IWaypoint[]> {
|
||||
@Override
|
||||
public Stream<String> tabComplete(ArgConsumer consumer) {
|
||||
return new TabCompleteHelper()
|
||||
.append(getWaypointNames())
|
||||
.sortAlphabetically()
|
||||
.prepend(IWaypoint.Tag.getAllNames())
|
||||
.filterPrefix(consumer.getString())
|
||||
.stream();
|
||||
.append(getWaypointNames())
|
||||
.sortAlphabetically()
|
||||
.prepend(IWaypoint.Tag.getAllNames())
|
||||
.filterPrefix(consumer.getString())
|
||||
.stream();
|
||||
}
|
||||
|
||||
public static IWaypointCollection waypoints() {
|
||||
return BaritoneAPI.getProvider()
|
||||
.getPrimaryBaritone()
|
||||
.getWorldProvider()
|
||||
.getCurrentWorld()
|
||||
.getWaypoints();
|
||||
.getPrimaryBaritone()
|
||||
.getWorldProvider()
|
||||
.getCurrentWorld()
|
||||
.getWaypoints();
|
||||
}
|
||||
|
||||
public static IWaypoint[] getWaypoints() {
|
||||
return waypoints().getAllWaypoints().stream()
|
||||
.sorted(Comparator.comparingLong(IWaypoint::getCreationTimestamp).reversed())
|
||||
.toArray(IWaypoint[]::new);
|
||||
.sorted(Comparator.comparingLong(IWaypoint::getCreationTimestamp).reversed())
|
||||
.toArray(IWaypoint[]::new);
|
||||
}
|
||||
|
||||
public static String[] getWaypointNames() {
|
||||
return Arrays.stream(getWaypoints())
|
||||
.map(IWaypoint::getName)
|
||||
.filter(name -> !name.equals(""))
|
||||
.toArray(String[]::new);
|
||||
.map(IWaypoint::getName)
|
||||
.filter(name -> !name.equals(""))
|
||||
.toArray(String[]::new);
|
||||
}
|
||||
|
||||
public static IWaypoint[] getWaypointsByTag(IWaypoint.Tag tag) {
|
||||
return waypoints().getByTag(tag).stream()
|
||||
.sorted(Comparator.comparingLong(IWaypoint::getCreationTimestamp).reversed())
|
||||
.toArray(IWaypoint[]::new);
|
||||
.sorted(Comparator.comparingLong(IWaypoint::getCreationTimestamp).reversed())
|
||||
.toArray(IWaypoint[]::new);
|
||||
}
|
||||
|
||||
public static IWaypoint[] getWaypointsByName(String name) {
|
||||
return Arrays.stream(getWaypoints())
|
||||
.filter(waypoint -> waypoint.getName().equalsIgnoreCase(name))
|
||||
.toArray(IWaypoint[]::new);
|
||||
.filter(waypoint -> waypoint.getName().equalsIgnoreCase(name))
|
||||
.toArray(IWaypoint[]::new);
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ import static java.util.Objects.isNull;
|
||||
|
||||
public class PlayerByUsername implements IDatatypeFor<EntityPlayer> {
|
||||
private final List<EntityPlayer> players =
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getPlayerContext().world().playerEntities;
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getPlayerContext().world().playerEntities;
|
||||
public final EntityPlayer player;
|
||||
|
||||
public PlayerByUsername() {
|
||||
@ -40,10 +40,10 @@ public class PlayerByUsername implements IDatatypeFor<EntityPlayer> {
|
||||
String username = consumer.getString();
|
||||
|
||||
player = players
|
||||
.stream()
|
||||
.filter(s -> s.getName().equalsIgnoreCase(username))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
.stream()
|
||||
.filter(s -> s.getName().equalsIgnoreCase(username))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (isNull(player)) {
|
||||
throw new IllegalArgumentException("no player found by that username");
|
||||
@ -58,13 +58,13 @@ public class PlayerByUsername implements IDatatypeFor<EntityPlayer> {
|
||||
@Override
|
||||
public Stream<String> tabComplete(ArgConsumer consumer) {
|
||||
return new TabCompleteHelper()
|
||||
.append(
|
||||
players
|
||||
.stream()
|
||||
.map(EntityPlayer::getName)
|
||||
)
|
||||
.filterPrefix(consumer.getString())
|
||||
.sortAlphabetically()
|
||||
.stream();
|
||||
.append(
|
||||
players
|
||||
.stream()
|
||||
.map(EntityPlayer::getName)
|
||||
)
|
||||
.filterPrefix(consumer.getString())
|
||||
.sortAlphabetically()
|
||||
.stream();
|
||||
}
|
||||
}
|
||||
|
@ -44,9 +44,9 @@ public class RelativeBlockPos implements IDatatypePost<BetterBlockPos, BetterBlo
|
||||
@Override
|
||||
public BetterBlockPos apply(BetterBlockPos origin) {
|
||||
return new BetterBlockPos(
|
||||
x.apply((double) origin.x),
|
||||
y.apply((double) origin.y),
|
||||
z.apply((double) origin.z)
|
||||
x.apply((double) origin.x),
|
||||
y.apply((double) origin.y),
|
||||
z.apply((double) origin.z)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -77,14 +77,14 @@ public class RelativeFile implements IDatatypePost<File, File> {
|
||||
File currentFile = currentPath.isAbsolute() ? currentPath.toFile() : new File(base, currentPathStringThing);
|
||||
|
||||
return Arrays.stream(Objects.requireNonNull(SHUT_THE_FUCK_UP_IOEXCEPTION_NOBODY_LIKES_YOU(
|
||||
useParent
|
||||
? currentFile.getParentFile()
|
||||
: currentFile
|
||||
useParent
|
||||
? currentFile.getParentFile()
|
||||
: currentFile
|
||||
).listFiles()))
|
||||
.map(f -> (currentPath.isAbsolute() ? f : basePath.relativize(f.toPath()).toString()) +
|
||||
(f.isDirectory() ? File.separator : ""))
|
||||
.filter(s -> s.toLowerCase(Locale.US).startsWith(currentPathStringThing.toLowerCase(Locale.US)))
|
||||
.filter(s -> !s.contains(" "));
|
||||
.map(f -> (currentPath.isAbsolute() ? f : basePath.relativize(f.toPath()).toString()) +
|
||||
(f.isDirectory() ? File.separator : ""))
|
||||
.filter(s -> s.toLowerCase(Locale.US).startsWith(currentPathStringThing.toLowerCase(Locale.US)))
|
||||
.filter(s -> !s.contains(" "));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,18 +56,18 @@ public class RelativeGoal implements IDatatypePost<Goal, BetterBlockPos> {
|
||||
return new GoalBlock(origin);
|
||||
case 1:
|
||||
return new GoalYLevel(
|
||||
coords[0].applyFloor(origin.y)
|
||||
coords[0].applyFloor(origin.y)
|
||||
);
|
||||
case 2:
|
||||
return new GoalXZ(
|
||||
coords[0].applyFloor(origin.x),
|
||||
coords[1].applyFloor(origin.z)
|
||||
coords[0].applyFloor(origin.x),
|
||||
coords[1].applyFloor(origin.z)
|
||||
);
|
||||
case 3:
|
||||
return new GoalBlock(
|
||||
coords[0].applyFloor(origin.x),
|
||||
coords[1].applyFloor(origin.y),
|
||||
coords[2].applyFloor(origin.z)
|
||||
coords[0].applyFloor(origin.x),
|
||||
coords[1].applyFloor(origin.y),
|
||||
coords[2].applyFloor(origin.z)
|
||||
);
|
||||
default:
|
||||
throw new IllegalStateException("Unexpected coords size: " + coords.length);
|
||||
|
@ -32,18 +32,18 @@ public class RelativeGoalBlock implements IDatatypePost<GoalBlock, BetterBlockPo
|
||||
|
||||
public RelativeGoalBlock(ArgConsumer consumer) {
|
||||
coords = new RelativeCoordinate[]{
|
||||
consumer.getDatatype(RelativeCoordinate.class),
|
||||
consumer.getDatatype(RelativeCoordinate.class),
|
||||
consumer.getDatatype(RelativeCoordinate.class)
|
||||
consumer.getDatatype(RelativeCoordinate.class),
|
||||
consumer.getDatatype(RelativeCoordinate.class),
|
||||
consumer.getDatatype(RelativeCoordinate.class)
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoalBlock apply(BetterBlockPos origin) {
|
||||
return new GoalBlock(
|
||||
coords[0].applyFloor(origin.x),
|
||||
coords[1].applyFloor(origin.y),
|
||||
coords[2].applyFloor(origin.z)
|
||||
coords[0].applyFloor(origin.x),
|
||||
coords[1].applyFloor(origin.y),
|
||||
coords[2].applyFloor(origin.z)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -32,16 +32,16 @@ public class RelativeGoalXZ implements IDatatypePost<GoalXZ, BetterBlockPos> {
|
||||
|
||||
public RelativeGoalXZ(ArgConsumer consumer) {
|
||||
coords = new RelativeCoordinate[]{
|
||||
consumer.getDatatype(RelativeCoordinate.class),
|
||||
consumer.getDatatype(RelativeCoordinate.class)
|
||||
consumer.getDatatype(RelativeCoordinate.class),
|
||||
consumer.getDatatype(RelativeCoordinate.class)
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoalXZ apply(BetterBlockPos origin) {
|
||||
return new GoalXZ(
|
||||
coords[0].applyFloor(origin.x),
|
||||
coords[1].applyFloor(origin.z)
|
||||
coords[0].applyFloor(origin.x),
|
||||
coords[1].applyFloor(origin.z)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -24,9 +24,9 @@ public abstract class CommandInvalidArgumentException extends CommandErrorMessag
|
||||
|
||||
protected CommandInvalidArgumentException(CommandArgument arg, String reason) {
|
||||
super(String.format(
|
||||
"Error at argument #%s: %s",
|
||||
arg.index == -1 ? "<unknown>" : Integer.toString(arg.index + 1),
|
||||
reason
|
||||
"Error at argument #%s: %s",
|
||||
arg.index == -1 ? "<unknown>" : Integer.toString(arg.index + 1),
|
||||
reason
|
||||
));
|
||||
|
||||
this.arg = arg;
|
||||
|
@ -34,7 +34,7 @@ public class CommandUnhandledException extends CommandErrorMessageException {
|
||||
|
||||
public static String getBaritoneStackTrace(String stackTrace) {
|
||||
List<String> lines = Arrays.stream(stackTrace.split("\n"))
|
||||
.collect(Collectors.toList());
|
||||
.collect(Collectors.toList());
|
||||
|
||||
int lastBaritoneLine = 0;
|
||||
for (int i = 0; i < lines.size(); i++) {
|
||||
@ -76,8 +76,8 @@ public class CommandUnhandledException extends CommandErrorMessageException {
|
||||
|
||||
public CommandUnhandledException(Throwable cause) {
|
||||
super(String.format(
|
||||
"An unhandled exception has occurred:\n\n%s",
|
||||
getFriendlierStackTrace(cause)
|
||||
"An unhandled exception has occurred:\n\n%s",
|
||||
getFriendlierStackTrace(cause)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -97,9 +97,9 @@ public class CommandExecution {
|
||||
}
|
||||
|
||||
return new CommandExecution(
|
||||
command,
|
||||
label,
|
||||
args
|
||||
command,
|
||||
label,
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -83,14 +83,14 @@ public class Paginator<E> implements Helper {
|
||||
|
||||
if (hasPrevPage) {
|
||||
prevPageComponent.getStyle()
|
||||
.setClickEvent(new ClickEvent(
|
||||
ClickEvent.Action.RUN_COMMAND,
|
||||
String.format("%s %d", commandPrefix, page - 1)
|
||||
))
|
||||
.setHoverEvent(new HoverEvent(
|
||||
HoverEvent.Action.SHOW_TEXT,
|
||||
new TextComponentString("Click to view previous page")
|
||||
));
|
||||
.setClickEvent(new ClickEvent(
|
||||
ClickEvent.Action.RUN_COMMAND,
|
||||
String.format("%s %d", commandPrefix, page - 1)
|
||||
))
|
||||
.setHoverEvent(new HoverEvent(
|
||||
HoverEvent.Action.SHOW_TEXT,
|
||||
new TextComponentString("Click to view previous page")
|
||||
));
|
||||
} else {
|
||||
prevPageComponent.getStyle().setColor(TextFormatting.DARK_GRAY);
|
||||
}
|
||||
@ -99,14 +99,14 @@ public class Paginator<E> implements Helper {
|
||||
|
||||
if (hasNextPage) {
|
||||
nextPageComponent.getStyle()
|
||||
.setClickEvent(new ClickEvent(
|
||||
ClickEvent.Action.RUN_COMMAND,
|
||||
String.format("%s %d", commandPrefix, page + 1)
|
||||
))
|
||||
.setHoverEvent(new HoverEvent(
|
||||
HoverEvent.Action.SHOW_TEXT,
|
||||
new TextComponentString("Click to view next page")
|
||||
));
|
||||
.setClickEvent(new ClickEvent(
|
||||
ClickEvent.Action.RUN_COMMAND,
|
||||
String.format("%s %d", commandPrefix, page + 1)
|
||||
))
|
||||
.setHoverEvent(new HoverEvent(
|
||||
HoverEvent.Action.SHOW_TEXT,
|
||||
new TextComponentString("Click to view next page")
|
||||
));
|
||||
} else {
|
||||
nextPageComponent.getStyle().setColor(TextFormatting.DARK_GRAY);
|
||||
}
|
||||
@ -134,12 +134,12 @@ public class Paginator<E> implements Helper {
|
||||
|
||||
if (!pagi.validPage(page)) {
|
||||
throw new CommandInvalidTypeException(
|
||||
consumer.consumed(),
|
||||
String.format(
|
||||
"a valid page (1-%d)",
|
||||
pagi.getMaxPage()
|
||||
),
|
||||
consumer.consumed().value
|
||||
consumer.consumed(),
|
||||
String.format(
|
||||
"a valid page (1-%d)",
|
||||
pagi.getMaxPage()
|
||||
),
|
||||
consumer.consumed().value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -112,9 +112,9 @@ public class TabCompleteHelper {
|
||||
*/
|
||||
public TabCompleteHelper append(Class<? extends Enum<?>> num) {
|
||||
return append(
|
||||
Arrays.stream(num.getEnumConstants())
|
||||
.map(Enum::name)
|
||||
.map(String::toLowerCase)
|
||||
Arrays.stream(num.getEnumConstants())
|
||||
.map(Enum::name)
|
||||
.map(String::toLowerCase)
|
||||
);
|
||||
}
|
||||
|
||||
@ -163,9 +163,9 @@ public class TabCompleteHelper {
|
||||
*/
|
||||
public TabCompleteHelper prepend(Class<? extends Enum<?>> num) {
|
||||
return prepend(
|
||||
Arrays.stream(num.getEnumConstants())
|
||||
.map(Enum::name)
|
||||
.map(String::toLowerCase)
|
||||
Arrays.stream(num.getEnumConstants())
|
||||
.map(Enum::name)
|
||||
.map(String::toLowerCase)
|
||||
);
|
||||
}
|
||||
|
||||
@ -263,9 +263,9 @@ public class TabCompleteHelper {
|
||||
*/
|
||||
public TabCompleteHelper addCommands() {
|
||||
return append(
|
||||
CommandManager.REGISTRY.descendingStream()
|
||||
.flatMap(command -> command.names.stream())
|
||||
.distinct()
|
||||
CommandManager.REGISTRY.descendingStream()
|
||||
.flatMap(command -> command.names.stream())
|
||||
.distinct()
|
||||
);
|
||||
}
|
||||
|
||||
@ -276,10 +276,10 @@ public class TabCompleteHelper {
|
||||
*/
|
||||
public TabCompleteHelper addSettings() {
|
||||
return append(
|
||||
BaritoneAPI.getSettings().allSettings.stream()
|
||||
.map(Settings.Setting::getName)
|
||||
.filter(s -> !s.equalsIgnoreCase("logger"))
|
||||
.sorted(String.CASE_INSENSITIVE_ORDER)
|
||||
BaritoneAPI.getSettings().allSettings.stream()
|
||||
.map(Settings.Setting::getName)
|
||||
.filter(s -> !s.equalsIgnoreCase("logger"))
|
||||
.sorted(String.CASE_INSENSITIVE_ORDER)
|
||||
);
|
||||
}
|
||||
|
||||
@ -290,9 +290,9 @@ public class TabCompleteHelper {
|
||||
*/
|
||||
public TabCompleteHelper addModifiedSettings() {
|
||||
return append(
|
||||
SettingsUtil.modifiedSettings(BaritoneAPI.getSettings()).stream()
|
||||
.map(Settings.Setting::getName)
|
||||
.sorted(String.CASE_INSENSITIVE_ORDER)
|
||||
SettingsUtil.modifiedSettings(BaritoneAPI.getSettings()).stream()
|
||||
.map(Settings.Setting::getName)
|
||||
.sorted(String.CASE_INSENSITIVE_ORDER)
|
||||
);
|
||||
}
|
||||
|
||||
@ -303,9 +303,9 @@ public class TabCompleteHelper {
|
||||
*/
|
||||
public TabCompleteHelper addToggleableSettings() {
|
||||
return append(
|
||||
BaritoneAPI.getSettings().getAllValuesByType(Boolean.class).stream()
|
||||
.map(Settings.Setting::getName)
|
||||
.sorted(String.CASE_INSENSITIVE_ORDER)
|
||||
BaritoneAPI.getSettings().getAllValuesByType(Boolean.class).stream()
|
||||
.map(Settings.Setting::getName)
|
||||
.sorted(String.CASE_INSENSITIVE_ORDER)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -78,9 +78,9 @@ public class CommandManager {
|
||||
|
||||
if (args.isEmpty()) {
|
||||
return new TabCompleteHelper()
|
||||
.addCommands()
|
||||
.filterPrefix(label)
|
||||
.stream();
|
||||
.addCommands()
|
||||
.filterPrefix(label)
|
||||
.stream();
|
||||
} else {
|
||||
return tabComplete(pair);
|
||||
}
|
||||
|
@ -132,9 +132,9 @@ public class Registry<V> {
|
||||
*/
|
||||
public Stream<V> descendingStream() {
|
||||
return StreamSupport.stream(Spliterators.spliterator(
|
||||
descendingIterator(),
|
||||
_entries.size(),
|
||||
Spliterator.SIZED | Spliterator.SUBSIZED
|
||||
descendingIterator(),
|
||||
_entries.size(),
|
||||
Spliterator.SIZED | Spliterator.SUBSIZED
|
||||
), false);
|
||||
}
|
||||
}
|
||||
|
@ -131,9 +131,9 @@ public final class PathRenderer implements IRenderer {
|
||||
int dirZ = end.z - start.z;
|
||||
|
||||
while (next + 1 < positions.size() && (!fadeOut || next + 1 < fadeStart) &&
|
||||
(dirX == positions.get(next + 1).x - end.x &&
|
||||
dirY == positions.get(next + 1).y - end.y &&
|
||||
dirZ == positions.get(next + 1).z - end.z)) {
|
||||
(dirX == positions.get(next + 1).x - end.x &&
|
||||
dirY == positions.get(next + 1).y - end.y &&
|
||||
dirZ == positions.get(next + 1).z - end.z)) {
|
||||
end = positions.get(++next);
|
||||
}
|
||||
|
||||
@ -239,15 +239,15 @@ public final class PathRenderer implements IRenderer {
|
||||
}
|
||||
|
||||
TileEntityBeaconRenderer.renderBeamSegment(
|
||||
goalPos.getX() - renderPosX,
|
||||
-renderPosY,
|
||||
goalPos.getZ() - renderPosZ,
|
||||
partialTicks,
|
||||
1.0,
|
||||
player.world.getTotalWorldTime(),
|
||||
0,
|
||||
256,
|
||||
color.getColorComponents(null)
|
||||
goalPos.getX() - renderPosX,
|
||||
-renderPosY,
|
||||
goalPos.getZ() - renderPosZ,
|
||||
partialTicks,
|
||||
1.0,
|
||||
player.world.getTotalWorldTime(),
|
||||
0,
|
||||
256,
|
||||
color.getColorComponents(null)
|
||||
);
|
||||
|
||||
if (settings.renderGoalIgnoreDepth.value) {
|
||||
|
Loading…
Reference in New Issue
Block a user