diff --git a/src/api/java/baritone/api/utils/BlockListFilter.java b/src/api/java/baritone/api/utils/BlockListFilter.java index 7168687d..6116f22b 100644 --- a/src/api/java/baritone/api/utils/BlockListFilter.java +++ b/src/api/java/baritone/api/utils/BlockListFilter.java @@ -22,12 +22,12 @@ public class BlockListFilter implements IBlockFilter { @Override public boolean selected(@Nonnull IBlockState blockstate) { - return false; + return blocks.contains(blockstate.getBlock()); } @Override public List blocks() { - return null; + return blocks; } @Override diff --git a/src/api/java/baritone/api/utils/BlockSelector.java b/src/api/java/baritone/api/utils/BlockSelector.java index c711d725..54f85ecd 100644 --- a/src/api/java/baritone/api/utils/BlockSelector.java +++ b/src/api/java/baritone/api/utils/BlockSelector.java @@ -17,6 +17,7 @@ import static java.util.Objects.isNull; public class BlockSelector implements IBlockFilter { private final Block block; private final IBlockState blockstate; + private final int damage; private static final Pattern pattern = Pattern.compile("^(.+?)(?::(\\d+))?$"); public BlockSelector(@Nonnull String selector) { @@ -38,12 +39,12 @@ public class BlockSelector implements IBlockFilter { block = Block.REGISTRY.getObject(id); //noinspection deprecation blockstate = hasData ? block.getStateFromMeta(Integer.parseInt(matchResult.group(2))) : null; + damage = block.damageDropped(blockstate); } @Override public boolean selected(@Nonnull IBlockState blockstate) { - return blockstate.getBlock() == block && (isNull(this.blockstate) || - block.damageDropped(blockstate) == block.damageDropped(this.blockstate)); + return blockstate.getBlock() == block && (isNull(this.blockstate) || block.damageDropped(blockstate) == damage); } @Override diff --git a/src/api/java/baritone/api/utils/CompositeBlockFilter.java b/src/api/java/baritone/api/utils/CompositeBlockFilter.java index 39b52f21..d2297d3b 100644 --- a/src/api/java/baritone/api/utils/CompositeBlockFilter.java +++ b/src/api/java/baritone/api/utils/CompositeBlockFilter.java @@ -5,37 +5,36 @@ import net.minecraft.block.state.IBlockState; import javax.annotation.Nonnull; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; -import static java.util.Arrays.asList; - public class CompositeBlockFilter implements IBlockFilter { - List filters = new ArrayList<>(); - - public CompositeBlockFilter() { - } + private IBlockFilter[] filters; public CompositeBlockFilter(List filters) { - this.filters.addAll(filters); + this.filters = filters.toArray(new IBlockFilter[0]); } public CompositeBlockFilter(IBlockFilter... filters) { - this.filters.addAll(asList(filters)); + this.filters = filters; } @Override public boolean selected(@Nonnull IBlockState blockstate) { - return filters.stream() - .map(f -> f.selected(blockstate)) - .filter(Boolean::valueOf).findFirst() - .orElse(false); + for (IBlockFilter filter : filters) { + if (filter.selected(blockstate)) { + return true; + } + } + + return false; } @Override public List blocks() { - return filters.stream() + return Arrays.stream(filters) .map(IBlockFilter::blocks) .flatMap(Collection::stream) .collect(Collectors.toCollection(ArrayList::new)); @@ -45,7 +44,7 @@ public class CompositeBlockFilter implements IBlockFilter { public String toString() { return String.format( "CompositeBlockFilter{%s}", - String.join(",", filters.stream().map(Object::toString).toArray(String[]::new)) + String.join(",", Arrays.stream(filters).map(Object::toString).toArray(String[]::new)) ); } } diff --git a/src/api/java/baritone/api/utils/command/BaritoneChatControl.java b/src/api/java/baritone/api/utils/command/BaritoneChatControl.java index 3de8a7eb..753f8249 100644 --- a/src/api/java/baritone/api/utils/command/BaritoneChatControl.java +++ b/src/api/java/baritone/api/utils/command/BaritoneChatControl.java @@ -151,7 +151,7 @@ public class BaritoneChatControl implements Helper, AbstractGameEventListener { if (setting.getName().equalsIgnoreCase(pair.first())) { logRanCommand(msg); - CommandManager.execute(String.format("set %s %s", setting.getName(), argc.getS())); + CommandManager.execute(String.format("set %s %s", setting.getName(), argc.getString())); return true; } } @@ -203,11 +203,11 @@ public class BaritoneChatControl implements Helper, AbstractGameEventListener { return new TabCompleteHelper() .addCommands() .addSettings() - .filterPrefix(argc.getS()) + .filterPrefix(argc.getString()) .stream(); } - Settings.Setting setting = settings.byLowerName.get(argc.getS().toLowerCase(Locale.US)); + Settings.Setting setting = settings.byLowerName.get(argc.getString().toLowerCase(Locale.US)); if (nonNull(setting)) { if (setting.getValueClass() == Boolean.class) { @@ -219,7 +219,7 @@ public class BaritoneChatControl implements Helper, AbstractGameEventListener { helper.append(of("false", "true")); } - return helper.filterPrefix(argc.getS()).stream(); + return helper.filterPrefix(argc.getString()).stream(); } else { return of(SettingsUtil.settingValueToString(setting)); } diff --git a/src/api/java/baritone/api/utils/command/argument/CommandArgument.java b/src/api/java/baritone/api/utils/command/argument/CommandArgument.java index 5b507fcd..8309e696 100644 --- a/src/api/java/baritone/api/utils/command/argument/CommandArgument.java +++ b/src/api/java/baritone/api/utils/command/argument/CommandArgument.java @@ -39,7 +39,7 @@ public class CommandArgument { this.rawRest = rawRest; } - public > E getE(Class enumClass) { + public > E getEnum(Class enumClass) { //noinspection OptionalGetWithoutIsPresent return Arrays.stream(enumClass.getEnumConstants()) .filter(e -> e.name().equalsIgnoreCase(value)) diff --git a/src/api/java/baritone/api/utils/command/datatypes/BlockById.java b/src/api/java/baritone/api/utils/command/datatypes/BlockById.java index c8cfe274..469e9caf 100644 --- a/src/api/java/baritone/api/utils/command/datatypes/BlockById.java +++ b/src/api/java/baritone/api/utils/command/datatypes/BlockById.java @@ -16,7 +16,7 @@ public class BlockById implements IDatatypeFor { } public BlockById(ArgConsumer consumer) { - ResourceLocation id = new ResourceLocation(consumer.getS()); + ResourceLocation id = new ResourceLocation(consumer.getString()); if ((block = Block.REGISTRY.getObject(id)) == Blocks.AIR) { throw new RuntimeException("no block found by that id"); @@ -36,7 +36,7 @@ public class BlockById implements IDatatypeFor { .stream() .map(Object::toString) ) - .filterPrefixNamespaced(consumer.getS()) + .filterPrefixNamespaced(consumer.getString()) .sortAlphabetically() .stream(); } diff --git a/src/api/java/baritone/api/utils/command/datatypes/EntityClassById.java b/src/api/java/baritone/api/utils/command/datatypes/EntityClassById.java index eb841724..dc9d0bae 100644 --- a/src/api/java/baritone/api/utils/command/datatypes/EntityClassById.java +++ b/src/api/java/baritone/api/utils/command/datatypes/EntityClassById.java @@ -18,7 +18,7 @@ public class EntityClassById implements IDatatypeFor> { } public EntityClassById(ArgConsumer consumer) { - ResourceLocation id = new ResourceLocation(consumer.getS()); + ResourceLocation id = new ResourceLocation(consumer.getString()); if (isNull(entity = EntityList.REGISTRY.getObject(id))) { throw new RuntimeException("no entity found by that id"); @@ -38,7 +38,7 @@ public class EntityClassById implements IDatatypeFor> { .stream() .map(Object::toString) ) - .filterPrefixNamespaced(consumer.getS()) + .filterPrefixNamespaced(consumer.getString()) .sortAlphabetically() .stream(); } diff --git a/src/api/java/baritone/api/utils/command/datatypes/ForBlockSelector.java b/src/api/java/baritone/api/utils/command/datatypes/ForBlockSelector.java index 7b7dbf72..eb4047dc 100644 --- a/src/api/java/baritone/api/utils/command/datatypes/ForBlockSelector.java +++ b/src/api/java/baritone/api/utils/command/datatypes/ForBlockSelector.java @@ -13,7 +13,7 @@ public class ForBlockSelector implements IDatatypeFor { } public ForBlockSelector(ArgConsumer consumer) { - selector = new BlockSelector(consumer.getS()); + selector = new BlockSelector(consumer.getString()); } @Override diff --git a/src/api/java/baritone/api/utils/command/datatypes/PlayerByUsername.java b/src/api/java/baritone/api/utils/command/datatypes/PlayerByUsername.java index 07e765e5..1d9a48dd 100644 --- a/src/api/java/baritone/api/utils/command/datatypes/PlayerByUsername.java +++ b/src/api/java/baritone/api/utils/command/datatypes/PlayerByUsername.java @@ -20,7 +20,7 @@ public class PlayerByUsername implements IDatatypeFor { } public PlayerByUsername(ArgConsumer consumer) { - String username = consumer.getS(); + String username = consumer.getString(); if (isNull( player = players @@ -46,7 +46,7 @@ public class PlayerByUsername implements IDatatypeFor { .stream() .map(EntityPlayer::getName) ) - .filterPrefix(consumer.getS()) + .filterPrefix(consumer.getString()) .sortAlphabetically() .stream(); } diff --git a/src/api/java/baritone/api/utils/command/datatypes/RelativeCoordinate.java b/src/api/java/baritone/api/utils/command/datatypes/RelativeCoordinate.java index 9516fea7..3213a033 100644 --- a/src/api/java/baritone/api/utils/command/datatypes/RelativeCoordinate.java +++ b/src/api/java/baritone/api/utils/command/datatypes/RelativeCoordinate.java @@ -23,7 +23,7 @@ public class RelativeCoordinate implements IDatatypePost { throw new RuntimeException("relative coordinate requires an argument"); } - Matcher matcher = PATTERN.matcher(consumer.getS()); + Matcher matcher = PATTERN.matcher(consumer.getString()); if (!matcher.matches()) { throw new RuntimeException("pattern doesn't match"); @@ -48,7 +48,7 @@ public class RelativeCoordinate implements IDatatypePost { @Override public Stream tabComplete(ArgConsumer consumer) { - if (!consumer.has(2) && consumer.getS().matches("^(~|$)")) { + if (!consumer.has(2) && consumer.getString().matches("^(~|$)")) { return Stream.of("~"); } diff --git a/src/api/java/baritone/api/utils/command/datatypes/RelativeFile.java b/src/api/java/baritone/api/utils/command/datatypes/RelativeFile.java index 58013f4f..41b6ff55 100644 --- a/src/api/java/baritone/api/utils/command/datatypes/RelativeFile.java +++ b/src/api/java/baritone/api/utils/command/datatypes/RelativeFile.java @@ -20,7 +20,7 @@ public class RelativeFile implements IDatatypePost { public RelativeFile(ArgConsumer consumer) { try { - path = FileSystems.getDefault().getPath(consumer.getS()); + path = FileSystems.getDefault().getPath(consumer.getString()); } catch (InvalidPathException e) { throw new RuntimeException("invalid path"); } @@ -32,7 +32,7 @@ public class RelativeFile implements IDatatypePost { } public static Stream tabComplete(ArgConsumer consumer, File base) { - String currentPathStringThing = consumer.getS(); + String currentPathStringThing = consumer.getString(); Path currentPath = FileSystems.getDefault().getPath(currentPathStringThing); Path basePath = currentPath.isAbsolute() ? currentPath.getRoot() : base.toPath(); boolean useParent = !currentPathStringThing.isEmpty() && !currentPathStringThing.endsWith(File.separator); diff --git a/src/api/java/baritone/api/utils/command/defaults/BuildCommand.java b/src/api/java/baritone/api/utils/command/defaults/BuildCommand.java index ab6b3371..e7fd614e 100644 --- a/src/api/java/baritone/api/utils/command/defaults/BuildCommand.java +++ b/src/api/java/baritone/api/utils/command/defaults/BuildCommand.java @@ -36,7 +36,7 @@ public class BuildCommand extends Command { @Override protected void executed(String label, ArgConsumer args, Settings settings) { - String filename = String.format("%s.schematic", args.getS()); + String filename = String.format("%s.schematic", args.getString()); BetterBlockPos origin = ctx.playerFeet(); BetterBlockPos buildOrigin; diff --git a/src/api/java/baritone/api/utils/command/defaults/ExploreFilterCommand.java b/src/api/java/baritone/api/utils/command/defaults/ExploreFilterCommand.java index 2bd41ae4..6b257012 100644 --- a/src/api/java/baritone/api/utils/command/defaults/ExploreFilterCommand.java +++ b/src/api/java/baritone/api/utils/command/defaults/ExploreFilterCommand.java @@ -44,7 +44,7 @@ public class ExploreFilterCommand extends Command { boolean invert = false; if (args.has()) { - if (args.getS().equalsIgnoreCase("invert")) { + if (args.getString().equalsIgnoreCase("invert")) { invert = true; } else { throw new CommandInvalidTypeException(args.consumed(), "either \"invert\" or nothing"); diff --git a/src/api/java/baritone/api/utils/command/defaults/FollowCommand.java b/src/api/java/baritone/api/utils/command/defaults/FollowCommand.java index a2ae8951..201346e6 100644 --- a/src/api/java/baritone/api/utils/command/defaults/FollowCommand.java +++ b/src/api/java/baritone/api/utils/command/defaults/FollowCommand.java @@ -57,13 +57,13 @@ public class FollowCommand extends Command { List> classes = new ArrayList<>(); if (args.hasExactlyOne()) { - baritone.getFollowProcess().follow((group = args.getE(FollowGroup.class)).filter); + baritone.getFollowProcess().follow((group = args.getEnum(FollowGroup.class)).filter); list = null; } else { args.requireMin(2); group = null; - list = args.getE(FollowList.class); + list = args.getEnum(FollowList.class); while (args.has()) { //noinspection unchecked @@ -109,13 +109,13 @@ public class FollowCommand extends Command { return new TabCompleteHelper() .append(FollowGroup.class) .append(FollowList.class) - .filterPrefix(args.getS()) + .filterPrefix(args.getString()) .stream(); } else { Class followType; try { - followType = args.getE(FollowList.class).datatype; + followType = args.getEnum(FollowList.class).datatype; } catch (NullPointerException e) { return Stream.empty(); } diff --git a/src/api/java/baritone/api/utils/command/defaults/GoalCommand.java b/src/api/java/baritone/api/utils/command/defaults/GoalCommand.java index cb6a2fbf..692d6422 100644 --- a/src/api/java/baritone/api/utils/command/defaults/GoalCommand.java +++ b/src/api/java/baritone/api/utils/command/defaults/GoalCommand.java @@ -43,7 +43,7 @@ public class GoalCommand extends Command { protected void executed(String label, ArgConsumer args, Settings settings) { ICustomGoalProcess goalProcess = baritone.getCustomGoalProcess(); - if (args.has() && asList("reset", "clear", "none").contains(args.peekS())) { + if (args.has() && asList("reset", "clear", "none").contains(args.peekString())) { args.requireMax(1); if (nonNull(goalProcess.getGoal())) { @@ -83,7 +83,7 @@ public class GoalCommand extends Command { } } - return helper.filterPrefix(args.getS()).stream(); + return helper.filterPrefix(args.getString()).stream(); } @Override diff --git a/src/api/java/baritone/api/utils/command/defaults/HelpCommand.java b/src/api/java/baritone/api/utils/command/defaults/HelpCommand.java index e96bf5eb..efe0d0e2 100644 --- a/src/api/java/baritone/api/utils/command/defaults/HelpCommand.java +++ b/src/api/java/baritone/api/utils/command/defaults/HelpCommand.java @@ -89,7 +89,7 @@ public class HelpCommand extends Command { FORCE_COMMAND_PREFIX + "help %d" ); } else { - String commandName = args.getS().toLowerCase(); + String commandName = args.getString().toLowerCase(); Command command = getCommand(commandName); if (isNull(command)) { @@ -112,7 +112,7 @@ public class HelpCommand extends Command { @Override protected Stream tabCompleted(String label, ArgConsumer args, Settings settings) { if (args.hasExactlyOne()) { - return new TabCompleteHelper().addCommands().filterPrefix(args.getS()).stream(); + return new TabCompleteHelper().addCommands().filterPrefix(args.getString()).stream(); } return Stream.empty(); diff --git a/src/api/java/baritone/api/utils/command/defaults/PathCommand.java b/src/api/java/baritone/api/utils/command/defaults/PathCommand.java index 2eafe55c..c184db7f 100644 --- a/src/api/java/baritone/api/utils/command/defaults/PathCommand.java +++ b/src/api/java/baritone/api/utils/command/defaults/PathCommand.java @@ -68,7 +68,7 @@ public class PathCommand extends Command { if (!args.has(2)) { return new TabCompleteHelper() .append("~") - .filterPrefix(args.getS()) + .filterPrefix(args.getString()) .stream(); } } diff --git a/src/api/java/baritone/api/utils/command/defaults/ProcCommand.java b/src/api/java/baritone/api/utils/command/defaults/ProcCommand.java index 68dbc339..fdbb0a40 100644 --- a/src/api/java/baritone/api/utils/command/defaults/ProcCommand.java +++ b/src/api/java/baritone/api/utils/command/defaults/ProcCommand.java @@ -49,13 +49,13 @@ public class ProcCommand extends Command { logDirect(String.format( "Class: %s\n" + - "Priority: %s\n" + - "Temporary: %s\n" + + "Priority: %f\n" + + "Temporary: %b\n" + "Display name: %s\n" + "Last command: %s", process.getClass().getTypeName(), - Double.toString(process.priority()), - Boolean.toString(process.isTemporary()), + process.priority(), + process.isTemporary(), process.displayName(), pathingControlManager .mostRecentCommand() diff --git a/src/api/java/baritone/api/utils/command/defaults/SetCommand.java b/src/api/java/baritone/api/utils/command/defaults/SetCommand.java index e9541131..6a23c2a4 100644 --- a/src/api/java/baritone/api/utils/command/defaults/SetCommand.java +++ b/src/api/java/baritone/api/utils/command/defaults/SetCommand.java @@ -51,12 +51,12 @@ public class SetCommand extends Command { @Override protected void executed(String label, ArgConsumer args, Settings settings) { - String arg = args.has() ? args.getS().toLowerCase(Locale.US) : "list"; + String arg = args.has() ? args.getString().toLowerCase(Locale.US) : "list"; boolean viewModified = asList("m", "mod", "modified").contains(arg); boolean viewAll = asList("all", "l", "list").contains(arg); boolean paginate = viewModified | viewAll; if (paginate) { - String search = args.has() && args.peekAsOrNull(Integer.class) == null ? args.getS() : ""; + String search = args.has() && args.peekAsOrNull(Integer.class) == null ? args.getString() : ""; args.requireMax(1); List toPaginate = @@ -122,7 +122,7 @@ public class SetCommand extends Command { logDirect("Please specify 'all' as an argument to reset to confirm you'd really like to do this"); logDirect("ALL settings will be reset. Use the 'set modified' or 'modified' commands to see what will be reset."); logDirect("Specify a setting name instead of 'all' to only reset one setting"); - } else if (args.peekS().equalsIgnoreCase("all")) { + } else if (args.peekString().equalsIgnoreCase("all")) { SettingsUtil.modifiedSettings(settings).forEach(Settings.Setting::reset); logDirect("All settings have been reset to their default values"); @@ -134,7 +134,7 @@ public class SetCommand extends Command { args.requireMin(1); } - String settingName = doingSomething ? args.getS() : arg; + String settingName = doingSomething ? args.getString() : arg; Settings.Setting setting = settings.allSettings.stream() .filter(s -> s.getName().equalsIgnoreCase(settingName)) .findFirst() @@ -166,7 +166,7 @@ public class SetCommand extends Command { Boolean.toString((Boolean) setting.value) )); } else { - String newValue = args.getS(); + String newValue = args.getString(); try { SettingsUtil.parseAndApply(settings, arg, newValue); @@ -210,19 +210,19 @@ public class SetCommand extends Command { @Override protected Stream tabCompleted(String label, ArgConsumer args, Settings settings) { if (args.has()) { - String arg = args.getS(); + String arg = args.getString(); if (args.hasExactlyOne()) { if (arg.equalsIgnoreCase("reset")) { return new TabCompleteHelper() .addModifiedSettings() .prepend("all") - .filterPrefix(args.getS()) + .filterPrefix(args.getString()) .stream(); } else if (arg.equalsIgnoreCase("toggle")) { return new TabCompleteHelper() .addToggleableSettings() - .filterPrefix(args.getS()) + .filterPrefix(args.getString()) .stream(); } @@ -238,7 +238,7 @@ public class SetCommand extends Command { helper.append(of("false", "true")); } - return helper.filterPrefix(args.getS()).stream(); + return helper.filterPrefix(args.getString()).stream(); } else { return Stream.of(settingValueToString(setting)); } diff --git a/src/api/java/baritone/api/utils/command/helpers/arguments/ArgConsumer.java b/src/api/java/baritone/api/utils/command/helpers/arguments/ArgConsumer.java index 6c9ef884..8f6b91f0 100644 --- a/src/api/java/baritone/api/utils/command/helpers/arguments/ArgConsumer.java +++ b/src/api/java/baritone/api/utils/command/helpers/arguments/ArgConsumer.java @@ -84,21 +84,21 @@ public class ArgConsumer { return peek().is(type); } - public String peekS(int index) { + public String peekString(int index) { return peek(index).value; } - public String peekS() { - return peekS(0); + public String peekString() { + return peekString(0); } - public > E peekE(Class enumClass) { - return peek().getE(enumClass); + public > E peekEnum(Class enumClass) { + return peek().getEnum(enumClass); } - public > E peekEOrNull(Class enumClass) { + public > E peekEnumOrNull(Class enumClass) { try { - return peekE(enumClass); + return peekEnum(enumClass); } catch (NoSuchElementException e) { return null; } @@ -171,22 +171,22 @@ public class ArgConsumer { return arg; } - public String getS() { + public String getString() { return get().value; } - public > E getE(Class enumClass) { + public > E getEnum(Class enumClass) { try { - return get().getE(enumClass); + return get().getEnum(enumClass); } catch (NoSuchElementException e) { throw new CommandInvalidTypeException(consumed(), enumClass.getSimpleName()); } } - public > E getEOrNull(Class enumClass) { + public > E getEnumOrNull(Class enumClass) { try { - peekE(enumClass); - return getE(enumClass); + peekEnum(enumClass); + return getEnum(enumClass); } catch (CommandInvalidTypeException e) { return null; } diff --git a/src/launch/java/baritone/launch/mixins/MixinChatTabCompleter.java b/src/launch/java/baritone/launch/mixins/MixinChatTabCompleter.java index 8aabfd69..39fbb19d 100644 --- a/src/launch/java/baritone/launch/mixins/MixinChatTabCompleter.java +++ b/src/launch/java/baritone/launch/mixins/MixinChatTabCompleter.java @@ -1,3 +1,20 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + package baritone.launch.mixins; import net.minecraft.client.gui.GuiChat; diff --git a/src/launch/java/baritone/launch/mixins/MixinGuiChat.java b/src/launch/java/baritone/launch/mixins/MixinGuiChat.java index 310bfd7c..9af0a3e9 100644 --- a/src/launch/java/baritone/launch/mixins/MixinGuiChat.java +++ b/src/launch/java/baritone/launch/mixins/MixinGuiChat.java @@ -1,3 +1,20 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + package baritone.launch.mixins; import baritone.utils.accessor.ITabCompleter; diff --git a/src/launch/java/baritone/launch/mixins/MixinGuiScreen.java b/src/launch/java/baritone/launch/mixins/MixinGuiScreen.java index 0731df1f..35fcc38b 100644 --- a/src/launch/java/baritone/launch/mixins/MixinGuiScreen.java +++ b/src/launch/java/baritone/launch/mixins/MixinGuiScreen.java @@ -1,3 +1,20 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + package baritone.launch.mixins; import baritone.api.utils.command.Lol; diff --git a/src/launch/java/baritone/launch/mixins/MixinTabCompleter.java b/src/launch/java/baritone/launch/mixins/MixinTabCompleter.java index 4e36491b..6046ed21 100644 --- a/src/launch/java/baritone/launch/mixins/MixinTabCompleter.java +++ b/src/launch/java/baritone/launch/mixins/MixinTabCompleter.java @@ -1,3 +1,20 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + package baritone.launch.mixins; import baritone.api.BaritoneAPI; @@ -86,7 +103,7 @@ public abstract class MixinTabCompleter implements ITabCompleter { @Override public boolean onGuiChatSetCompletions(String[] newCompl) { - IBaritone baritone = BaritoneAPI.getProvider().getBaritoneForPlayer(Minecraft.getMinecraft().player); + IBaritone baritone = BaritoneAPI.getProvider().getPrimaryBaritone(); if (isNull(baritone)) { return false; diff --git a/src/launch/resources/mixins.baritone.json b/src/launch/resources/mixins.baritone.json index 66ef181d..1d1c356b 100644 --- a/src/launch/resources/mixins.baritone.json +++ b/src/launch/resources/mixins.baritone.json @@ -10,6 +10,7 @@ "client": [ "MixinAnvilChunkLoader", "MixinBlockPos", + "MixinChatTabCompleter", "MixinChunkProviderClient", "MixinChunkProviderServer", "MixinChunkRenderContainer", @@ -17,16 +18,15 @@ "MixinEntityLivingBase", "MixinEntityPlayerSP", "MixinEntityRenderer", + "MixinGuiChat", + "MixinGuiScreen", "MixinMinecraft", "MixinNetHandlerPlayClient", "MixinNetworkManager", "MixinRenderChunk", "MixinRenderList", - "MixinVboRenderList", - "MixinWorldClient", "MixinTabCompleter", - "MixinGuiChat", - "MixinChatTabCompleter", - "MixinGuiScreen" + "MixinVboRenderList", + "MixinWorldClient" ] } \ No newline at end of file