Minor refactoring/fixes

This commit is contained in:
Stephen Seo 2024-10-22 13:22:21 +09:00
parent 89f19f3218
commit 934fc3842b
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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();