diff --git a/.github/workflows/gradle_build.yml b/.github/workflows/gradle_build.yml index 34e93bff2..2ad00904b 100644 --- a/.github/workflows/gradle_build.yml +++ b/.github/workflows/gradle_build.yml @@ -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: diff --git a/src/main/java/baritone/command/defaults/WaypointsCommand.java b/src/main/java/baritone/command/defaults/WaypointsCommand.java index 035ddd02e..671caf574 100644 --- a/src/main/java/baritone/command/defaults/WaypointsCommand.java +++ b/src/main/java/baritone/command/defaults/WaypointsCommand.java @@ -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.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 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()); diff --git a/src/main/java/baritone/utils/GuiClick.java b/src/main/java/baritone/utils/GuiClick.java index 07b4093e7..56953ceef 100644 --- a/src/main/java/baritone/utils/GuiClick.java +++ b/src/main/java/baritone/utils/GuiClick.java @@ -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 {