ignoreCancelled via annotation
This commit is contained in:
parent
775ef40b1a
commit
7506a7f1c1
1 changed files with 4 additions and 4 deletions
|
@ -35,9 +35,9 @@ public class BlockListener implements Listener {
|
||||||
this.mod = mod;
|
this.mod = mod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void onBlockBreak(BlockBreakEvent event) {
|
public void onBlockBreak(BlockBreakEvent event) {
|
||||||
if (!event.isCancelled() && event.getPlayer().getGameMode() == GameMode.CREATIVE) {
|
if (event.getPlayer().getGameMode() == GameMode.CREATIVE) {
|
||||||
if (mod.getConfig().getBlockBreak().isListed(event.getBlock())) {
|
if (mod.getConfig().getBlockBreak().isListed(event.getBlock())) {
|
||||||
if (!checkPermission(event.getPlayer(), NoLimitPermissions.BREAK(event.getBlock()))) {
|
if (!checkPermission(event.getPlayer(), NoLimitPermissions.BREAK(event.getBlock()))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -46,9 +46,9 @@ public class BlockListener implements Listener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@EventHandler
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void onBlockPlace(BlockPlaceEvent event) {
|
public void onBlockPlace(BlockPlaceEvent event) {
|
||||||
if (!event.isCancelled() && event.getPlayer().getGameMode() == GameMode.CREATIVE) {
|
if (event.getPlayer().getGameMode() == GameMode.CREATIVE) {
|
||||||
if (mod.getConfig().getBlockUse().isListed(event.getBlock())) {
|
if (mod.getConfig().getBlockUse().isListed(event.getBlock())) {
|
||||||
if (!checkPermission(event.getPlayer(), NoLimitPermissions.USE(event.getBlock()))) {
|
if (!checkPermission(event.getPlayer(), NoLimitPermissions.USE(event.getBlock()))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
Loading…
Reference in a new issue