From 05701378f10647985fa09457078df26bde17f8db Mon Sep 17 00:00:00 2001 From: Zak Shearman <34372536+ZakShearman@users.noreply.github.com> Date: Fri, 5 Jan 2024 00:49:54 +0000 Subject: [PATCH] (deps): bump java-game-sdk + minestom-core --- build.gradle.kts | 2 +- .../emortal/minestom/battle/chest/ChestUpdateHandler.java | 2 +- .../java/dev/emortal/minestom/battle/game/BattleGame.java | 6 +++++- .../dev/emortal/minestom/battle/game/GameStartHandler.java | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5c17c97..c7a4f9e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,7 +17,7 @@ repositories { } dependencies { - implementation("dev.emortal.minestom:game-sdk:5fdd697") + implementation("dev.emortal.minestom:game-sdk:52c9b1d") implementation("dev.hollowcube:polar:1.3.1") implementation("com.github.EmortalMC:MinestomPvP:6aefcba403") diff --git a/src/main/java/dev/emortal/minestom/battle/chest/ChestUpdateHandler.java b/src/main/java/dev/emortal/minestom/battle/chest/ChestUpdateHandler.java index c395d40..3ff5b22 100644 --- a/src/main/java/dev/emortal/minestom/battle/chest/ChestUpdateHandler.java +++ b/src/main/java/dev/emortal/minestom/battle/chest/ChestUpdateHandler.java @@ -36,7 +36,7 @@ public final class ChestUpdateHandler { public ChestUpdateHandler(@NotNull BattleGame game) { this.game = game; - this.instance = game.getSpawningInstance(); + this.instance = game.getInstance(); this.registerBackgroundTasks(); game.getEventNode().addListener(PlayerBlockInteractEvent.class, this::onBlockInteract); diff --git a/src/main/java/dev/emortal/minestom/battle/game/BattleGame.java b/src/main/java/dev/emortal/minestom/battle/game/BattleGame.java index b09cae5..4dc698e 100644 --- a/src/main/java/dev/emortal/minestom/battle/game/BattleGame.java +++ b/src/main/java/dev/emortal/minestom/battle/game/BattleGame.java @@ -179,7 +179,11 @@ public void cleanUp() { } @Override - public @NotNull Instance getSpawningInstance() { + public @NotNull Instance getSpawningInstance(@NotNull Player player) { + return this.map.instance(); + } + + public @NotNull Instance getInstance() { return this.map.instance(); } diff --git a/src/main/java/dev/emortal/minestom/battle/game/GameStartHandler.java b/src/main/java/dev/emortal/minestom/battle/game/GameStartHandler.java index 999a0cf..c774f28 100644 --- a/src/main/java/dev/emortal/minestom/battle/game/GameStartHandler.java +++ b/src/main/java/dev/emortal/minestom/battle/game/GameStartHandler.java @@ -142,7 +142,7 @@ private void unfreezeAll() { private void registerEvents() { new PvpListener(this.game); new ChestUpdateHandler(this.game); - HungerListener.register(this.game.getSpawningInstance()); + HungerListener.register(this.game.getInstance()); } } }