更新
This commit is contained in:
@@ -17,7 +17,7 @@ public class TLMCommands implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] args) {
|
||||
if (args.length == 0 || args[0].equalsIgnoreCase("help")) {
|
||||
if (args.length == 0 || "help".equalsIgnoreCase(args[0])) {
|
||||
if (sender.hasPermission("taboolib.admin")) {
|
||||
TLM.getInst().getLanguage().get("COMMAND-HELP").send(sender);
|
||||
} else {
|
||||
@@ -26,7 +26,7 @@ public class TLMCommands implements CommandExecutor {
|
||||
}
|
||||
|
||||
// 重载
|
||||
else if (args[0].equalsIgnoreCase("reload")) {
|
||||
else if ("reload".equalsIgnoreCase(args[0])) {
|
||||
if (sender.hasPermission("taboolib.admin")) {
|
||||
new TLMReloadCommand(sender, args);
|
||||
} else {
|
||||
@@ -35,7 +35,7 @@ public class TLMCommands implements CommandExecutor {
|
||||
}
|
||||
|
||||
// 列出
|
||||
else if (args[0].equalsIgnoreCase("list")) {
|
||||
else if ("list".equalsIgnoreCase(args[0])) {
|
||||
if (sender.hasPermission("taboolib.admin")) {
|
||||
new TLMListCommand(sender, args);
|
||||
} else {
|
||||
@@ -44,7 +44,7 @@ public class TLMCommands implements CommandExecutor {
|
||||
}
|
||||
|
||||
// InventorySave 模块
|
||||
else if (args[0].equalsIgnoreCase("inv")) {
|
||||
else if ("inv".equalsIgnoreCase(args[0])) {
|
||||
if (sender.hasPermission("taboolib.admin")) {
|
||||
new TLMInvCommand(sender, args);
|
||||
} else {
|
||||
@@ -53,7 +53,7 @@ public class TLMCommands implements CommandExecutor {
|
||||
}
|
||||
|
||||
// Kit 模块
|
||||
else if (args[0].equalsIgnoreCase("kit")) {
|
||||
else if ("kit".equalsIgnoreCase(args[0])) {
|
||||
new TLMKitCommand(sender, args);
|
||||
} else {
|
||||
TLM.getInst().getLanguage().get("COMMAND-ERROR").send(sender);
|
||||
|
||||
@@ -43,12 +43,12 @@ public class TLMInvCommand extends SubCommand {
|
||||
}
|
||||
|
||||
// 列出背包
|
||||
else if (args[1].equalsIgnoreCase("list")) {
|
||||
else if ("list".equalsIgnoreCase(args[1])) {
|
||||
TLM.getInst().getLanguage().get("INV-LIST").addPlaceholder("$name", moduleInventorySave.getInventorys().toString()).send(sender);
|
||||
}
|
||||
|
||||
// 查看背包
|
||||
else if (args[1].equalsIgnoreCase("info")) {
|
||||
else if ("info".equalsIgnoreCase(args[1])) {
|
||||
// 如果是后台
|
||||
if (!(sender instanceof Player)) {
|
||||
TLM.getInst().getLanguage().get("INV-CONSOLE").send(sender);
|
||||
@@ -108,7 +108,7 @@ public class TLMInvCommand extends SubCommand {
|
||||
}
|
||||
|
||||
// 保存背包
|
||||
else if (args[1].equalsIgnoreCase("save")) {
|
||||
else if ("save".equalsIgnoreCase(args[1])) {
|
||||
// 如果是后台
|
||||
if (!(sender instanceof Player)) {
|
||||
TLM.getInst().getLanguage().get("INV-CONSOLE").send(sender);
|
||||
@@ -132,7 +132,7 @@ public class TLMInvCommand extends SubCommand {
|
||||
}
|
||||
|
||||
// 覆盖背包
|
||||
else if (args[1].equalsIgnoreCase("paste")) {
|
||||
else if ("paste".equalsIgnoreCase(args[1])) {
|
||||
// 判断长度
|
||||
if (args.length < 3) {
|
||||
TLM.getInst().getLanguage().get("INV-NAME").send(sender);
|
||||
@@ -175,7 +175,7 @@ public class TLMInvCommand extends SubCommand {
|
||||
}
|
||||
|
||||
// 删除背包
|
||||
else if (args[1].equalsIgnoreCase("delete")) {
|
||||
else if ("delete".equalsIgnoreCase(args[1])) {
|
||||
// 判断长度
|
||||
if (args.length < 3) {
|
||||
TLM.getInst().getLanguage().get("INV-NAME").send(sender);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class TLMKitCommand extends SubCommand {
|
||||
TLM.getInst().getLanguage().get("KIT-EMPTY").send(sender);
|
||||
}
|
||||
|
||||
else if (args[1].equalsIgnoreCase("list")) {
|
||||
else if ("list".equalsIgnoreCase(args[1])) {
|
||||
// 判断权限
|
||||
if (!sender.hasPermission("taboolib.kit.list")) {
|
||||
TLM.getInst().getLanguage().get("NOPERMISSION-KIT-LIST").send(sender);
|
||||
@@ -50,7 +50,7 @@ public class TLMKitCommand extends SubCommand {
|
||||
}
|
||||
}
|
||||
|
||||
else if (args[1].equalsIgnoreCase("reward")) {
|
||||
else if ("reward".equalsIgnoreCase(args[1])) {
|
||||
// 判断权限
|
||||
if (!sender.hasPermission("taboolib.kit.reward")) {
|
||||
TLM.getInst().getLanguage().get("NOPERMISSION-KIT-REWARD").send(sender);
|
||||
@@ -130,7 +130,7 @@ public class TLMKitCommand extends SubCommand {
|
||||
// 提示信息
|
||||
TLM.getInst().getLanguage().get("KIT-SUCCESS").addPlaceholder("$kit", args[2]).send(sender);
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("reset")) {
|
||||
else if ("reset".equalsIgnoreCase(args[1])) {
|
||||
// 判断权限
|
||||
if (!sender.hasPermission("taboolib.kit.reset")) {
|
||||
TLM.getInst().getLanguage().get("NOPERMISSION-KIT-RESET").send(sender);
|
||||
|
||||
@@ -24,12 +24,12 @@ public class TLMReloadCommand extends SubCommand {
|
||||
MsgUtils.send(sender, "&4参数错误。");
|
||||
}
|
||||
|
||||
else if (args[1].equalsIgnoreCase("tlm")) {
|
||||
else if ("tlm".equalsIgnoreCase(args[1])) {
|
||||
TLM.getInst().reloadConfig();
|
||||
MsgUtils.send(sender, "&fTLM &7配置文件已重载。");
|
||||
}
|
||||
|
||||
else if (args[1].equalsIgnoreCase("all")) {
|
||||
else if ("all".equalsIgnoreCase(args[1])) {
|
||||
TabooLibraryModule.getInst().reloadConfig();
|
||||
MsgUtils.send(sender, "所有模块配置文件已重载。");
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ModuleCommandChanger implements ITabooLibraryModule, Listener {
|
||||
// 判断命令
|
||||
if (e.getMessage().startsWith(key)) {
|
||||
// 判断执行方式
|
||||
if (!getConfig().contains("Commands." + id + ".ReplaceMode") || getConfig().getString("Commands." + id + ".ReplaceMode").equals("PLAYER")) {
|
||||
if (!getConfig().contains("Commands." + id + ".ReplaceMode") || "PLAYER".equals(getConfig().getString("Commands." + id + ".ReplaceMode"))) {
|
||||
// 替换命令
|
||||
e.setMessage(e.getMessage().replace(key, getConfig().getString("Commands." + id + ".Replace")));
|
||||
return;
|
||||
@@ -45,7 +45,7 @@ public class ModuleCommandChanger implements ITabooLibraryModule, Listener {
|
||||
// 判断命令
|
||||
if (e.getCommand().startsWith(key)) {
|
||||
// 判断执行方式
|
||||
if (!getConfig().contains("Commands." + id + ".ReplaceMode") || getConfig().getString("Commands." + id + ".ReplaceMode").equals("CONSOLE")) {
|
||||
if (!getConfig().contains("Commands." + id + ".ReplaceMode") || "CONSOLE".equals(getConfig().getString("Commands." + id + ".ReplaceMode"))) {
|
||||
// 替换命令
|
||||
e.setCommand(e.getCommand().replace(key, getConfig().getString("Commands." + id + ".Replace")));
|
||||
return;
|
||||
|
||||
@@ -3,7 +3,6 @@ package me.skymc.tlm.module.sub;
|
||||
import me.skymc.taboolib.Main;
|
||||
import me.skymc.taboolib.TabooLib;
|
||||
import me.skymc.taboolib.inventory.ItemUtils;
|
||||
import me.skymc.taboolib.message.MsgUtils;
|
||||
import me.skymc.taboolib.playerdata.DataUtils;
|
||||
import me.skymc.tlm.TLM;
|
||||
import me.skymc.tlm.annotation.DisableConfig;
|
||||
@@ -96,11 +95,11 @@ public class ModuleInventorySave implements ITabooLibraryModule, Listener {
|
||||
// 如果原本有物品
|
||||
if (!ItemUtils.isNull(player.getInventory().getItem(i))) {
|
||||
// 跳过
|
||||
if (module.equalsIgnoreCase("-b")) {
|
||||
if ("-b".equalsIgnoreCase(module)) {
|
||||
continue;
|
||||
}
|
||||
// 给予
|
||||
else if (module.equalsIgnoreCase("-a")) {
|
||||
else if ("-a".equalsIgnoreCase(module)) {
|
||||
otherItem.add(item);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user