[HOW TO] Compile Nukkit From Source

Discussion in 'General discussion' started by Its_Wolfe, Dec 31, 2016.

  1. Its_Wolfe

    Its_Wolfe Member

    Dec 29, 2016
    40
    25
    18
    Canada, eh?
    #1 Its_Wolfe, Dec 31, 2016
    Last edited: Jan 14, 2017
    I don't know where to post this, so feel free to move this topic if it is in the wrong spot, admin.

    So I ran into some issues compiling the 1.0.0DEV build, and wanted to do a full, comprehensive, guide for the newbies like me :). The one in README.md is a three-liner and did not work for me. lol
    First and foremost, ensure you have Apache Maven installed. (https://maven.apache.org)

    If you're lazy like me, you can grab a script to auto-compile at the bottom of my post.

    Then, grab the latest zip from your branch of choice, in this case I'm downloading 1.0.0 (https://github.com/Nukkit/Nukkit/tree/1.0.0) there's a green button saying Clone or download. You want to get the "Download ZIP" after dropping down the list.

    Also grab the Language.zip with the same method (https://github.com/Nukkit/Languages/tree/0f9ef06ce997a67c8395883e028483eebd9fd4f4)

    Unzip both zips, and go to the one for Nukkit. If you're in windows, right click inside the folder holding SHIFT and click on "Open Command Window Here" otherwise, you can cd into the directory too.

    Run "mvn clean" (without the quotation marks)
    It should end in build success, if not, repeat the previous steps

    Moving to the Language folder you got from unzipping, rename it to "lang" (lowercase, again without quotation marks)

    Copy/paste the lang folder to: <name of unzipped and cleaned nukkit folder>/src/main/resources/ so that you can see <name of unzipped and cleaned nukkit folder>/src/main/resources/lang/ has folders labelled eng, etc.

    You can go to the terminal you opened before, and now run "mvn package" (without the quotation marks) ignore any warnings you get and navigate to the target folder(<name of unzipped, cleaned, and compiled nukkit folder>/target/). Grab the nukkit.jar (not the original-Nukkit one).

    I have also made a .sh for Linux users too. Just run ./get.sh. (sorry for the shortlink)

    Prerequisites: Maven, unzip, and a brain.
    Download get.sh in an empty folder/directory: http://viid.me/qinIxY

    Run ./get.sh in the directory.
    If you want a specific fork to be installed, paste the link to the ZIP, instructions above.
    Otherwise, just press enter and it'll default to the 1.0.0 branch.


    If you rather not support me/not appreciate my work:
    get.sh http://www.mediafire.com/?bj36jmzx2hc65fy

    Prerequisites: git, Apache Maven.
    In a terminal running in your specified folder, run
    git clone --recursive https://github.com/Nukkit/Nukkit.git

    cd to the folder that created by doing cd *hit tab key* and then enter
    Then you should run "mvn clean" no errors should pop up, and run "mvn package"
    Both without quotation marks.
    You should now have a working jar :) If there are any errors or questions, feel free to ask on this topic, make a help topic, or PM me.

    @Chimlo1997 pointed this out, and is quite useful
    But if your server is running on same PC where you running MCW10E, you must:
    • Configure your server to another port (29132, for example);
    • Type (once) in command line:
      Code:
      CheckNetIsolation LoopbackExempt -a -n="Microsoft.MinecraftUWP_8wekyb3d8bbwe"
    • Run your Windows 10 Minecraft add new server (IP:localhost, port:29132) and connect to server.
    Happy Minecrafting!

    Its_Wolfe
     
    Antonio Sanchez and Chimlo1997 like this.
  2. Chimlo1997

    Chimlo1997 New Member

    Dec 29, 2016
    10
    1
    3
    Male
    Note: Delete the existing lang folder and replace with new from the zip folder you downloaded.

    I'm am still unable to join from MCW10 Edition and can't seem to figure out why.
     
  3. Its_Wolfe

    Its_Wolfe Member

    Dec 29, 2016
    40
    25
    18
    Canada, eh?
    Have you updated it in the windows store?
     
  4. Hyptrax

    Hyptrax Member

    Jun 27, 2016
    62
    8
    8
    Male
    I had this issue, but now it works. Join with a mobile device with the same name as Windows 10 and then try to join with Windows 10, this might work.
     
  5. Chimlo1997

    Chimlo1997 New Member

    Dec 29, 2016
    10
    1
    3
    Male
    #5 Chimlo1997, Jan 1, 2017
    Last edited: Jan 1, 2017
    Yeah its updated to v1.0.0, I've uninstalled and reinstalled MCW10 too.

    I tried it and nothing happened, just said (unable to connect to world)

    I figured out why I couldn't join, apparently you can't run the server on the same computer you are joining from unless you type some command in the CMD, I got the info from here: http://nukkit.ru/threads/nukkit-faq.51/
     
    fromgate likes this.
  6. Adriel J.

    Adriel J. New Member

    Jun 29, 2016
    11
    4
    3
    Male
    #6 Adriel J., Jan 1, 2017
    Last edited: Jan 1, 2017
    Does this way is different with three-line start.cmd ?

    And how did you managed to know that?
     
  7. Its_Wolfe

    Its_Wolfe Member

    Dec 29, 2016
    40
    25
    18
    Canada, eh?
    java.lang.null.pointer.exception
    So I figured the lang files had something to do with it.
    And lo and behold, when I got the zip, the lang folder was empty
     
  8. truongnm

    truongnm New Member

    Jan 2, 2017
    4
    1
    3
    Male
    I got this error when joining from W10: logged out due to Outdated server!
    And yes, my minecraft is up-to-date, I compile Nukkit from source, also I checkout branch
    from master to 1.0.0 but it still say logged out due to Outdated server!
     
  9. truongnm

    truongnm New Member

    Jan 2, 2017
    4
    1
    3
    Male
    Oh actually after I change to branch 1.0.0.0, I did a recompile and now I able to join the server :D
     
  10. Its_Wolfe

    Its_Wolfe Member

    Dec 29, 2016
    40
    25
    18
    Canada, eh?
    :p Haha
     
  11. Adriel J.

    Adriel J. New Member

    Jun 29, 2016
    11
    4
    3
    Male
    Sorry, but how to install Apache Maven, because for me it's too complicated.
     
  12. truongnm

    truongnm New Member

    Jan 2, 2017
    4
    1
    3
    Male
  13. Its_Wolfe

    Its_Wolfe Member

    Dec 29, 2016
    40
    25
    18
    Canada, eh?
    You could do a quick Google search for a video tutorial
    "How to install maven <name of OS>"
     
  14. Its_Wolfe

    Its_Wolfe Member

    Dec 29, 2016
    40
    25
    18
    Canada, eh?
    Added a Linux auto-compile script