Lowers priority of banned command listener to catch before other plugins

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1103
This commit is contained in:
tastybento 2020-01-06 13:02:50 -08:00
parent 28200a44a8
commit c385ee78f5

View File

@ -32,7 +32,7 @@ public class BannedCommands implements Listener {
* Prevents visitors from using commands on islands, like /spawner
* @param e - event
*/
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onVisitorCommand(PlayerCommandPreprocessEvent e) {
if (!plugin.getIWM().inWorld(e.getPlayer().getLocation()) || e.getPlayer().isOp()
|| e.getPlayer().hasPermission(plugin.getIWM().getPermissionPrefix(e.getPlayer().getWorld()) + "mod.bypassprotect")
@ -53,7 +53,7 @@ public class BannedCommands implements Listener {
* Prevents falling players from using commands, like /warp
* @param e - event
*/
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onFallingCommand(PlayerCommandPreprocessEvent e) {
if (!plugin.getIWM().inWorld(e.getPlayer().getLocation()) || e.getPlayer().isOp()
|| e.getPlayer().hasPermission(plugin.getIWM().getPermissionPrefix(e.getPlayer().getWorld()) + "mod.bypassprotect")