TurnBasedMinecraftMod/src/main/java/com/seodisparate/TurnBasedMinecraft/client/ClientProxy.java

53 lines
1.1 KiB
Java
Raw Normal View History

2018-09-12 06:39:55 +00:00
package com.seodisparate.TurnBasedMinecraft.client;
import com.seodisparate.TurnBasedMinecraft.common.CommonProxy;
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();
}
}