Search in sources :

Example 1 with PacketCheckDimletConfig

use of mcjty.rftools.dimension.network.PacketCheckDimletConfig in project RFTools by McJty.

the class RfToolsDimensionManager method checkDimletConfig.

/**
 * Check if the client dimlet id's match with the server.
 * This is executed on the server to the clients.
 */
public void checkDimletConfig(EntityPlayer player) {
    if (!player.getEntityWorld().isRemote) {
        // Send over dimlet configuration to the client so that the client can check that the id's match.
        Logging.log("Send validation data to the client");
        DimletMapping mapping = DimletMapping.getDimletMapping(player.getEntityWorld());
        Map<Integer, DimletKey> dimlets = new HashMap<Integer, DimletKey>();
        for (Integer id : mapping.getIds()) {
            dimlets.put(id, mapping.getKey(id));
        }
        RFToolsMessages.INSTANCE.sendTo(new PacketCheckDimletConfig(dimlets), (EntityPlayerMP) player);
    }
}
Also used : DimletMapping(mcjty.rftools.items.dimlets.DimletMapping) DimletKey(mcjty.rftools.items.dimlets.DimletKey) PacketCheckDimletConfig(mcjty.rftools.dimension.network.PacketCheckDimletConfig)

Aggregations

PacketCheckDimletConfig (mcjty.rftools.dimension.network.PacketCheckDimletConfig)1 DimletKey (mcjty.rftools.items.dimlets.DimletKey)1 DimletMapping (mcjty.rftools.items.dimlets.DimletMapping)1