Cancel commands when authenticating with 2FA
This commit is contained in:
parent
fa6a60981c
commit
a2472f45b4
|
@ -294,13 +294,13 @@ public class TwoFactorAuth extends MiniClientPlugin<TwoFactorData>
|
|||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onCommand(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
if (player.hasMetadata(TFA_SETUP) || player.hasMetadata(TFA_AUTHENTICATING))
|
||||
{
|
||||
event.setMessage("");
|
||||
event.setMessage("/");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue