feat: Add party commands

This commit is contained in:
Linnea Gräf
2024-12-22 21:17:11 +01:00
parent 13994393ed
commit ebcb06df40
4 changed files with 154 additions and 1 deletions

View File

@@ -64,6 +64,8 @@ object MC {
}
fun sendCommand(command: String) {
// TODO: add a queue to this and sendServerChat
ErrorUtil.softCheck("Server commands have an implied /", !command.startsWith("/"))
player?.networkHandler?.sendCommand(command)
}
@@ -96,8 +98,9 @@ object MC {
inline val camera: Entity? get() = instance.cameraEntity
inline val guiAtlasManager get() = instance.guiAtlasManager
inline val world: ClientWorld? get() = TestUtil.unlessTesting { instance.world }
inline val playerName: String? get() = player?.name?.unformattedString
inline var screen: Screen?
get() = TestUtil.unlessTesting{ instance.currentScreen }
get() = TestUtil.unlessTesting { instance.currentScreen }
set(value) = instance.setScreen(value)
val screenName get() = screen?.title?.unformattedString?.trim()
inline val handledScreen: HandledScreen<*>? get() = instance.currentScreen as? HandledScreen<*>