fix config desez error...

Signed-off-by: j502647092 <jtb1@163.com>
master
j502647092 2015-10-24 00:05:50 +08:00
parent 2ffd1ac895
commit ed0a16fe85
5 changed files with 9 additions and 6 deletions

View File

@ -16,8 +16,8 @@ public class CommandBan extends BaseCommand {
public CommandBan(final ProtectItem main) {
super("ban");
this.plugin = main;
setOnlyPlayerExecutable();
setPermission("pi.ban");
setOnlyPlayerExecutable();
setDescription("§c封禁手持物品");
setPossibleArguments("<封禁类型>");
}

View File

@ -16,8 +16,8 @@ public class CommandUnban extends BaseCommand {
public CommandUnban(final ProtectItem main) {
super("unban");
this.plugin = main;
setOnlyPlayerExecutable();
setPermission("pi.unban");
setOnlyPlayerExecutable();
setDescription("§a解禁手持物品");
setPossibleArguments("<解禁类型>");
}

View File

@ -19,8 +19,12 @@ public class ItemManager {
public ItemManager(final ProtectItem main) {
plugin = main;
itemconfig = new FileConfig(plugin, "banitems.yml");
itemlist = (HashMap<String, List<ActionType>>) itemconfig.get("banitems");
if (itemlist == null) {
try {
itemlist = (HashMap<String, List<ActionType>>) itemconfig.get("banitems");
if (itemlist == null) {
itemlist = new HashMap<String, List<ActionType>>();
}
} catch (final Exception e) {
itemlist = new HashMap<String, List<ActionType>>();
}
}

View File

@ -1 +0,0 @@
banitems: []

View File

@ -7,7 +7,7 @@ website: ${jenkins.url}/job/${project.artifactId}/
commands:
pi:
description: 物品保护插件
usage: 使用/pi 查看物品名称!
usage: 使用/pi help查看帮助!
permissions:
pi.bypass:
default: op