Skip to content

Commit

Permalink
(feat): update to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakShearman committed Mar 2, 2024
1 parent e1a70a8 commit c482da6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version = "1.0-SNAPSHOT"

repositories {
mavenCentral()
mavenLocal()

maven("https://repo.emortal.dev/snapshots")
maven("https://repo.emortal.dev/releases")
Expand All @@ -17,7 +18,7 @@ repositories {
}

dependencies {
api("dev.emortal.minestom:core:055a5d8")
api("dev.emortal.minestom:core:5bf4b63")
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import dev.emortal.api.modules.Module;
import dev.emortal.api.modules.ModuleProvider;
import dev.emortal.minestom.core.Environment;
import dev.emortal.minestom.core.LoggingInitializer;
import dev.emortal.minestom.core.MinestomServer;
import dev.emortal.minestom.core.module.kubernetes.KubernetesModule;
import dev.emortal.minestom.core.module.messaging.MessagingModule;
Expand All @@ -27,7 +26,6 @@ final class MinestomGameServerImpl implements MinestomGameServer {
static final boolean TEST_MODE = !Environment.isProduction() && Boolean.parseBoolean(System.getenv("GAME_SDK_TEST_MODE"));

static {
LoggingInitializer.initialize();
LOGGER = LoggerFactory.getLogger(MinestomGameServerImpl.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void movePlayersOnThisServer(@NotNull Game newGame, @NotNull Set<UUID> p
int i = 0;

for (UUID playerId : playerIds) {
Player player = connectionManager.getPlayer(playerId);
Player player = connectionManager.getOnlinePlayerByUuid(playerId);
if (player == null) continue;

Game oldGame = this.gameManager.findGame(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minestom.server.event.Event;
import net.minestom.server.event.EventFilter;
import net.minestom.server.event.EventNode;
import net.minestom.server.event.player.PlayerLoginEvent;
import net.minestom.server.event.player.PlayerSpawnEvent;
import net.minestom.server.timer.Task;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import net.minestom.server.entity.Player;
import net.minestom.server.event.Event;
import net.minestom.server.event.EventNode;
import net.minestom.server.event.player.AsyncPlayerConfigurationEvent;
import net.minestom.server.event.player.PlayerDisconnectEvent;
import net.minestom.server.event.player.PlayerLoginEvent;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -19,11 +19,11 @@ final class ProductionGameHandler {
this.gameManager = gameManager;

EventNode<Event> eventNode = GameEventNodes.GAME_MANAGER;
eventNode.addListener(PlayerLoginEvent.class, this::onJoin);
eventNode.addListener(AsyncPlayerConfigurationEvent.class, this::onJoin);
eventNode.addListener(PlayerDisconnectEvent.class, this::onLeave);
}

private void onJoin(@NotNull PlayerLoginEvent event) {
private void onJoin(@NotNull AsyncPlayerConfigurationEvent event) {
Player player = event.getPlayer();

Game game = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import net.minestom.server.entity.Player;
import net.minestom.server.event.Event;
import net.minestom.server.event.EventNode;
import net.minestom.server.event.player.AsyncPlayerConfigurationEvent;
import net.minestom.server.event.player.PlayerDisconnectEvent;
import net.minestom.server.event.player.PlayerLoginEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand All @@ -34,11 +34,11 @@ final class TestGameHandler {
this.gameManager = gameManager;

EventNode<Event> eventNode = GameEventNodes.GAME_MANAGER;
eventNode.addListener(PlayerLoginEvent.class, this::onJoin);
eventNode.addListener(AsyncPlayerConfigurationEvent.class, this::onJoin);
eventNode.addListener(PlayerDisconnectEvent.class, this::onLeave);
}

private void onJoin(@NotNull PlayerLoginEvent event) {
private void onJoin(@NotNull AsyncPlayerConfigurationEvent event) {
if (this.holder == null) {
this.holder = new GameHolder(this.gameManager);
}
Expand Down Expand Up @@ -67,7 +67,7 @@ private static final class GameHolder {
this.game = gameManager.createGame(creationInfo);
}

void onJoin(@NotNull PlayerLoginEvent event) {
void onJoin(@NotNull AsyncPlayerConfigurationEvent event) {
Player player = event.getPlayer();
player.sendMessage(Component.text("The server is in test mode. Use /gamesdk start to start a game."));

Expand Down

0 comments on commit c482da6

Please sign in to comment.