use of net.ess3.api.IEssentials in project Essentials by drtshock.
the class EssentialsSign method onSignInteract.
protected final boolean onSignInteract(final Block block, final Player player, final IEssentials ess) {
final ISign sign = new BlockSign(block);
final User user = ess.getUser(player);
if (user.checkSignThrottle()) {
return false;
}
try {
if (user.getBase().isDead() || !(user.isAuthorized("essentials.signs." + signName.toLowerCase(Locale.ENGLISH) + ".use") || user.isAuthorized("essentials.signs.use." + signName.toLowerCase(Locale.ENGLISH)))) {
return false;
}
final SignInteractEvent signEvent = new SignInteractEvent(sign, this, user);
ess.getServer().getPluginManager().callEvent(signEvent);
if (signEvent.isCancelled()) {
return false;
}
return onSignInteract(sign, user, getUsername(user), ess);
} catch (ChargeException ex) {
showError(ess, user.getSource(), ex, signName);
return false;
} catch (Exception ex) {
showError(ess, user.getSource(), ex, signName);
return false;
}
}
use of net.ess3.api.IEssentials in project Essentials by drtshock.
the class EssentialsSign method getItemStack.
protected final ItemStack getItemStack(final String itemName, final int quantity, final IEssentials ess) throws SignException {
try {
final ItemStack item = ess.getItemDb().get(itemName);
item.setAmount(quantity);
return item;
} catch (Exception ex) {
throw new SignException(ex.getMessage(), ex);
}
}
Aggregations