mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-30 20:37:52 +01:00
Re-order some stuff.
This commit is contained in:
parent
f30bccd7d3
commit
fbcacf6d40
@ -31,18 +31,6 @@ public class CombinedListener implements Listener {
|
||||
this.improbable = new Improbable();
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOW)
|
||||
public void onPlayerToggleSneak(final PlayerToggleSneakEvent event){
|
||||
// Check also in case of cancelled events.
|
||||
if (Improbable.check(event.getPlayer(), 0.35f, System.currentTimeMillis())) event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOW)
|
||||
public void onPlayerToggleSprint(final PlayerToggleSprintEvent event){
|
||||
// Check also in case of cancelled events.
|
||||
if (Improbable.check(event.getPlayer(), 0.35f, System.currentTimeMillis())) event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled = false)
|
||||
public final void onPlayerMove(final PlayerMoveEvent event){
|
||||
final long now = System.currentTimeMillis();
|
||||
@ -100,6 +88,12 @@ public class CombinedListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOW)
|
||||
public void onPlayerToggleSprint(final PlayerToggleSprintEvent event){
|
||||
// Check also in case of cancelled events.
|
||||
if (Improbable.check(event.getPlayer(), 0.35f, System.currentTimeMillis())) event.setCancelled(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* A workaround for cancelled PlayerToggleSprintEvents.
|
||||
*
|
||||
@ -109,20 +103,16 @@ public class CombinedListener implements Listener {
|
||||
@EventHandler(
|
||||
priority = EventPriority.HIGHEST)
|
||||
public void onPlayerToggleSprintHighest(final PlayerToggleSprintEvent event) {
|
||||
/*
|
||||
* _____ _ _______ _ _____ _ _
|
||||
* | __ \| | |__ __| | | / ____| (_) | |
|
||||
* | |__) | | __ _ _ _ ___ _ __ | | ___ __ _ __ _| | ___ | (___ _ __ _ __ _ _ __ | |_
|
||||
* | ___/| |/ _` | | | |/ _ \ '__| | |/ _ \ / _` |/ _` | |/ _ \ \___ \| '_ \| '__| | '_ \| __|
|
||||
* | | | | (_| | |_| | __/ | | | (_) | (_| | (_| | | __/ ____) | |_) | | | | | | | |_
|
||||
* |_| |_|\__,_|\__, |\___|_| |_|\___/ \__, |\__, |_|\___| |_____/| .__/|_| |_|_| |_|\__|
|
||||
* __/ | __/ | __/ | | |
|
||||
* |___/ |___/ |___/ |_|
|
||||
*/
|
||||
// Some plugins cancel "sprinting", which makes no sense at all because it doesn't stop people from sprinting
|
||||
// and rewards them by reducing their hunger bar as if they were walking instead of sprinting.
|
||||
if (event.isCancelled() && event.isSprinting())
|
||||
event.setCancelled(false);
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOW)
|
||||
public void onPlayerToggleSneak(final PlayerToggleSneakEvent event){
|
||||
// Check also in case of cancelled events.
|
||||
if (Improbable.check(event.getPlayer(), 0.35f, System.currentTimeMillis())) event.setCancelled(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user