feat: /mods command lists all mods

badly tho: it doesn't fit on screen and must be read from minecraft logs
This commit is contained in:
əlemi 2023-11-13 05:02:17 +01:00
parent b2caa0f762
commit aebd63ac13
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -9,7 +9,7 @@ import ftbsc.bscv.api.IModule;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.command.Commands; import net.minecraft.command.Commands;
import static ftbsc.bscv.Boscovicino.log; import java.util.stream.Collectors;
@AutoService(ILoadable.class) @AutoService(ILoadable.class)
public class ModCommands extends AbstractCommand { public class ModCommands extends AbstractCommand {
@ -43,8 +43,11 @@ public class ModCommands extends AbstractCommand {
}) })
) )
.executes(ctx -> { .executes(ctx -> {
log("no args specified"); String mods = Boscovicino.modManager.mods.stream()
return 0; .map(x -> x.getName())
.collect(Collectors.joining(","));
Boscovicino.log("[ %s ]", mods);
return 1;
}); });
} }