Fix build error

This commit is contained in:
Ghost_chu committed 2021-06-13 21:05:33 +08:00
1 parent 160208d652
commit debaee3122
8 files changed
+36 -39

No files matched your search

@@ -165,7 +165,7 @@ public class InternalListener implements Listener {
if (event.getPurchaser().equals(event.getShop().getOwner())) {
Player player = Bukkit.getPlayer(event.getPurchaser());
if (player != null) {
MsgUtil.sendMessage(player, "shop-owner-self-trade", player);
MsgUtil.sendMessage(player, "shop-owner-self-trade");
}
}
}
@@ -394,11 +394,11 @@ public class CommandManager implements TabCompleter, CommandExecutor {
List<String> requirePermissions = container.getPermissions();
List<String> selectivePermissions = container.getSelectivePermissions();
if (!checkPermissions(sender, commandLabel, passThroughArgs, requirePermissions, PermissionType.REQUIRE, Action.EXECUTE)) {
MsgUtil.sendMessage(sender, "no-permission", sender);
MsgUtil.sendMessage(sender, "no-permission");
return true;
}
if (!checkPermissions(sender, commandLabel, passThroughArgs, selectivePermissions, PermissionType.SELECTIVE, Action.EXECUTE)) {
MsgUtil.sendMessage(sender, "no-permission", sender);
MsgUtil.sendMessage(sender, "no-permission");
return true;
}
@@ -64,7 +64,7 @@ public class SubCommand_Reset implements CommandProcesser {
MsgUtil.loadItemi18n();
MsgUtil.loadEnchi18n();
MsgUtil.loadPotioni18n();
MsgUtil.sendMessage(sender"complete");
MsgUtil.sendMessage(sender, "complete");
break;
case "config":
File config = new File(plugin.getDataFolder(), "config.yml");
@@ -75,7 +75,7 @@ public class SubCommand_SetOwner implements CommandProcesser {
return;
}
shop.setOwner(newShopOwner.getUniqueId());
MsgUtil.sendMessage(sender, "command.new-owner", newShopOwner.getName()))
MsgUtil.sendMessage(sender, "command.new-owner", newShopOwner.getName());
return;
}
@@ -73,14 +73,14 @@ public class BlockListener extends ProtectionListenerBase {
if (p.getInventory().getItemInMainHand().getType() == Material.GOLDEN_AXE) {
if (getPlugin().getConfig().getBoolean("shop.disable-super-tool")) {
e.setCancelled(true);
MsgUtil.sendMessage(p, "supertool-is-disabled", p);
MsgUtil.sendMessage(p, "supertool-is-disabled");
return;
}
MsgUtil.sendMessage(p, "break-shop-use-supertool", p);
MsgUtil.sendMessage(p, "break-shop-use-supertool");
return;
}
e.setCancelled(true);
MsgUtil.sendMessage(p, "no-creative-break", p, MsgUtil.getItemi18n(Material.GOLDEN_AXE.name()));
MsgUtil.sendMessage(p, "no-creative-break", MsgUtil.getItemi18n(Material.GOLDEN_AXE.name()));
return;
}
@@ -93,7 +93,7 @@ public class BlockListener extends ProtectionListenerBase {
plugin.log("Deleting shop " + shop + " request by block break.");
shop.delete();
MsgUtil.sendMessage(p, "success-removed-shop", p);
MsgUtil.sendMessage(p, "success-removed-shop");
} else if (Util.isWallSign(b.getType())) {
BlockState state = PaperLib.getBlockState(b, false).getState();
if (state instanceof Sign) {
@@ -117,16 +117,16 @@ public class BlockListener extends ProtectionListenerBase {
if (p.getInventory().getItemInMainHand().getType() == Material.GOLDEN_AXE) {
if (getPlugin().getConfig().getBoolean("shop.disable-super-tool")) {
e.setCancelled(true);
MsgUtil.sendMessage(p, "supertool-is-disabled", p);
MsgUtil.sendMessage(p, "supertool-is-disabled");
return;
}
MsgUtil.sendMessage(p, "break-shop-use-supertool", p);
MsgUtil.sendMessage(p, "break-shop-use-supertool");
plugin.log("Deleting shop " + shop + " request by block break (super tool).");
shop.delete();
return;
}
e.setCancelled(true);
MsgUtil.sendMessage(p, "no-creative-break", p, MsgUtil.getItemi18n(Material.GOLDEN_AXE.name()));
MsgUtil.sendMessage(p, "no-creative-break", MsgUtil.getItemi18n(Material.GOLDEN_AXE.name()));
return;
}
//Allow Shop owner break the shop sign(for sign replacement)
@@ -232,11 +232,11 @@ public class BlockListener extends ProtectionListenerBase {
if (shop != null) {
if (!QuickShop.getPermissionManager().hasPermission(player, "quickshop.create.double")) {
e.setCancelled(true);
MsgUtil.sendMessage(player, "no-double-chests", player);
MsgUtil.sendMessage(player, "no-double-chests");
} else if (!shop.getModerator().isModerator(player.getUniqueId())) {
e.setCancelled(true);
MsgUtil.sendMessage(player, "not-managed-shop", player);
MsgUtil.sendMessage(player, "not-managed-shop");
}
}
}
@@ -74,7 +74,7 @@ public class LockListener extends ProtectionListenerBase {
if (!shop.getOwner().equals(p.getUniqueId())
&& !QuickShop.getPermissionManager().hasPermission(p, "quickshop.other.destroy")) {
e.setCancelled(true);
MsgUtil.sendMessage(p, "no-permission", p);
MsgUtil.sendMessage(p, "no-permission");
}
} else if (Util.isWallSign(b.getType())) {
if (b instanceof Sign) {
@@ -102,7 +102,7 @@ public class LockListener extends ProtectionListenerBase {
if (!shop.getOwner().equals(p.getUniqueId())
&& !QuickShop.getPermissionManager().hasPermission(p, "quickshop.other.destroy")) {
e.setCancelled(true);
MsgUtil.sendMessage(p, "no-permission", p);
MsgUtil.sendMessage(p, "no-permission");
}
}
}
@@ -134,10 +134,10 @@ public class LockListener extends ProtectionListenerBase {
if (!shop.getModerator().isModerator(p.getUniqueId())) {
if (QuickShop.getPermissionManager().hasPermission(p, "quickshop.other.open")) {
MsgUtil.sendMessage(p, "bypassing-lock", p);
MsgUtil.sendMessage(p, "bypassing-lock");
return;
}
MsgUtil.sendMessage(p, "that-is-locked", p);
MsgUtil.sendMessage(p, "that-is-locked");
e.setCancelled(true);
}
}
@@ -161,11 +161,11 @@ public class LockListener extends ProtectionListenerBase {
}
if (QuickShop.getPermissionManager().hasPermission(p, "quickshop.other.open")) {
MsgUtil.sendMessage(p, "bypassing-lock", p);
MsgUtil.sendMessage(p, "bypassing-lock");
return;
}
MsgUtil.sendMessage(p, "that-is-locked", p);
MsgUtil.sendMessage(p, "that-is-locked");
e.setCancelled(true);
}
@@ -206,9 +206,9 @@ public class PlayerListener extends QSListener {
itemAmount = 0;
}
if (shop.isStackingShop()) {
MsgUtil.sendMessage(p, "how-many-buy-stack", p, Integer.toString(shop.getItem().getAmount()), Integer.toString(itemAmount));
MsgUtil.sendMessage(p, "how-many-buy-stack", Integer.toString(shop.getItem().getAmount()), Integer.toString(itemAmount));
} else {
MsgUtil.sendMessage(p, "how-many-buy", p, Integer.toString(itemAmount));
MsgUtil.sendMessage(p, "how-many-buy", Integer.toString(itemAmount));
}
} else {
final double ownerBalance = eco.getBalance(shop.getOwner(), shop.getLocation().getWorld(), shop.getCurrency());
@@ -230,9 +230,9 @@ public class PlayerListener extends QSListener {
items = 0;
}
if (shop.isStackingShop()) {
MsgUtil.sendMessage(p, "how-many-sell-stack", p, Integer.toString(shop.getItem().getAmount()), Integer.toString(items));
MsgUtil.sendMessage(p, "how-many-sell-stack", Integer.toString(shop.getItem().getAmount()), Integer.toString(items));
} else {
MsgUtil.sendMessage(p, "how-many-sell", p, Integer.toString(items));
MsgUtil.sendMessage(p, "how-many-sell", Integer.toString(items));
}
}
// Add the new action
@@ -258,13 +258,13 @@ public class PlayerListener extends QSListener {
}
if (Util.isDoubleChest(b.getBlockData())
&& !QuickShop.getPermissionManager().hasPermission(p, "quickshop.create.double")) {
MsgUtil.sendMessage(p, "no-double-chests", p);
MsgUtil.sendMessage(p, "no-double-chests");
return;
}
if (Util.isBlacklisted(item)
&& !QuickShop.getPermissionManager()
.hasPermission(p, "quickshop.bypass." + item.getType().name())) {
MsgUtil.sendMessage(p, "blacklisted-item", p);
MsgUtil.sendMessage(p, "blacklisted-item");
return;
}
if (b.getType() == Material.ENDER_CHEST //FIXME: Need a better impl
@@ -293,10 +293,7 @@ public class PlayerListener extends QSListener {
final Info info = new Info(b.getLocation(), ShopAction.CREATE, e.getItem(), last);
plugin.getShopManager().getActions().put(p.getUniqueId(), info);
MsgUtil.sendMessage(p,
"how-much-to-trade-for",
p,
Util.getItemStackName(Objects.requireNonNull(e.getItem())), Integer.toString(plugin.isAllowStack() && QuickShop.getPermissionManager().hasPermission(p, "quickshop.create.stacks") ? item.getAmount() : 1));
MsgUtil.sendMessage(p, "how-much-to-trade-for", Util.getItemStackName(Objects.requireNonNull(e.getItem())), Integer.toString(plugin.isAllowStack() && QuickShop.getPermissionManager().hasPermission(p, "quickshop.create.stacks") ? item.getAmount() : 1));
}
}
@@ -364,10 +361,10 @@ public class PlayerListener extends QSListener {
final Location loc2 = p.getLocation();
if (loc1.getWorld() != loc2.getWorld() || loc1.distanceSquared(loc2) > 25) {
if (info.getAction() == ShopAction.BUY) {
MsgUtil.sendMessage(p, "shop-purchase-cancelled", p);
MsgUtil.sendMessage(p, "shop-purchase-cancelled");
Util.debugLog(p.getName() + " too far with the shop location.");
} else if (info.getAction() == ShopAction.CREATE) {
MsgUtil.sendMessage(p, "shop-creation-cancelled", p);
MsgUtil.sendMessage(p, "shop-creation-cancelled");
Util.debugLog(p.getName() + " too far with the shop location.");
}
plugin.getShopManager().getActions().remove(p.getUniqueId());
@@ -126,7 +126,7 @@ public class ShopManager {
}
int max = plugin.getShopLimit(p);
if (owned + 1 > max) {
MsgUtil.sendMessage(p, "reached-maximum-can-create", p, String.valueOf(owned), String.valueOf(max));
MsgUtil.sendMessage(p, "reached-maximum-can-create", String.valueOf(owned), String.valueOf(max));
return false;
}
}
@@ -249,7 +249,7 @@ public class ShopManager {
this.processWaterLoggedSign(shop.getLocation().getBlock(), info.getSignBlock());
} else {
if (!plugin.getConfig().getBoolean("shop.allow-shop-without-space-for-sign")) {
MsgUtil.sendMessage(player, "failed-to-put-sign", player);
MsgUtil.sendMessage(player, "failed-to-put-sign");
Util.debugLog("Sign cannot placed cause no enough space(Not air block)");
return;
}
@@ -278,7 +278,7 @@ public class ShopManager {
plugin.getDatabaseHelper().createShop(shop, null, e2 -> {
plugin.getLogger()
.log(Level.SEVERE, "Shop create failed, auto fix failed, the changes may won't commit to database.", e2);
MsgUtil.sendMessage(player, "shop-creation-failed", player);
MsgUtil.sendMessage(player, "shop-creation-failed");
Util.mainThreadRun(() -> {
shop.onUnload();
removeShop(shop);
@@ -465,7 +465,7 @@ public class ShopManager {
}
if (info.getLocation().getWorld() != p.getLocation().getWorld()
|| info.getLocation().distanceSquared(p.getLocation()) > 25) {
MsgUtil.sendMessage(p, "not-looking-at-shop", p);
MsgUtil.sendMessage(p, "not-looking-at-shop");
return;
}
if (info.getAction() == ShopAction.CREATE) {
@@ -669,7 +669,7 @@ public class ShopManager {
MsgUtil.sendMessage(buyer, "the-owner-cant-afford-to-buy-from-you",
Objects.requireNonNull(format(total, shop.getLocation().getWorld(), shop.getCurrency())),
Objects.requireNonNull(format(eco.getBalance(shop.getOwner(), shop.getLocation().getWorld(),
shop.getCurrency()), shop.getLocation().getWorld(), shop.getCurrency()))))
shop.getCurrency()), shop.getLocation().getWorld(), shop.getCurrency())));
} else {
MsgUtil.sendMessage(buyer, MsgUtil.getMessage(buyer, "purchase-failed"));
plugin.getLogger().severe("EconomyTransaction Failed, last error:" + transaction.getLastError());
@@ -772,7 +772,7 @@ public class ShopManager {
}
if (plugin.getShopManager().getShop(info.getLocation()) != null) {
MsgUtil.sendMessage(p, "shop-already-owned", );
MsgUtil.sendMessage(p, "shop-already-owned");
return;
}
if (Util.isDoubleChest(info.getLocation().getBlock().getBlockData())
@@ -1119,7 +1119,7 @@ public class ShopManager {
Result result = plugin.getIntegrationHelper()
.callIntegrationsCanTrade(p, info.getLocation());
if (!result.isSuccess()) {
MsgUtil.sendMessage(p, "integrations-check-failed-trade", result.getMessage()))
MsgUtil.sendMessage(p, "integrations-check-failed-trade", result.getMessage());
Util.debugLog("Cancel by integrations.");
return;
}