mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
Create allow-bulk-buy-sell config option. Resolves #765.
This commit is contained in:
parent
a76b20f1b5
commit
f1d9cda5eb
5 changed files with 13 additions and 2 deletions
|
@ -267,4 +267,6 @@ public interface ISettings extends IConf {
|
|||
List<EssentialsSign> getUnprotectedSignNames();
|
||||
|
||||
boolean isPastebinCreateKit();
|
||||
|
||||
boolean isAllowBulkBuySell();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 | #
|
||||
|
|
Loading…
Reference in a new issue