diff --git a/src/main/java/org/maxgamer/QuickShop/Command/CommandReload.java b/src/main/java/org/maxgamer/QuickShop/Command/CommandReload.java index 219d22d..630cb20 100644 --- a/src/main/java/org/maxgamer/QuickShop/Command/CommandReload.java +++ b/src/main/java/org/maxgamer/QuickShop/Command/CommandReload.java @@ -16,6 +16,7 @@ public class CommandReload extends BaseCommand { super("reload"); this.plugin = plugin; setPermission("quickshop.reload"); + setDescription(MsgUtil.p("command.description.reload")); } @Override diff --git a/src/main/java/org/maxgamer/QuickShop/Command/CommandRemove.java b/src/main/java/org/maxgamer/QuickShop/Command/CommandRemove.java index a330cc1..e4f2b07 100644 --- a/src/main/java/org/maxgamer/QuickShop/Command/CommandRemove.java +++ b/src/main/java/org/maxgamer/QuickShop/Command/CommandRemove.java @@ -9,6 +9,7 @@ import org.bukkit.entity.Player; import org.bukkit.util.BlockIterator; import org.maxgamer.QuickShop.QuickShop; import org.maxgamer.QuickShop.Shop.Shop; +import org.maxgamer.QuickShop.Util.MsgUtil; import cn.citycraft.PluginHelper.commands.BaseCommand; @@ -18,8 +19,9 @@ public class CommandRemove extends BaseCommand { public CommandRemove(final QuickShop plugin) { super("remove", "delete"); this.plugin = plugin; - setPermission("quickshop.delete"); setOnlyPlayerExecutable(); + setPermission("quickshop.delete"); + setDescription(MsgUtil.p("command.description.remove")); } @Override @@ -32,13 +34,13 @@ public class CommandRemove extends BaseCommand { if (shop != null) { if (shop.getOwner().equals(p.getName())) { shop.delete(); - sender.sendMessage(ChatColor.GREEN + "Success. Deleted shop."); + sender.sendMessage(ChatColor.GREEN + "商店已成功移除"); } else { - p.sendMessage(ChatColor.RED + "That's not your shop!"); + p.sendMessage(ChatColor.RED + "这个不是你的商店!"); } return; } } - p.sendMessage(ChatColor.RED + "No shop found!"); + p.sendMessage(ChatColor.RED + "未找到商店!"); } } diff --git a/src/main/java/org/maxgamer/QuickShop/Listeners/PlayerListener.java b/src/main/java/org/maxgamer/QuickShop/Listeners/PlayerListener.java index 8b6c91c..14ecb78 100644 --- a/src/main/java/org/maxgamer/QuickShop/Listeners/PlayerListener.java +++ b/src/main/java/org/maxgamer/QuickShop/Listeners/PlayerListener.java @@ -69,7 +69,7 @@ public class PlayerListener implements Listener { p.sendMessage(MsgUtil.p("how-many-buy")); } else { final int items = Util.countItems(p.getInventory(), shop.getItem()); - p.sendMessage(MsgUtil.p("how-many-sell", "" + items)); + p.sendMessage(MsgUtil.p("how-many-sell", items)); } // Add the new action final HashMap actions = plugin.getShopManager().getActions(); diff --git a/src/main/java/org/maxgamer/QuickShop/Util/Util.java b/src/main/java/org/maxgamer/QuickShop/Util/Util.java index 466af48..41dfebc 100644 --- a/src/main/java/org/maxgamer/QuickShop/Util/Util.java +++ b/src/main/java/org/maxgamer/QuickShop/Util/Util.java @@ -141,10 +141,7 @@ public class Util { final Sign sign = (Sign) b.getState().getData(); // Throws a NPE // sometimes?? final BlockFace attached = sign.getAttachedFace(); - if (attached == null) { - return null; - } - return b.getRelative(attached); + return attached == null ? null : b.getRelative(attached); } catch (final NullPointerException e) { return null; // /Not sure what causes this. } diff --git a/src/main/resources/messages.yml b/src/main/resources/messages.yml index 7a38368..8856c63 100644 --- a/src/main/resources/messages.yml +++ b/src/main/resources/messages.yml @@ -89,11 +89,12 @@ command: clean: '&e清除所有0库存的商店' price: '&e更改商店 &b出售/收购 &e的价格' find: '&e查找附近的商店.' - reload: '&e从config.yml文件中重载快捷商店配置' + reload: '&e重载快捷商店配置' refill: '&e给一个商店加入指定数量的物品' empty: '&e清空一个商店的所有货物.' export: '&e导出 数据库 到 SQLite 或者 MySQL' info: '&e查看当前服务器商店信息.' + remove: '&e移除眼前的商店.' signs: selling: '出售数量: {0}'