1
0
mirror of https://e.coding.net/circlecloud/QuickShop.git synced 2024-11-22 01:58:54 +00:00

fix some bug...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2015-10-09 15:15:11 +08:00
parent 2f22d07915
commit 6ac9a8d762
5 changed files with 11 additions and 10 deletions

View File

@ -16,6 +16,7 @@ public class CommandReload extends BaseCommand {
super("reload"); super("reload");
this.plugin = plugin; this.plugin = plugin;
setPermission("quickshop.reload"); setPermission("quickshop.reload");
setDescription(MsgUtil.p("command.description.reload"));
} }
@Override @Override

View File

@ -9,6 +9,7 @@ import org.bukkit.entity.Player;
import org.bukkit.util.BlockIterator; import org.bukkit.util.BlockIterator;
import org.maxgamer.QuickShop.QuickShop; import org.maxgamer.QuickShop.QuickShop;
import org.maxgamer.QuickShop.Shop.Shop; import org.maxgamer.QuickShop.Shop.Shop;
import org.maxgamer.QuickShop.Util.MsgUtil;
import cn.citycraft.PluginHelper.commands.BaseCommand; import cn.citycraft.PluginHelper.commands.BaseCommand;
@ -18,8 +19,9 @@ public class CommandRemove extends BaseCommand {
public CommandRemove(final QuickShop plugin) { public CommandRemove(final QuickShop plugin) {
super("remove", "delete"); super("remove", "delete");
this.plugin = plugin; this.plugin = plugin;
setPermission("quickshop.delete");
setOnlyPlayerExecutable(); setOnlyPlayerExecutable();
setPermission("quickshop.delete");
setDescription(MsgUtil.p("command.description.remove"));
} }
@Override @Override
@ -32,13 +34,13 @@ public class CommandRemove extends BaseCommand {
if (shop != null) { if (shop != null) {
if (shop.getOwner().equals(p.getName())) { if (shop.getOwner().equals(p.getName())) {
shop.delete(); shop.delete();
sender.sendMessage(ChatColor.GREEN + "Success. Deleted shop."); sender.sendMessage(ChatColor.GREEN + "商店已成功移除");
} else { } else {
p.sendMessage(ChatColor.RED + "That's not your shop!"); p.sendMessage(ChatColor.RED + "这个不是你的商店!");
} }
return; return;
} }
} }
p.sendMessage(ChatColor.RED + "No shop found!"); p.sendMessage(ChatColor.RED + "未找到商店!");
} }
} }

View File

@ -69,7 +69,7 @@ public class PlayerListener implements Listener {
p.sendMessage(MsgUtil.p("how-many-buy")); p.sendMessage(MsgUtil.p("how-many-buy"));
} else { } else {
final int items = Util.countItems(p.getInventory(), shop.getItem()); 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 // Add the new action
final HashMap<String, Info> actions = plugin.getShopManager().getActions(); final HashMap<String, Info> actions = plugin.getShopManager().getActions();

View File

@ -141,10 +141,7 @@ public class Util {
final Sign sign = (Sign) b.getState().getData(); // Throws a NPE final Sign sign = (Sign) b.getState().getData(); // Throws a NPE
// sometimes?? // sometimes??
final BlockFace attached = sign.getAttachedFace(); final BlockFace attached = sign.getAttachedFace();
if (attached == null) { return attached == null ? null : b.getRelative(attached);
return null;
}
return b.getRelative(attached);
} catch (final NullPointerException e) { } catch (final NullPointerException e) {
return null; // /Not sure what causes this. return null; // /Not sure what causes this.
} }

View File

@ -89,11 +89,12 @@ command:
clean: '&e清除所有0库存的商店' clean: '&e清除所有0库存的商店'
price: '&e更改商店 &b出售/收购 &e的价格' price: '&e更改商店 &b出售/收购 &e的价格'
find: '&e查找附近的商店.' find: '&e查找附近的商店.'
reload: '&e从config.yml文件中重载快捷商店配置' reload: '&e重载快捷商店配置'
refill: '&e给一个商店加入指定数量的物品' refill: '&e给一个商店加入指定数量的物品'
empty: '&e清空一个商店的所有货物.' empty: '&e清空一个商店的所有货物.'
export: '&e导出 数据库 到 SQLite 或者 MySQL' export: '&e导出 数据库 到 SQLite 或者 MySQL'
info: '&e查看当前服务器商店信息.' info: '&e查看当前服务器商店信息.'
remove: '&e移除眼前的商店.'
signs: signs:
selling: '出售数量: {0}' selling: '出售数量: {0}'