2018-09-12 06:39:55 +00:00
|
|
|
package com.seodisparate.TurnBasedMinecraft.client;
|
|
|
|
|
|
|
|
import com.seodisparate.TurnBasedMinecraft.common.CommonProxy;
|
2018-09-14 03:44:45 +00:00
|
|
|
import com.seodisparate.TurnBasedMinecraft.common.TurnBasedMinecraftMod;
|
2018-09-12 06:39:55 +00:00
|
|
|
|
|
|
|
import net.minecraft.client.Minecraft;
|
|
|
|
|
|
|
|
public class ClientProxy extends CommonProxy
|
|
|
|
{
|
|
|
|
private BattleGui battleGui;
|
|
|
|
|
|
|
|
public ClientProxy()
|
|
|
|
{
|
|
|
|
super();
|
|
|
|
battleGui = new BattleGui();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setBattleGuiTime(int timeRemaining)
|
|
|
|
{
|
|
|
|
battleGui.timeRemaining.set(timeRemaining);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setBattleGuiBattleChanged()
|
|
|
|
{
|
|
|
|
battleGui.battleChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setBattleGuiAsGui()
|
|
|
|
{
|
|
|
|
Minecraft.getMinecraft().addScheduledTask(() -> {
|
|
|
|
if(Minecraft.getMinecraft().currentScreen != battleGui)
|
|
|
|
{
|
|
|
|
battleGui.turnEnd();
|
|
|
|
Minecraft.getMinecraft().displayGuiScreen(battleGui);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void battleGuiTurnBegin()
|
|
|
|
{
|
|
|
|
battleGui.turnBegin();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void battleGuiTurnEnd()
|
|
|
|
{
|
|
|
|
battleGui.turnEnd();
|
|
|
|
}
|
2018-09-14 03:44:45 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void battleEnded()
|
|
|
|
{
|
|
|
|
TurnBasedMinecraftMod.currentBattle = null;
|
|
|
|
Minecraft.getMinecraft().addScheduledTask(() -> {
|
|
|
|
Minecraft.getMinecraft().displayGuiScreen(null);
|
|
|
|
Minecraft.getMinecraft().setIngameFocus();
|
|
|
|
});
|
|
|
|
}
|
2018-09-12 06:39:55 +00:00
|
|
|
}
|