Skip to content

Commit

Permalink
Fixed server
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Dec 15, 2019
1 parent d78d3da commit 047f479
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions server/src/io/anuke/mindustry/server/ServerControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ public ServerControl(String[] args){
}
});

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.");
Expand Down Expand Up @@ -310,9 +310,9 @@ private void registerCommands(){
});

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{
Expand All @@ -322,7 +322,7 @@ private void registerCommands(){
});

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);
Expand Down Expand Up @@ -828,8 +828,8 @@ private void registerCommands(){
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(){
Expand Down
2 changes: 1 addition & 1 deletion server/src/io/anuke/mindustry/server/ServerLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void init(){
Core.app.addListener(netServer = new NetServer());
Core.app.addListener(new ServerControl(args));

mods.each(Mod::init);
mods.eachClass(Mod::init);

Events.fire(new ServerLoadEvent());
}
Expand Down

0 comments on commit 047f479

Please sign in to comment.