(double mouseX, double mouseY, int mouseButton)
| 84 | } |
| 85 | |
| 86 | @Override |
| 87 | public boolean mouseReleased(double mouseX, double mouseY, int mouseButton) { |
| 88 | if (currentMouseOver != null) { //Catch this, or else a click into void will result in a crash |
| 89 | if (mouseButton == 0) { |
| 90 | if (clickStart != null && !clickStart.equals(currentMouseOver)) { |
| 91 | BaritoneAPI.getProvider().getPrimaryBaritone().getSelectionManager().removeAllSelections(); |
| 92 | BaritoneAPI.getProvider().getPrimaryBaritone().getSelectionManager().addSelection(BetterBlockPos.from(clickStart), BetterBlockPos.from(currentMouseOver)); |
| 93 | MutableComponent component = Component.literal("Selection made! For usage: " + Baritone.settings().prefix.value + "help sel"); |
| 94 | component.setStyle(component.getStyle() |
| 95 | .withColor(ChatFormatting.WHITE) |
| 96 | .withClickEvent(new ClickEvent.RunCommand( |
| 97 | FORCE_COMMAND_PREFIX + "help sel" |
| 98 | ))); |
| 99 | Helper.HELPER.logDirect(component); |
| 100 | clickStart = null; |
| 101 | } else { |
| 102 | BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalBlock(currentMouseOver)); |
| 103 | } |
| 104 | } else if (mouseButton == 1) { |
| 105 | BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalBlock(currentMouseOver.above())); |
| 106 | } |
| 107 | } |
| 108 | clickStart = null; |
| 109 | return super.mouseReleased(mouseX, mouseY, mouseButton); |
| 110 | } |
| 111 | |
| 112 | @Override |
| 113 | public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) { |
nothing calls this directly
no test coverage detected