mirror of
https://codeberg.org/moonleay/Gimbal.git
synced 2024-11-25 22:22:10 +00:00
chore: replaced println() with proper logging util
Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
parent
7cf65cffd2
commit
13cbbfa72f
2 changed files with 11 additions and 2 deletions
|
@ -20,6 +20,7 @@ package net.moonleay.gimbal.client.editor
|
|||
|
||||
import net.minecraft.client.MinecraftClient
|
||||
import net.minecraft.text.Text
|
||||
import net.moonleay.gimbal.build.BuildConstants
|
||||
import net.moonleay.gimbal.client.util.ChatUtil
|
||||
import net.moonleay.gimbal.editor.ServerEditorManager
|
||||
import net.moonleay.gimbal.editor.state.EditorState
|
||||
|
@ -30,6 +31,7 @@ import net.moonleay.gimbal.editor.state.mode.Mode
|
|||
import net.moonleay.gimbal.editor.state.mode.ModeModifier
|
||||
import net.moonleay.gimbal.editor.util.EditorUtil
|
||||
import net.moonleay.gimbal.networking.GimbalClient
|
||||
import org.apache.logging.log4j.LogManager
|
||||
|
||||
object ClientEditor {
|
||||
private var POLICY = GimbalPolicyType.NOT_PRESENT
|
||||
|
@ -43,6 +45,9 @@ object ClientEditor {
|
|||
private val DISABLED_MODIFIERS_STORAGE = mutableListOf<ModeModifier>()
|
||||
|
||||
|
||||
private val LOGGER = LogManager.getLogger(BuildConstants.modName)
|
||||
|
||||
|
||||
fun onConnectedToNewWorld() {
|
||||
POLICY = GimbalPolicyType.NOT_PRESENT
|
||||
if (TEMP_DISABLED_MODE == Mode.UNKNOWN) {
|
||||
|
@ -73,7 +78,7 @@ object ClientEditor {
|
|||
if (!shouldUpdateServer) {
|
||||
val player = MinecraftClient.getInstance().player
|
||||
if (player == null) {
|
||||
println("Player is null!")
|
||||
LOGGER.warn("Player is null!") //FIXME: Fix player is null at world join!
|
||||
return
|
||||
}
|
||||
ServerEditorManager.updateEditorState(
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
package net.moonleay.gimbal.networking
|
||||
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.cbor.Cbor
|
||||
import kotlinx.serialization.decodeFromByteArray
|
||||
import kotlinx.serialization.encodeToByteArray
|
||||
|
@ -33,8 +34,10 @@ import net.moonleay.gimbal.editor.ServerEditorManager
|
|||
import net.moonleay.gimbal.editor.state.EditorState
|
||||
import net.moonleay.gimbal.editor.state.GimbalPolicyType
|
||||
import net.moonleay.gimbal.editor.state.GimbalServerState
|
||||
import org.apache.logging.log4j.LogManager
|
||||
|
||||
object GimbalServer {
|
||||
private val LOGGER = LogManager.getLogger(BuildConstants.modName)
|
||||
|
||||
fun registerPacketHandler() {
|
||||
ServerPlayNetworking
|
||||
|
@ -44,8 +47,9 @@ object GimbalServer {
|
|||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
fun notifyPlayerOfPolicy(player: ServerPlayerEntity) {
|
||||
println("Sending policy packet to player ${player.name.string}...")
|
||||
LOGGER.info("Sending policy to " + player.name.string)
|
||||
val buf = PacketByteBufs.create()
|
||||
buf.writeByteArray(
|
||||
Cbor.encodeToByteArray(
|
||||
|
|
Loading…
Reference in a new issue