From 934fc3842b3c2e4ad5134f99a1ffebfacbdbaf95 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Tue, 22 Oct 2024 13:22:21 +0900 Subject: [PATCH] Minor refactoring/fixes --- .../com/burnedkirby/TurnBasedMinecraft/client/BattleGui.java | 1 + .../burnedkirby/TurnBasedMinecraft/common/BattleUpdater.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/burnedkirby/TurnBasedMinecraft/client/BattleGui.java b/src/main/java/com/burnedkirby/TurnBasedMinecraft/client/BattleGui.java index 3d7d56f..9a8c441 100644 --- a/src/main/java/com/burnedkirby/TurnBasedMinecraft/client/BattleGui.java +++ b/src/main/java/com/burnedkirby/TurnBasedMinecraft/client/BattleGui.java @@ -229,6 +229,7 @@ public class BattleGui extends Screen { if (TurnBasedMinecraftMod.proxy.getLocalBattle() == null) { // drawHoveringText("Waiting...", width / 2 - 50, height / 2); drawString(guiGraphics, "Waiting...", width / 2 - 50, height / 2, 0xFFFFFFFF); + super.render(guiGraphics, mouseX, mouseY, partialTicks); return; } if (TurnBasedMinecraftMod.proxy.getLocalBattle().getState() == Battle.State.DECISION diff --git a/src/main/java/com/burnedkirby/TurnBasedMinecraft/common/BattleUpdater.java b/src/main/java/com/burnedkirby/TurnBasedMinecraft/common/BattleUpdater.java index c032246..349efa1 100644 --- a/src/main/java/com/burnedkirby/TurnBasedMinecraft/common/BattleUpdater.java +++ b/src/main/java/com/burnedkirby/TurnBasedMinecraft/common/BattleUpdater.java @@ -27,7 +27,7 @@ public class BattleUpdater @SubscribeEvent public void update(ServerTickEvent.Post tickEvent) { //if(tickEvent.phase != TickEvent.Phase.START && isRunning.get() && ++tick > tickLimit) { - if(isRunning.get() && ++tick > tickLimit) { + if(isRunning.get() && ++tick > tickLimit && tickEvent.hasTime()) { tick = 0; manager.battleMap.entrySet().removeIf(entry -> entry.getValue().update()); manager.updateRecentlyLeftBattle();