------------------------
Installation information
------------------------
The code here is a sample Minecraft Mod that controls AllJoyn devices based on Minecraft events.
Current code changes AllJoyn LSF devices color and brightness to simulate the lighting in the game.


Development tools installation
==============================
1. Install Java SDK - http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2. Install Java development tool - http://www.eclipse.org/downloads/
3. Install Mod tool Forge - http://files.minecraftforge.net
   a) Download Src or Mdk from Forget site
   b) Unzip to any folder (e.g. "C:\forge")
   c) From the unzipped folder
      i) run 'gradlew setupDecompWorkspace'
	  ii) run 'gradlew eclipse'
4. Install AllJoyn Java SDK - https://allseenalliance.org/releases/alljoyn/15.04/alljoyn-15.04.00b-win7x64vs2013-sdk.zip
   a) Download AllJoyn Java SDK
   b) Unzip to any location	(e.g. "C:\alljoyn-15.04.00b-win7x64vs2013-sdk")

   
Develop and debug
=================
1. Skip this step if you have uncompressed source. Otherwise, decompress jar file to a development folder
   (e.g. "jar -xf alljoynMod-1.8-1.1-sources.jar" at folder "Minecraft.Forge").   
2. Launch Eclipse and accept the default workspace ("e.g. c:\forge\eclipse")
3. Remove example sources
   a) Right click on the project and select "Java Build Path"
   b) From "Source" tab, remove all example folders from "Source folders on build path:"
4. Link to AllJoynMod src and resources
   a) Right click on the project and select "Java Build Path"
   b) From "Source" tab, click "Link Source..." and select the "src" as linked folder location
	  (e.g. "Minecraft.Forge\src")
	  and "Src" as Folder name
   c) Again from "Source" tab, click "Link Source..." and select the "resources" as linked folder location 
	  (e.g. "Minecraft.Forge\resources")
	  and "Resources" as Folder name
5. Add AllJoyn Java to build path
   a) Right click on the project and select "Java Build Path"
   b) From "Libraries" tab, click "Add External JARs" and select "alljoyn.jar" from AllJoyn Java SDK location
      (e.g. "C:\alljoyn-15.04.00b-win7x64vs2013-sdk\alljoyn-15.04.00b-win7x64vs2013-sdk-rel\java\jar\alljoyn.jar")
   c) In the Project Explorer, you should see "alljoyn.jar" as one of the libraries.  Right click on "alljoyn.jar" and select "Property"
   d) Select "Native Library" from left panel and select "External location".  Click on "External Folder..." and 
      select the folder where "alljoyn_java.lib" is located (e.g. "C:\alljoyn-15.04.00b-win7x64vs2013-sdk\alljoyn-15.04.00b-win7x64vs2013-sdk-rel\java\lib")
6. You are now ready to launch or debug from Eclipse.  Once launched, select "Mod" button on Minecraft UI, you should see "AllJoynMod" in the list.
	  

Packaging
=========
1. Build from command prompt
   a) CD to AllJoyn Mod folder ("cd Samples\Minecraft.Forge")
   b) Mkdir 'libs' if it does not exist
   c) Copy alljoyn_java.jar to the 'libs' folder just created
   d) From AllJoyn Mod folder, run (forge_folder)\gradlew batch file to build build.gradle script - 
      "c:\forge\gradlew.bat clean"
      "c:\forge\gradlew.bat build"
   e) If build succeeds, you will find target MOD "Samples\Minecraft.Forge\build\libs\alljoynMod-1.8-1.0.jar"

   
Launch from Minecraft
=====================
1. Make sure Minecraft Forge is installed - http://files.minecraftforge.net
   a) Download Forge installer
   b) Run the installer EXE
   c) If prompted, install Java runtime library
   d) On the first dialog in Minecraft Forege installer, select "Install client" and finish installation
2. Deploy alljoyn Mod to Minecraft MOD folder
   a) Copy the built jar to .minecraft mods folder
    (e.g. "Copy alljoynMod-1.8-1.0.jar C:\Users\%USERNAME%\AppData\Roaming\.minecraft\mods")
   b) Copy alljoyn_java.dll to any folder in your system PATH so it can be loaded at runtime.
    (e.g. "Copy alljoyn_java.dll C:\Windows")
3. Launch Minecraft
4. Click "Edit Profile" and select one of the forge release in "Use version:" drop-down list
5. Start playing


Tips
====
1. Make sure Minecraft shows your Mod
2. Make sure LSF devices are in the same subnet
3. If (firewall) prompted, allow Java runtime to access your network

