Fix mistakes made while merging upwards

This commit is contained in:
ZacSharp 2022-04-14 19:08:42 +02:00
parent 23fa65cee0
commit 4dcf260059
No known key found for this signature in database
GPG Key ID: 9453647B005083A3
3 changed files with 18 additions and 12 deletions

View File

@ -26,6 +26,12 @@ jobs:
- name: Build with Gradle
run: ./gradlew build
- name: Build (fabric) with Gradle
run: ./gradlew build -Pbaritone.fabric_build
- name: Build (forge) with Gradle
run: ./gradlew build -Pbaritone.forge_build
- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:

View File

@ -156,8 +156,8 @@ public class WaypointsCommand extends Command {
ForWaypoints.waypoints(this.baritone).removeWaypoint(waypoint);
}
deletedWaypoints.computeIfAbsent(baritone.getWorldProvider().getCurrentWorld(), k -> new ArrayList<>()).addAll(Arrays.<IWaypoint>asList(waypoints));
ITextComponent textComponent = new StringTextComponent(String.format("Cleared %d waypoints, click to restore them", waypoints.length));
textComponent.getStyle().setClickEvent(new ClickEvent(
TextComponent textComponent = new StringTextComponent(String.format("Cleared %d waypoints, click to restore them", waypoints.length));
textComponent.setStyle(textComponent.getStyle().setClickEvent(new ClickEvent(
ClickEvent.Action.RUN_COMMAND,
String.format(
"%s%s restore @ %s",
@ -165,7 +165,7 @@ public class WaypointsCommand extends Command {
label,
Stream.of(waypoints).map(wp -> Long.toString(wp.getCreationTimestamp())).collect(Collectors.joining(" "))
)
));
)));
logDirect(textComponent);
} else if (action == Action.RESTORE) {
List<IWaypoint> waypoints = new ArrayList<>();
@ -260,7 +260,7 @@ public class WaypointsCommand extends Command {
)
)));
TextComponent recreateComponent = new StringTextComponent("Click to show a command to recreate this waypoint");
recreateComponent.getStyle().setClickEvent(new ClickEvent(
recreateComponent.setStyle(recreateComponent.getStyle().setClickEvent(new ClickEvent(
ClickEvent.Action.SUGGEST_COMMAND,
String.format(
"%s%s save %s %s %s %s %s",
@ -272,16 +272,16 @@ public class WaypointsCommand extends Command {
waypoint.getLocation().y,
waypoint.getLocation().z
)
));
)));
TextComponent backComponent = new StringTextComponent("Click to return to the waypoints list");
backComponent.getStyle().setClickEvent(new ClickEvent(
backComponent.setStyle(backComponent.getStyle().setClickEvent(new ClickEvent(
ClickEvent.Action.RUN_COMMAND,
String.format(
"%s%s list",
FORCE_COMMAND_PREFIX,
label
)
));
)));
logDirect(deleteComponent);
logDirect(goalComponent);
logDirect(recreateComponent);
@ -289,8 +289,8 @@ public class WaypointsCommand extends Command {
} else if (action == Action.DELETE) {
ForWaypoints.waypoints(this.baritone).removeWaypoint(waypoint);
deletedWaypoints.computeIfAbsent(baritone.getWorldProvider().getCurrentWorld(), k -> new ArrayList<>()).add(waypoint);
ITextComponent textComponent = new StringTextComponent("That waypoint has successfully been deleted, click to restore it");
textComponent.getStyle().setClickEvent(new ClickEvent(
TextComponent textComponent = new StringTextComponent("That waypoint has successfully been deleted, click to restore it");
textComponent.setStyle(textComponent.getStyle().setClickEvent(new ClickEvent(
ClickEvent.Action.RUN_COMMAND,
String.format(
"%s%s restore @ %s",
@ -298,7 +298,7 @@ public class WaypointsCommand extends Command {
label,
waypoint.getCreationTimestamp()
)
));
)));
logDirect(textComponent);
} else if (action == Action.GOAL) {
Goal goal = new GoalBlock(waypoint.getLocation());

View File

@ -88,12 +88,12 @@ public class GuiClick extends Screen implements Helper {
BaritoneAPI.getProvider().getPrimaryBaritone().getSelectionManager().removeAllSelections();
BaritoneAPI.getProvider().getPrimaryBaritone().getSelectionManager().addSelection(BetterBlockPos.from(clickStart), BetterBlockPos.from(currentMouseOver));
TextComponent component = new StringTextComponent("Selection made! For usage: " + Baritone.settings().prefix.value + "help sel");
component.getStyle()
component.setStyle(component.getStyle()
.setFormatting(TextFormatting.WHITE)
.setClickEvent(new ClickEvent(
ClickEvent.Action.RUN_COMMAND,
FORCE_COMMAND_PREFIX + "help sel"
));
)));
Helper.HELPER.logDirect(component);
clickStart = null;
} else {