From e082e4221538b3f7df9a8c1c6587f2479209455d Mon Sep 17 00:00:00 2001 From: Zak Shearman <34372536+ZakShearman@users.noreply.github.com> Date: Sat, 6 Apr 2024 01:32:53 +0100 Subject: [PATCH] chore: add info logs for middle spawning bug --- .../java/dev/emortal/minestom/blocksumo/game/BlockSumoGame.java | 1 + .../minestom/blocksumo/spawning/InitialSpawnPointSelector.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/java/dev/emortal/minestom/blocksumo/game/BlockSumoGame.java b/src/main/java/dev/emortal/minestom/blocksumo/game/BlockSumoGame.java index 6ca7473..1f4c7ef 100644 --- a/src/main/java/dev/emortal/minestom/blocksumo/game/BlockSumoGame.java +++ b/src/main/java/dev/emortal/minestom/blocksumo/game/BlockSumoGame.java @@ -91,6 +91,7 @@ public BlockSumoGame(@NotNull GameCreationInfo creationInfo, @NotNull LoadedMap this.powerUpManager = new PowerUpManager(this); this.powerUpManager.registerDefaultPowerUps(); + System.out.printf("Current players (%s): %s%n", creationInfo.playerIds().size(), creationInfo.playerIds()); // Bug: players spawning in middle of map this.initialSpawnPointSelector = new InitialSpawnPointSelector(creationInfo.playerIds().size(), this.map.data().spawnRadius()); this.explosionManager = new ExplosionManager(this); diff --git a/src/main/java/dev/emortal/minestom/blocksumo/spawning/InitialSpawnPointSelector.java b/src/main/java/dev/emortal/minestom/blocksumo/spawning/InitialSpawnPointSelector.java index 932632c..c4eda97 100644 --- a/src/main/java/dev/emortal/minestom/blocksumo/spawning/InitialSpawnPointSelector.java +++ b/src/main/java/dev/emortal/minestom/blocksumo/spawning/InitialSpawnPointSelector.java @@ -20,6 +20,8 @@ public InitialSpawnPointSelector(int playerCount, int spawnRadius) { } private @NotNull Queue generateSpawns(int playerCount, int spawnRadius) { + LOGGER.info("Generating spawn points for {} players", playerCount); // Bug: players spawning in middle of map + double playerOffset = TWO_PI / Math.max(playerCount, 1); // Fixes 0 player count on local testing Queue spawns = new ArrayDeque<>();