add bypass-owner-check in config.yml

Former-commit-id: 0e31cabf3169ee3a92cedec1e416aadd69e5732a
This commit is contained in:
Ghost_chu committed 2018-08-02 19:54:11 +08:00
1 parent f0c17f7118
commit 4a62044a82
3 files changed
+15 -3

No files matched your search

@@ -30,7 +30,7 @@ import org.maxgamer.quickshop.Util.Permissions;
import org.maxgamer.quickshop.Util.Util;
public class ShopManager {
private QuickShop plugin;
QuickShop plugin = QuickShop.instance;
private HashMap<UUID, Info> actions = new HashMap<UUID, Info>();
private HashMap<String, HashMap<ShopChunk, HashMap<Location, Shop>>> shops = new HashMap<String, HashMap<ShopChunk, HashMap<Location, Shop>>>();
final private static ItemStack AIR = new ItemStack(Material.AIR);
@@ -562,10 +562,13 @@ public class ShopManager {
if (e.isCancelled())
return; // Cancelled
// Money handling
if (!p.getUniqueId().equals(shop.getOwner())) {
if (!p.getUniqueId().equals(shop.getOwner()) || plugin.getConfig().getBoolean("shop.bypass-owner-check")) {
// Don't tax them if they're purchasing from
// themselves.
// Do charge an amount of tax though.
//Add a warning
double tax = plugin.getConfig().getDouble("tax");
double total = amount * shop.getPrice();
if (!shop.isUnlimited() || plugin.getConfig().getBoolean("shop.pay-unlimited-shop-owners")) {
@@ -601,6 +604,11 @@ public class ShopManager {
if (space == amount)
msg += "\n" + MsgUtil.getMessage("shop-out-of-space", "" + shop.getLocation().getBlockX(), "" + shop.getLocation().getBlockY(), "" + shop.getLocation().getBlockZ());
MsgUtil.send(shop.getOwner(), msg);
}else {
if(p.getUniqueId().equals(shop.getOwner()) && !plugin.getConfig().getBoolean("shop.bypass-owner-check")) {
p.sendMessage(MsgUtil.getMessage("owner-bypass-check"));
//Bypass check message
}
}
shop.buy(p, amount);
MsgUtil.sendSellSuccess(p, shop, amount);
+4 -1
View File
@@ -76,6 +76,9 @@ shop:
#If you buy from YOUR unlimited shop, you will NEVER be charged $$, regardless of this setting
pay-unlimited-shop-owners: false
#Still discounts money when shop's owner tradeing with himself shop...
bypass-owner-check: false
#Should we place display items on the chests? This may cause duped items, especially for modded servers.
display-items: true
@@ -89,7 +92,7 @@ shop:
#List of items to disallow selling of. Anyone with quickshop.bypass.<itemID> can bypass it
blacklist:
- 7 #Bedrock
- Bedrock
#List of items with restricted prices. Format: <ItemID>;<MinPrice>;<MaxPrice>
+1
View File
@@ -42,6 +42,7 @@ refill-success: "&aRefill success"
empty-success: "&aEmpty success"
admin-shop: "AdminShop"
unknown-owner: "Unknown"
owner-bypass-check: "&eBypass all check,Trade successful! (You are shop owner)"
menu:
successful-purchase: "&aSuccessfully Purchased:"