Sets the event priority for protection events to LOWEST

This commit is contained in:
Kristian Knarvik 2022-02-18 17:53:42 +01:00
parent 9753e51cb5
commit 4d27cc36eb

View File

@ -13,6 +13,7 @@ import org.bukkit.block.data.type.WallSign;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockExplodeEvent;
@ -30,27 +31,27 @@ import static net.knarcraft.permissionsigns.PermissionSigns.extensiveSignProtect
*/
public class BlockListener implements Listener {
@EventHandler
@EventHandler(priority = EventPriority.LOWEST)
public void onPistonExtend(BlockPistonExtendEvent event) {
preventDestruction(event.getBlocks(), event);
}
@EventHandler
@EventHandler(priority = EventPriority.LOWEST)
public void onPistonRetract(BlockPistonRetractEvent event) {
preventDestruction(event.getBlocks(), event);
}
@EventHandler
@EventHandler(priority = EventPriority.LOWEST)
public void onBlockExplode(BlockExplodeEvent event) {
preventDestruction(event.blockList(), event);
}
@EventHandler
@EventHandler(priority = EventPriority.LOWEST)
public void onEntityExplode(EntityExplodeEvent event) {
preventDestruction(event.blockList(), event);
}
@EventHandler
@EventHandler(priority = EventPriority.LOWEST)
public void onBlockBreak(BlockBreakEvent event) {
Block block = event.getBlock();
Player player = event.getPlayer();