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
|
@Override
|
||||||
public void accept(PacketBattlePing pkt, CustomPayloadEvent.Context ctx) {
|
public void accept(PacketBattlePing pkt, CustomPayloadEvent.Context ctx) {
|
||||||
ctx.enqueueWork(() -> {
|
ctx.enqueueWork(() -> {
|
||||||
if (TurnBasedMinecraftMod.proxy.getLocalBattle() == null) {
|
if (TurnBasedMinecraftMod.proxy.getLocalBattle() != null) {
|
||||||
TurnBasedMinecraftMod.proxy.createLocalBattle(pkt.battleID);
|
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);
|
ctx.setPacketHandled(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue