chore: replaced println() with proper logging util

Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
moonleay 2024-05-04 02:48:56 +02:00
parent 7cf65cffd2
commit 13cbbfa72f
Signed by: moonleay
GPG key ID: 82667543CCD715FB
2 changed files with 11 additions and 2 deletions

View file

@ -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(