blob: ef86ae485e85a9df5809e0a9b439b57467a5ded3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package org.bukkit.event.player;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
/**
* Called when a player toggles their sprinting state
*/
public class PlayerToggleSprintEvent extends PlayerEvent implements Cancellable {
private boolean isSprinting;
private boolean cancel = false;
public PlayerToggleSprintEvent(final Player player, boolean isSprinting) {
super(Type.PLAYER_TOGGLE_SPRINT, player);
this.isSprinting = isSprinting;
}
/**
* Gets whether the player is now sprinting or not.
*
* @return sprinting state
*/
public boolean isSprinting() {
return isSprinting;
}
public boolean isCancelled() {
return cancel;
}
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
}
|