Search in sources :

Example 1 with PacketGetScreenData

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

the class ScreenRenderer method updateScreenData.

private Map<Integer, IModuleData> updateScreenData(ScreenTileEntity screenTileEntity) {
    long millis = System.currentTimeMillis();
    if ((millis - screenTileEntity.lastTime > 500) && screenTileEntity.isNeedsServerData()) {
        screenTileEntity.lastTime = millis;
        GlobalCoordinate pos = new GlobalCoordinate(screenTileEntity.getPos(), screenTileEntity.getWorld().provider.getDimension());
        RFToolsMessages.INSTANCE.sendToServer(new PacketGetScreenData(RFTools.MODID, pos, millis));
    }
    GlobalCoordinate key = new GlobalCoordinate(screenTileEntity.getPos(), screenTileEntity.getWorld().provider.getDimension());
    Map<Integer, IModuleData> screenData = ScreenTileEntity.screenData.get(key);
    if (screenData == null) {
        screenData = Collections.emptyMap();
    }
    return screenData;
}
Also used : PacketGetScreenData(mcjty.rftools.blocks.screens.network.PacketGetScreenData) GlobalCoordinate(mcjty.lib.varia.GlobalCoordinate) IModuleData(mcjty.rftools.api.screens.data.IModuleData)

Aggregations

GlobalCoordinate (mcjty.lib.varia.GlobalCoordinate)1 IModuleData (mcjty.rftools.api.screens.data.IModuleData)1 PacketGetScreenData (mcjty.rftools.blocks.screens.network.PacketGetScreenData)1