MCPcopy Create free account
hub / github.com/cabaletta/baritone / mouseReleased

Method mouseReleased

src/main/java/baritone/utils/GuiClick.java:86–110  ·  view source on GitHub ↗
(double mouseX, double mouseY, int mouseButton)

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 12

getProviderMethod · 0.95
fromMethod · 0.95
settingsMethod · 0.95
logDirectMethod · 0.80
setGoalAndPathMethod · 0.80
aboveMethod · 0.80
removeAllSelectionsMethod · 0.65
getSelectionManagerMethod · 0.65
getPrimaryBaritoneMethod · 0.65
addSelectionMethod · 0.65
getCustomGoalProcessMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected