mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-26 20:16:12 +01:00
Make auto-fill check both buy and sell permission separately (#325)
Also slightly changes how the auto fill message is sent to not send two messages (autofill and no-permission)
This commit is contained in:
parent
7161c0bfdf
commit
0b39fd1a5e
@ -62,6 +62,9 @@ public class ErrorMessageSender implements Listener {
|
||||
case NOT_ENOUGH_MONEY:
|
||||
message = Messages.NOT_ENOUGH_MONEY;
|
||||
break;
|
||||
case ITEM_AUTOFILL:
|
||||
message = Messages.CLICK_TO_AUTOFILL_ITEM;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -52,7 +52,6 @@ public class ItemChecker implements Listener {
|
||||
if (item == null) {
|
||||
event.setSignLine(ITEM_LINE, ChatColor.BOLD + ChestShopSign.AUTOFILL_CODE);
|
||||
event.setOutcome(ITEM_AUTOFILL);
|
||||
event.getPlayer().sendMessage(Messages.prefix(Messages.CLICK_TO_AUTOFILL_ITEM));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -35,7 +35,8 @@ public class PermissionChecker implements Listener {
|
||||
ItemStack item = parseEvent.getItem();
|
||||
|
||||
if (item == null) {
|
||||
if (!Permission.has(player, SHOP_CREATION)) {
|
||||
if ((PriceUtil.hasBuyPrice(priceLine) && !Permission.has(player, SHOP_CREATION_BUY))
|
||||
|| (PriceUtil.hasSellPrice(priceLine) && !Permission.has(player, SHOP_CREATION_SELL))) {
|
||||
event.setOutcome(NO_PERMISSION);
|
||||
}
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user