Fixed server

This commit is contained in:
Anuken
2019-12-15 14:00:07 -05:00
parent d78d3daaf9
commit 047f479a2f
2 changed files with 8 additions and 8 deletions

View File

@ -157,8 +157,8 @@ public class ServerControl implements ApplicationListener{
}
});
if(!mods.all().isEmpty()){
info("&lc{0} mods loaded.", mods.all().size);
if(!mods.list().isEmpty()){
info("&lc{0} mods loaded.", mods.list().size);
}
info("&lcServer loaded. Type &ly'help'&lc for help.");
@ -310,9 +310,9 @@ public class ServerControl implements ApplicationListener{
});
handler.register("mods", "Display all loaded mods.", arg -> {
if(!mods.all().isEmpty()){
if(!mods.list().isEmpty()){
info("Mods:");
for(LoadedMod mod : mods.all()){
for(LoadedMod mod : mods.list()){
info(" &ly{0} &lcv{1}", mod.meta.displayName(), mod.meta.version);
}
}else{
@ -322,7 +322,7 @@ public class ServerControl implements ApplicationListener{
});
handler.register("mod", "<name...>", "Display information about a loaded plugin.", arg -> {
LoadedMod mod = mods.all().find(p -> p.meta.name.equalsIgnoreCase(arg[0]));
LoadedMod mod = mods.list().find(p -> p.meta.name.equalsIgnoreCase(arg[0]));
if(mod != null){
info("Name: &ly{0}", mod.meta.displayName());
info("Internal Name: &ly{0}", mod.name);
@ -828,8 +828,8 @@ public class ServerControl implements ApplicationListener{
info("&ly{0}&lg MB collected. Memory usage now at &ly{1}&lg MB.", pre - post, post);
});
mods.each(p -> p.registerServerCommands(handler));
mods.each(p -> p.registerClientCommands(netServer.clientCommands));
mods.eachClass(p -> p.registerServerCommands(handler));
mods.eachClass(p -> p.registerClientCommands(netServer.clientCommands));
}
private void applyRules(){

View File

@ -63,7 +63,7 @@ public class ServerLauncher implements ApplicationListener{
Core.app.addListener(netServer = new NetServer());
Core.app.addListener(new ServerControl(args));
mods.each(Mod::init);
mods.eachClass(Mod::init);
Events.fire(new ServerLoadEvent());
}