Create allow-bulk-buy-sell config option. Resolves #765.

This commit is contained in:
Ali Moghnieh 2016-07-26 12:25:20 +01:00
parent a76b20f1b5
commit f1d9cda5eb
No known key found for this signature in database
GPG Key ID: F09D3A1BAF2E6D70
5 changed files with 13 additions and 2 deletions

View File

@ -267,4 +267,6 @@ public interface ISettings extends IConf {
List<EssentialsSign> getUnprotectedSignNames();
boolean isPastebinCreateKit();
boolean isAllowBulkBuySell();
}

View File

@ -1359,4 +1359,9 @@ public class Settings implements net.ess3.api.ISettings {
public boolean isPastebinCreateKit() {
return config.getBoolean("pastebin-createkit", true);
}
@Override
public boolean isAllowBulkBuySell() {
return config.getBoolean("allow-bulk-buy-sell", false);
}
}

View File

@ -29,7 +29,7 @@ public class SignBuy extends EssentialsSign {
Trade charge = getTrade(sign, 3, ess);
// Check if the player is trying to buy in bulk.
if (player.getBase().isSneaking()) {
if (ess.getSettings().isAllowBulkBuySell() && player.getBase().isSneaking()) {
ItemStack heldItem = player.getItemInHand();
if (items.getItemStack().isSimilar(heldItem)) {
int initialItemAmount = items.getItemStack().getAmount();

View File

@ -30,7 +30,7 @@ public class SignSell extends EssentialsSign {
Trade money = getTrade(sign, 3, ess);
// Check if the player is trying to sell in bulk.
if (player.getBase().isSneaking()) {
if (ess.getSettings().isAllowBulkBuySell() && player.getBase().isSneaking()) {
ItemStack heldItem = player.getItemInHand();
if (charge.getItemStack().isSimilar(heldItem)) {
int initialItemAmount = charge.getItemStack().getAmount();

View File

@ -522,6 +522,10 @@ npcs-in-balance-ranking: false
# WARNING: If this is false, the config comments WILL be removed and it won't look the same as it does now.
pastebin-createkit: true
# Allow bulk buying and selling signs when the player is sneaking.
# This is useful when a sign sells or buys one item at a time and the player wants to sell a bunch at once.
allow-bulk-buy-sell: true
############################################################
# +------------------------------------------------------+ #
# | EssentialsHome | #