Minor refactoring/fixes

This commit is contained in:
Stephen Seo 2024-10-22 13:22:21 +09:00
parent 4652ecf20e
commit e6501e4fe3
2 changed files with 3 additions and 2 deletions

View file

@ -229,6 +229,7 @@ public class BattleGui extends Screen {
if (TurnBasedMinecraftMod.proxy.getLocalBattle() == null) { if (TurnBasedMinecraftMod.proxy.getLocalBattle() == null) {
// drawHoveringText("Waiting...", width / 2 - 50, height / 2); // drawHoveringText("Waiting...", width / 2 - 50, height / 2);
drawString(guiGraphics, "Waiting...", width / 2 - 50, height / 2, 0xFFFFFFFF); drawString(guiGraphics, "Waiting...", width / 2 - 50, height / 2, 0xFFFFFFFF);
super.render(guiGraphics, mouseX, mouseY, partialTicks);
return; return;
} }
if (TurnBasedMinecraftMod.proxy.getLocalBattle().getState() == Battle.State.DECISION if (TurnBasedMinecraftMod.proxy.getLocalBattle().getState() == Battle.State.DECISION

View file

@ -26,7 +26,7 @@ public class BattleUpdater
@SubscribeEvent @SubscribeEvent
public void update(TickEvent.ServerTickEvent tickEvent) { public void update(TickEvent.ServerTickEvent tickEvent) {
if(tickEvent.phase != TickEvent.Phase.START && isRunning.get() && ++tick > tickLimit) { if(tickEvent.phase != TickEvent.Phase.START && isRunning.get() && ++tick > tickLimit && tickEvent.haveTime()) {
tick = 0; tick = 0;
manager.battleMap.entrySet().removeIf(entry -> entry.getValue().update()); manager.battleMap.entrySet().removeIf(entry -> entry.getValue().update());
manager.updateRecentlyLeftBattle(); manager.updateRecentlyLeftBattle();