holding control shouldnt make all bots sprint
This commit is contained in:
parent
246c00c773
commit
747bee41b7
@ -18,6 +18,7 @@
|
|||||||
package baritone.launch.mixins;
|
package baritone.launch.mixins;
|
||||||
|
|
||||||
import baritone.api.BaritoneAPI;
|
import baritone.api.BaritoneAPI;
|
||||||
|
import baritone.api.IBaritone;
|
||||||
import baritone.api.behavior.IPathingBehavior;
|
import baritone.api.behavior.IPathingBehavior;
|
||||||
import baritone.api.event.events.ChatEvent;
|
import baritone.api.event.events.ChatEvent;
|
||||||
import baritone.api.event.events.PlayerUpdateEvent;
|
import baritone.api.event.events.PlayerUpdateEvent;
|
||||||
@ -100,8 +101,16 @@ public class MixinEntityPlayerSP {
|
|||||||
)
|
)
|
||||||
private boolean isKeyDown(KeyBinding keyBinding) {
|
private boolean isKeyDown(KeyBinding keyBinding) {
|
||||||
SprintStateEvent event = new SprintStateEvent();
|
SprintStateEvent event = new SprintStateEvent();
|
||||||
BaritoneAPI.getProvider().getBaritoneForPlayer((EntityPlayerSP) (Object) this).getGameEventHandler().onPlayerSprintState(event);
|
IBaritone baritone = BaritoneAPI.getProvider().getBaritoneForPlayer((EntityPlayerSP) (Object) this);
|
||||||
return event.getState() == null ? keyBinding.isKeyDown() : event.getState();
|
baritone.getGameEventHandler().onPlayerSprintState(event);
|
||||||
|
if (event.getState() != null) {
|
||||||
|
return event.getState();
|
||||||
|
}
|
||||||
|
if (baritone == BaritoneAPI.getProvider().getPrimaryBaritone()) {
|
||||||
|
// hitting control shouldn't make all bots sprint
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return keyBinding.isKeyDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(
|
@Inject(
|
||||||
|
Loading…
Reference in New Issue
Block a user