Search in sources :

Example 1 with ScreenInfoPacketServer

use of mcjty.rftools.blocks.screens.network.ScreenInfoPacketServer in project RFTools by McJty.

the class ScreenBlock method getWailaBodyScreen.

@SideOnly(Side.CLIENT)
@Optional.Method(modid = "waila")
public List<String> getWailaBodyScreen(List<String> currenttip, EntityPlayer player, ScreenTileEntity te) {
    if (!te.isConnected() && te.isControllerNeeded()) {
        currenttip.add(TextFormatting.YELLOW + "[NOT CONNECTED]");
    }
    if (!isCreative()) {
        boolean power = te.isPowerOn();
        if (!power) {
            currenttip.add(TextFormatting.YELLOW + "[NO POWER]");
        }
        if (player.isSneaking()) {
            int rfPerTick = te.getTotalRfPerTick();
            currenttip.add(TextFormatting.GREEN + (power ? "Consuming " : "Needs ") + rfPerTick + " RF/tick");
        }
    }
    if (System.currentTimeMillis() - lastTime > 500) {
        lastTime = System.currentTimeMillis();
        RFToolsMessages.INSTANCE.sendToServer(new PacketGetInfoFromServer(RFTools.MODID, new ScreenInfoPacketServer(te.getWorld().provider.getDimension(), te.getPos())));
    }
    Collections.addAll(currenttip, ScreenInfoPacketClient.infoReceived);
    return currenttip;
}
Also used : PacketGetInfoFromServer(mcjty.lib.network.clientinfo.PacketGetInfoFromServer) ScreenInfoPacketServer(mcjty.rftools.blocks.screens.network.ScreenInfoPacketServer) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

PacketGetInfoFromServer (mcjty.lib.network.clientinfo.PacketGetInfoFromServer)1 ScreenInfoPacketServer (mcjty.rftools.blocks.screens.network.ScreenInfoPacketServer)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1