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