diff --git a/src/main/java/de/bixilon/minosoft/config/profile/ProfileManager.kt b/src/main/java/de/bixilon/minosoft/config/profile/ProfileManager.kt index 0f6a58e38..2ea777184 100644 --- a/src/main/java/de/bixilon/minosoft/config/profile/ProfileManager.kt +++ b/src/main/java/de/bixilon/minosoft/config/profile/ProfileManager.kt @@ -274,7 +274,7 @@ interface ProfileManager { } finally { profile.reloading = false } - Log.log(LogMessageType.PROFILES, LogLevels.INFO) { "Reloaded profile: $profileName ($namespace);" } + Log.log(LogMessageType.PROFILES, LogLevels.INFO) { "Reloaded profile: $profileName ($namespace)" } }) } diff --git a/src/main/java/de/bixilon/minosoft/terminal/commands/AboutCommand.kt b/src/main/java/de/bixilon/minosoft/terminal/commands/AboutCommand.kt new file mode 100644 index 000000000..140138d03 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/terminal/commands/AboutCommand.kt @@ -0,0 +1,39 @@ +/* + * Minosoft + * Copyright (C) 2020-2022 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program. If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.terminal.commands + +import de.bixilon.minosoft.commands.nodes.LiteralNode +import de.bixilon.minosoft.commands.stack.print.PrintTarget +import de.bixilon.minosoft.properties.MinosoftProperties + +object AboutCommand : Command { + override var node: LiteralNode = LiteralNode("about", setOf("version"), executor = { it.print.printAbout() }) + + private fun PrintTarget.printAbout() { + print("-------------- Minosoft --------------") + print("This is minosoft version §e${MinosoftProperties.general.name}") + val git = MinosoftProperties.git + if (git == null) { + print("Sadly git version information is not available.") + } else { + print("This version was built from §e${git.branch}§r on top of §e${git.commit}") + } + + print("This software was mainly created by §eMoritz Zwerger§r (https://bixilon.de)") + print("and is licensed under the §eGPL3§r license.") + + print("The source code is available under https://gitlab.bixilon.de/bixilon/minosoft.") + print("Feel free to §econtribute§r, §efork§r and §esubmit§r a pull request!") + } +} diff --git a/src/main/java/de/bixilon/minosoft/terminal/commands/Commands.kt b/src/main/java/de/bixilon/minosoft/terminal/commands/Commands.kt index afebb9ae0..3081f55d0 100644 --- a/src/main/java/de/bixilon/minosoft/terminal/commands/Commands.kt +++ b/src/main/java/de/bixilon/minosoft/terminal/commands/Commands.kt @@ -27,5 +27,7 @@ object Commands { PingCommand, ConnectCommand, CrashCommand, DumpCommand, + + AboutCommand, ) } diff --git a/src/main/java/de/bixilon/minosoft/terminal/commands/rendering/ReloadCommand.kt b/src/main/java/de/bixilon/minosoft/terminal/commands/rendering/ReloadCommand.kt index 223f60d81..29eb344e5 100644 --- a/src/main/java/de/bixilon/minosoft/terminal/commands/rendering/ReloadCommand.kt +++ b/src/main/java/de/bixilon/minosoft/terminal/commands/rendering/ReloadCommand.kt @@ -18,7 +18,7 @@ import de.bixilon.minosoft.commands.nodes.LiteralNode object ReloadCommand : RenderingCommand { override var node = LiteralNode("reload", setOf("rl")) .addChild(LiteralNode("shaders", executor = { - it.connection.rendering!!.context.system.reloadShaders() + it.connection.rendering?.context?.system?.reloadShaders() ?: throw IllegalStateException("Rendering is not loaded!") it.connection.util.sendDebugMessage("Shaders reloaded!") })) }