Revert "Explicitly set user for break blocks listener"

This reverts commit 5beeb97f99.
This commit is contained in:
tastybento 2019-02-11 07:16:16 -08:00
parent bcb1a3ae24
commit 28c89ff814
2 changed files with 11 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import world.bentobox.bentobox.api.flags.FlagListener;
@ -262,4 +263,13 @@ public class BlockInteractionListener extends FlagListener {
}
}
/**
* Prevents blocks that are protected from being broken, which would bypass the protection
*
* @param e - event
*/
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockBreak(final BlockBreakEvent e) {
checkClickedBlock(e, e.getBlock().getLocation(), e.getBlock().getType());
}
}

View File

@ -29,7 +29,7 @@ public class BreakBlocksListener extends FlagListener {
*/
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockBreak(final BlockBreakEvent e) {
setUser(User.getInstance(e.getPlayer())).checkIsland(e, e.getBlock().getLocation(), Flags.BREAK_BLOCKS);
checkIsland(e, e.getBlock().getLocation(), Flags.BREAK_BLOCKS);
}
/**