!Ignore cancelled

This commit is contained in:
Indyuce 2019-10-20 14:27:17 +02:00
parent 83466f92f9
commit 933357ac25

View File

@ -25,10 +25,10 @@ import net.Indyuce.mmocore.manager.RestrictionManager.BlockPermissions;
public class BlockListener implements Listener {
private static final BlockFace[] order = { BlockFace.UP, BlockFace.DOWN, BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH };
@EventHandler(priority = EventPriority.HIGH)
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void a(BlockBreakEvent event) {
Player player = event.getPlayer();
if (player.getGameMode() == GameMode.CREATIVE || event.isCancelled())
if (player.getGameMode() == GameMode.CREATIVE)
return;
String savedData = event.getBlock().getBlockData().getAsString();
@ -69,7 +69,6 @@ public class BlockListener implements Listener {
return;
}
/*
* remove vanilla drops if needed
*/
@ -79,8 +78,8 @@ public class BlockListener implements Listener {
}
/*
* apply triggers, add experience info to the event so the other events
* can give exp to other TOOLS and display HOLOGRAMS
* apply triggers, add experience info to the event so the other
* events can give exp to other TOOLS and display HOLOGRAMS
*/
if (info.hasTriggers()) {
PlayerData playerData = PlayerData.get(player);
@ -89,7 +88,8 @@ public class BlockListener implements Listener {
trigger.apply(playerData);
});
if (!block.hasMetadata("player_placed") && info.hasExperience() && MMOCore.plugin.hasHolograms())
MMOCore.plugin.hologramSupport.displayIndicator(block.getLocation().add(.5, 1.5, .5), MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", "" + called.getGainedExperience().getValue()).message(), player);
MMOCore.plugin.hologramSupport.displayIndicator(block.getLocation().add(.5, 1.5, .5),
MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", "" + called.getGainedExperience().getValue()).message(), player);
}
/*