use of net.ess3.api.events.SignBreakEvent in project Essentials by drtshock.
the class EssentialsSign method onSignBreak.
protected final boolean onSignBreak(final Block block, final Player player, final IEssentials ess) throws MaxMoneyException {
final ISign sign = new BlockSign(block);
final User user = ess.getUser(player);
try {
if (!(user.isAuthorized("essentials.signs." + signName.toLowerCase(Locale.ENGLISH) + ".break") || user.isAuthorized("essentials.signs.break." + signName.toLowerCase(Locale.ENGLISH)))) {
return false;
}
final SignBreakEvent signEvent = new SignBreakEvent(sign, this, user);
ess.getServer().getPluginManager().callEvent(signEvent);
if (signEvent.isCancelled()) {
return false;
}
return onSignBreak(sign, user, getUsername(user), ess);
} catch (SignException ex) {
showError(ess, user.getSource(), ex, signName);
return false;
}
}
use of net.ess3.api.events.SignBreakEvent in project Essentials by EssentialsX.
the class EssentialsSign method onSignBreak.
protected final boolean onSignBreak(final Block block, final Player player, final IEssentials ess) throws MaxMoneyException {
final ISign sign = new BlockSign(block);
final User user = ess.getUser(player);
try {
if (!(user.isAuthorized("essentials.signs." + signName.toLowerCase(Locale.ENGLISH) + ".break") || user.isAuthorized("essentials.signs.break." + signName.toLowerCase(Locale.ENGLISH)))) {
return false;
}
final SignBreakEvent signEvent = new SignBreakEvent(sign, this, user);
ess.getServer().getPluginManager().callEvent(signEvent);
if (signEvent.isCancelled()) {
return false;
}
return onSignBreak(sign, user, getUsername(user), ess);
} catch (SignException ex) {
showError(ess, user.getSource(), ex, signName);
return false;
}
}
Aggregations