Cancel interaction for players who are not online.

This commit is contained in:
asofold 2017-05-31 21:03:22 +02:00
parent afe080f1c2
commit 7e43deaa28
1 changed files with 4 additions and 0 deletions

View File

@ -91,6 +91,7 @@ public class BlockInteractListener extends CheckListener {
private final Counters counters = NCPAPIProvider.getNoCheatPlusAPI().getGenericInstance(Counters.class);
private final int idCancelDead = counters.registerKey("cancel.dead");
private final int idCancelOffline = counters.registerKey("cancel.offline");
private final int idInteractLookCurrent = counters.registerKey("block.interact.look.current");
private final int idInteractLookFlyingFirst = counters.registerKey("block.interact.look.flying.first");
private final int idInteractLookFlyingOther = counters.registerKey("block.interact.look.flying.other");
@ -120,6 +121,9 @@ public class BlockInteractListener extends CheckListener {
*/
cancelId = idCancelDead;
}
else if (!player.isOnline()) {
cancelId = idCancelOffline;
}
else if (MovingUtil.hasScheduledPlayerSetBack(player)) {
// Might log.
cancelId = -1; // No counters yet, but do prevent.