Change "Ping" packet behavior
Changed "Ping" packet to not create client-local Battle instance when received, but rather only act if client-local Battle instance exists. This change was also made on the neoforge branches.
This commit is contained in:
parent
4c0872b7ad
commit
fde09d116d
1 changed files with 5 additions and 6 deletions
|
@ -46,13 +46,12 @@ public class PacketBattlePing {
|
|||
@Override
|
||||
public void accept(PacketBattlePing pkt, CustomPayloadEvent.Context ctx) {
|
||||
ctx.enqueueWork(() -> {
|
||||
if (TurnBasedMinecraftMod.proxy.getLocalBattle() == null) {
|
||||
TurnBasedMinecraftMod.proxy.createLocalBattle(pkt.battleID);
|
||||
if (TurnBasedMinecraftMod.proxy.getLocalBattle() != null) {
|
||||
TurnBasedMinecraftMod.proxy.setBattleGuiAsGui();
|
||||
TurnBasedMinecraftMod.proxy.setBattleGuiBattleChanged();
|
||||
TurnBasedMinecraftMod.proxy.setBattleGuiTime(pkt.decisionSeconds);
|
||||
TurnBasedMinecraftMod.proxy.pauseMCMusic();
|
||||
}
|
||||
TurnBasedMinecraftMod.proxy.setBattleGuiAsGui();
|
||||
TurnBasedMinecraftMod.proxy.setBattleGuiBattleChanged();
|
||||
TurnBasedMinecraftMod.proxy.setBattleGuiTime(pkt.decisionSeconds);
|
||||
TurnBasedMinecraftMod.proxy.pauseMCMusic();
|
||||
});
|
||||
ctx.setPacketHandled(true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue