From 24749b8ccc619f17154dcc270f954a0bdf007adf Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Tue, 18 Sep 2018 16:58:01 +0900 Subject: [PATCH] Minor fixes/changes --- .../TurnBasedMinecraft/client/ClientProxy.java | 7 +++++++ .../TurnBasedMinecraft/common/CommonProxy.java | 2 ++ .../common/networking/PacketBattleMessage.java | 3 +-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/seodisparate/TurnBasedMinecraft/client/ClientProxy.java b/src/main/java/com/seodisparate/TurnBasedMinecraft/client/ClientProxy.java index 2cb89fb..aea1f95 100644 --- a/src/main/java/com/seodisparate/TurnBasedMinecraft/client/ClientProxy.java +++ b/src/main/java/com/seodisparate/TurnBasedMinecraft/client/ClientProxy.java @@ -60,6 +60,12 @@ public class ClientProxy extends CommonProxy battleGui.turnEnd(); } + @Override + public void battleStarted() + { + setBattleGuiAsGui(); + } + @Override public void battleEnded() { @@ -68,6 +74,7 @@ public class ClientProxy extends CommonProxy Minecraft.getMinecraft().displayGuiScreen(null); Minecraft.getMinecraft().setIngameFocus(); }); + stopMusic(); } @Override diff --git a/src/main/java/com/seodisparate/TurnBasedMinecraft/common/CommonProxy.java b/src/main/java/com/seodisparate/TurnBasedMinecraft/common/CommonProxy.java index 2bf1b54..2d58ac0 100644 --- a/src/main/java/com/seodisparate/TurnBasedMinecraft/common/CommonProxy.java +++ b/src/main/java/com/seodisparate/TurnBasedMinecraft/common/CommonProxy.java @@ -17,6 +17,8 @@ public class CommonProxy public void battleGuiTurnEnd() {} + public void battleStarted() {} + public void battleEnded() {} public void postInit() {} diff --git a/src/main/java/com/seodisparate/TurnBasedMinecraft/common/networking/PacketBattleMessage.java b/src/main/java/com/seodisparate/TurnBasedMinecraft/common/networking/PacketBattleMessage.java index a88b7b4..3bb7ca2 100644 --- a/src/main/java/com/seodisparate/TurnBasedMinecraft/common/networking/PacketBattleMessage.java +++ b/src/main/java/com/seodisparate/TurnBasedMinecraft/common/networking/PacketBattleMessage.java @@ -232,7 +232,7 @@ public class PacketBattleMessage implements IMessage { TurnBasedMinecraftMod.currentBattle = new Battle(message.amount, null, null, false); } - TurnBasedMinecraftMod.commonProxy.setBattleGuiAsGui(); + TurnBasedMinecraftMod.commonProxy.battleStarted(); if(message.custom.isEmpty()) { TurnBasedMinecraftMod.commonProxy.typeEnteredBattle(null); @@ -258,7 +258,6 @@ public class PacketBattleMessage implements IMessage case ENDED: TurnBasedMinecraftMod.commonProxy.displayString("Battle has ended!"); TurnBasedMinecraftMod.commonProxy.battleEnded(); - TurnBasedMinecraftMod.commonProxy.stopMusic(); break; case ATTACK: TurnBasedMinecraftMod.commonProxy.displayString(from + " attacked " + to + " and dealt " + message.amount + " damage!");