Search in sources :

Example 1 with C00PacketKeepAlive

use of net.minecraft.network.play.client.C00PacketKeepAlive in project Galacticraft by micdoodle8.

the class GuiTeleporting method updateScreen.

@Override
public void updateScreen() {
    super.updateScreen();
    if (mc.thePlayer != null && mc.thePlayer.worldObj != null) {
        // Screen will exit when the player is in the target dimension and has started moving down
        if (mc.thePlayer.worldObj.provider.getDimensionId() == this.targetDimensionID && (mc.thePlayer.worldObj.provider instanceof IZeroGDimension || (mc.thePlayer.posY - mc.thePlayer.lastTickPosY) < 0.0)) {
            mc.displayGuiScreen(null);
            TickHandlerClient.teleportingGui = null;
        }
    }
    // The following code is copied from GuiDownloadTerrain:
    ++this.progress;
    if (this.progress % 20 == 0) {
        this.mc.thePlayer.sendQueue.addToSendQueue(new C00PacketKeepAlive());
    }
}
Also used : C00PacketKeepAlive(net.minecraft.network.play.client.C00PacketKeepAlive) IZeroGDimension(micdoodle8.mods.galacticraft.api.world.IZeroGDimension)

Aggregations

IZeroGDimension (micdoodle8.mods.galacticraft.api.world.IZeroGDimension)1 C00PacketKeepAlive (net.minecraft.network.play.client.C00PacketKeepAlive)1