Fix SprintStateEvent
This commit is contained in:
parent
aa2e680568
commit
f5446cc415
@ -17,21 +17,14 @@
|
||||
|
||||
package baritone.api.event.events;
|
||||
|
||||
import baritone.api.event.events.type.ManagedPlayerEvent;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
|
||||
/**
|
||||
* @author Brady
|
||||
* @since 1/18/2019
|
||||
*/
|
||||
public class SprintStateEvent extends ManagedPlayerEvent {
|
||||
public class SprintStateEvent {
|
||||
|
||||
private Boolean state;
|
||||
|
||||
public SprintStateEvent(EntityPlayerSP player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public final void setState(boolean state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
@ -98,9 +98,8 @@ public class MixinEntityPlayerSP {
|
||||
)
|
||||
)
|
||||
private boolean isKeyDown(KeyBinding keyBinding) {
|
||||
EntityPlayerSP self = (EntityPlayerSP) (Object) this;
|
||||
SprintStateEvent event = new SprintStateEvent(self);
|
||||
BaritoneAPI.getProvider().getBaritoneForPlayer(self).getGameEventHandler().onPlayerSprintState(event);
|
||||
SprintStateEvent event = new SprintStateEvent();
|
||||
BaritoneAPI.getProvider().getBaritoneForPlayer((EntityPlayerSP) (Object) this).getGameEventHandler().onPlayerSprintState(event);
|
||||
return event.getState() == null ? keyBinding.isKeyDown() : event.getState();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user