fix: 修复部分BUG 修复load直接载入文件的NPE错误

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2016-07-28 18:39:24 +08:00
parent 8226293c3e
commit 14d9438268
6 changed files with 15 additions and 7 deletions

View File

@ -32,17 +32,17 @@
<minimizeJar>true</minimizeJar> <minimizeJar>true</minimizeJar>
<artifactSet> <artifactSet>
<includes> <includes>
<include>cn.citycraft:PluginHelper</include>
<include>pw.yumc:YumCore</include> <include>pw.yumc:YumCore</include>
<include>cn.citycraft:PluginHelper</include>
</includes> </includes>
</artifactSet> </artifactSet>
<relocations> <relocations>
<relocation> <relocation>
<pattern>cn.citycraft.PluginHelper</pattern> <pattern>pw.yumc.YumCore</pattern>
<shadedPattern>${project.groupId}.${project.artifactId}</shadedPattern> <shadedPattern>${project.groupId}.${project.artifactId}</shadedPattern>
</relocation> </relocation>
<relocation> <relocation>
<pattern>pw.yumc.YumCore</pattern> <pattern>cn.citycraft.PluginHelper</pattern>
<shadedPattern>${project.groupId}.${project.artifactId}</shadedPattern> <shadedPattern>${project.groupId}.${project.artifactId}</shadedPattern>
</relocation> </relocation>
</relocations> </relocations>
@ -66,6 +66,7 @@
<update.description>§a全新 2.X 版本 更多守护与优化</update.description> <update.description>§a全新 2.X 版本 更多守护与优化</update.description>
<update.changes> <update.changes>
§c注意 §6- §aYum更新需要§d重启服务器!§c重启服务器!§4重启服务器!; §c注意 §6- §aYum更新需要§d重启服务器!§c重启服务器!§4重启服务器!;
§b2.7.1 §6- §c修复部分BUG(load可直接载入文件)...;
§b2.7.0 §6- §d完善能耗监控流程...; §b2.7.0 §6- §d完善能耗监控流程...;
§b §6- §c报错§6/§d能耗§a添加日志记录; §b §6- §c报错§6/§d能耗§a添加日志记录;
§b §6- §a文件处理添加复制命令; §b §6- §a文件处理添加复制命令;

View File

@ -31,6 +31,7 @@ import pw.yumc.Yum.models.BukkitDev;
import pw.yumc.Yum.models.BukkitDev.Files; import pw.yumc.Yum.models.BukkitDev.Files;
import pw.yumc.Yum.models.BukkitDev.Projects; import pw.yumc.Yum.models.BukkitDev.Projects;
import pw.yumc.Yum.models.RepoSerialization.Repositories; import pw.yumc.Yum.models.RepoSerialization.Repositories;
import pw.yumc.YumCore.bukkit.Log;
import pw.yumc.YumCore.commands.CommandArgument; import pw.yumc.YumCore.commands.CommandArgument;
import pw.yumc.YumCore.commands.CommandExecutor; import pw.yumc.YumCore.commands.CommandExecutor;
import pw.yumc.YumCore.commands.CommandManager; import pw.yumc.YumCore.commands.CommandManager;
@ -434,6 +435,12 @@ public class YumCommand implements Listener, CommandExecutor {
} }
} }
@Cmd
public void test(final CommandArgument e) {
Log.toSender(e.getSender(), "Test");
Log.toSender(e.getSender(), new String[] { "Test1", "Test2", "Test3" });
}
@Cmd(minimumArguments = 1) @Cmd(minimumArguments = 1)
@Help(value = "卸载插件", possibleArguments = "<插件名称>") @Help(value = "卸载插件", possibleArguments = "<插件名称>")
@Sort(4) @Sort(4)

View File

@ -6,11 +6,11 @@ import org.bukkit.event.Listener;
import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.event.server.PluginEnableEvent;
import cn.citycraft.PluginHelper.bukkit.P;
import cn.citycraft.PluginHelper.kit.PluginKit; import cn.citycraft.PluginHelper.kit.PluginKit;
import pw.yumc.Yum.api.YumAPI; import pw.yumc.Yum.api.YumAPI;
import pw.yumc.Yum.managers.ConfigManager; import pw.yumc.Yum.managers.ConfigManager;
import pw.yumc.Yum.managers.MonitorManager; import pw.yumc.Yum.managers.MonitorManager;
import pw.yumc.YumCore.bukkit.P;
/** /**
* *

View File

@ -4,9 +4,9 @@ import java.util.List;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import cn.citycraft.PluginHelper.bukkit.P;
import cn.citycraft.PluginHelper.config.FileConfig; import cn.citycraft.PluginHelper.config.FileConfig;
import cn.citycraft.PluginHelper.sql.DataBase; import cn.citycraft.PluginHelper.sql.DataBase;
import pw.yumc.YumCore.bukkit.P;
public class ConfigManager { public class ConfigManager {
public final static String ENABLE = "Enable"; public final static String ENABLE = "Enable";

View File

@ -370,7 +370,7 @@ public class PluginsManager {
* @return 是否成功 * @return 是否成功
*/ */
public boolean load(CommandSender sender, final String name) { public boolean load(CommandSender sender, final String name) {
String filename = null; String filename = name;
if (sender == null) { if (sender == null) {
sender = Bukkit.getConsoleSender(); sender = Bukkit.getConsoleSender();
} }

View File

@ -6,11 +6,11 @@ import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import cn.citycraft.PluginHelper.PluginHelperLogger; import cn.citycraft.PluginHelper.PluginHelperLogger;
import cn.citycraft.PluginHelper.bukkit.Log;
import cn.citycraft.PluginHelper.utils.IOUtil; import cn.citycraft.PluginHelper.utils.IOUtil;
import pw.yumc.Yum.models.RepoSerialization.Plugin; import pw.yumc.Yum.models.RepoSerialization.Plugin;
import pw.yumc.Yum.models.RepoSerialization.TagInfo; import pw.yumc.Yum.models.RepoSerialization.TagInfo;
import pw.yumc.Yum.models.RepoSerialization.URLType; import pw.yumc.Yum.models.RepoSerialization.URLType;
import pw.yumc.YumCore.bukkit.Log;
public class PluginInfo implements Serializable { public class PluginInfo implements Serializable {
public static String NMSVersion; public static String NMSVersion;