Skip to content

Commit

Permalink
Fix debug logging when adding deck to player inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
4Ply committed Jan 20, 2024
1 parent c7819f2 commit 4b89712
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
9 changes: 0 additions & 9 deletions src/main/kotlin/org/trackedout/AgroNet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@ import com.mojang.brigadier.arguments.IntegerArgumentType
import com.mojang.brigadier.arguments.StringArgumentType
import net.fabricmc.api.ModInitializer
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback
import net.fabricmc.fabric.api.event.player.AttackBlockCallback
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.server.command.CommandManager.argument
import net.minecraft.server.command.CommandManager.literal
import net.minecraft.server.command.CommandOutput
import net.minecraft.server.command.ServerCommandSource
import net.minecraft.server.world.ServerWorld
import net.minecraft.sound.SoundEvents
import net.minecraft.util.ActionResult
import net.minecraft.util.Formatting
import net.minecraft.util.math.Vec2f
import okhttp3.OkHttpClient
import org.slf4j.LoggerFactory
import org.trackedout.actions.AddDeckToPlayerInventoryAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ import org.trackedout.data.Cards
import org.trackedout.debug
import org.trackedout.sendMessage

class AddDeckToPlayerInventoryAction (
class AddDeckToPlayerInventoryAction(
private val inventoryApi: InventoryApi
) {
private val logger = LoggerFactory.getLogger("Agro-net")

fun execute(source: ServerCommandSource, player: ServerPlayerEntity) {
logger.debug("Fetch player deck command")

player.debug("Player tags: {}".format(player.commandTags))
player.debug("Player tags: ${player.commandTags}")
logger.debug("Player tags: {}", player.commandTags)
if (player.commandTags.contains(RECEIVED_SHULKER)) {
source.sendMessage("Player ${player.name.string} already has their shulker box, refusing to give them another one", Formatting.RED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class AgroNetServerPlayConnectionListener(private val addDeckToPlayerInventoryAc
private val logger = LoggerFactory.getLogger("ServerPlayConnectionJoin")

override fun onPlayReady(handler: ServerPlayNetworkHandler?, sender: PacketSender?, server: MinecraftServer?) {
logger.debug("onPlayReady", handler, sender, server);
handler?.player?.let {player ->
server?.commandSource?.let {commandSource ->
logger.debug("onPlayReady", handler, sender, server)
handler?.player?.let { player ->
server?.commandSource?.let { commandSource ->
addDeckToPlayerInventoryAction.execute(commandSource, player)
}
}
Expand Down

0 comments on commit 4b89712

Please sign in to comment.