• 1

    posted a message on How To: Raspberry Pi Server

    I was hoping to get the whole guide up before someone else got a word in, but it seems markdown toggle has failed me.


    The three most important parts to making a server run on a raspberry pi 2 are:


    • Use the oracle JDK (openjdk isn't as fast)
    • Use spigot
    • Use the --server option when running spigot's jar

    I don't know how the --server option works, but it does wonders for terrain generation. When we tried a server without this option, it only seemed to use one or two cores at a time, and the RPI2 has four cores. If you need more speed, you can use the world border plugin to pre-generate a bunch of terrain around spawn.


    Obviously there's a limit to what the server can do (a hundred or so cows colliding in a pen caused us some trouble), but I think it's fun for a group of around 4 friends. I think we've gotten up to 6 without issue.

    Posted in: Discussion
  • 1

    posted a message on How To: Raspberry Pi Server

    Any feedback is appreciated. I've considered adding bits on scheduling automatic backups and bukkit plugins, but I thought that might be jumping the gun. My favorite thing I did on the server is install the Minecraft Overviewer, which last I checked, does not have an Arm release. I had to build it myself, but it makes pretty pictures.

    Posted in: Discussion
  • 1

    posted a message on How To: Raspberry Pi Server

    Share with Friends

    This is the hardest, most important part

    The ip from the previous tutorial only works for the netowrk the raspberry pi isconnected to, it does not work for the internet as a whole. In most houses, theonly thing that has an internet ip address is the router. In order to allowthe raspberry pi to use the internet ip address, the router must be configuredfor it. This is called "port forwarding".

    The steps for port forwarding vary from router to router, but some things aresimilar. As in the previous tutorial, run 'ifconfig'. Again, this should listsomething like the following:

    ifconfig
    eth0      Link encap:Ethernet  HWaddr b8:27:eb:55:ab:2e  
              inet addr:192.168.0.141  Bcast:192.168.0.255  Mask:255.255.255.0
              inet6 addr: fe80::a6ab:6d32:e1a2:7c14/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:7314163 errors:0 dropped:2178 overruns:0 frame:0
              TX packets:22266859 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:738999375 (704.7 MiB)  TX bytes:2909519668 (2.7 GiB)
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:4 errors:0 dropped:0 overruns:0 frame:0
              TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1 
              RX bytes:416 (416.0  B)  TX bytes:416 (416.0 B)
    
    wlan0     Link encap:Ethernet  HWaddr b8:27:eb:00:fe:7b  
              inet6 addr: fe80::94f:3bf8:e0a4:4646/64 Scope:Link
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:9 errors:0 dropped:9 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:1157 (1.1 KiB)  TX bytes:0 (0.0 B)


    The ip for the server was "192.168.0.141". Usually, the ip of the router is thesame, but with a 1 at the end. In this case: "192.168.0.1". Go to this in a webbrowser, the same as any other webpage ("192.168.0.1" instead of"http://www.example.com"). It should be a webpage requesting a username andpassword. If these have not been configured, you can probably look up thedefault username and password for that router (google/bing/etc.).

    Once logged in (which, honestly, might take a while to figure out), look aroundthe various menus for an option called "port forwarding". Once you find it, adda port with the following settings:

    • Internal IP: raspberry pi ip (eg. 192.168.0.141)
      • This tells the router who needs the internet address

    • Port: 25565 (this is the default minecraft server port)
      • This should be internal port start, internal port end, external port start, and external port end.
      • Or it could be any range containing your minecraft port. It just needs to move from the external to the internal.

    • Protocol: TCP or BOTH
      • You really only need TCP, or so I'm told

    At this point, the raspberry pi server should be accessabe from anywhere onlineusing the router's external ip. The easiest way to find the external ip is toconnect to the router and search for "what is my ip" (on google/bing/etc.).Most search engines will reply with your ip address listed above the searchresults. Now is a good time to test the minecraft server, this time connectingwith the new ip address that can be used from anywhere.

    URL

    An external ip address works, but sometimes, it can change. It would be better to have a url from something like noip.com or freedns.afraid.org. This willredirect a url (eg. 'example.chickenkiller.com') to the ip address, and can be updated if the server moves or the ISP decides to change ip addresses.Here are the steps to setup a url by getting a subdomain from freedns.afraid.org.

    • Create an account at freedns.afraid.org
    • Select "subdomains" from the menu on the left
    • Click "add", and configure it
    • Type: A
    • Subdomain: your choice
    • Domain: your choice
    • Destination: your ip address (the router one. It might auto-fill)

    Once the subdomain has been set up, the url '.' can be used to connect to the minecraft server instead of the ip address(eg. 'example.chickenkiller.com') the raspberry pi can be configured to automatically update the subdomain to point to the correct ip every so often.That way, if the raspberry pi moves, or the router's ip address changes,the url will be updated to point to the correct ip address.

    Dynamic DNS

    Dynamic DNS is the service that lets a url update when the ip changes

    Go to the "Dynamic DNS" option on freedns.afriad.org page. Next to the newlycreated url, there should be a link to "quick cron example". Most of this filecontains comments, but the last line is an entry for the cron table, which isa linux tool for making tasks run automatically. To use it, run 'crontab -e' inthe terminal, wait for the crontab file to appear, then add the last line ofthe cron example to the end of the file. Copy and paste in the terminal, areoften 'Ctrol+shift+c' and 'Ctrol+shift+v' (for putty people, its hilight andright-click). Save and exit (eg. Ctrl+X and then Y at the prompt to save), andthe raspberry pi should now automatically keep the url up to date.

    In summary:

    • 'crontab -e'
    • copy last line of quick cron example to the end ('Ctrl+Shift+v')
    • 'Ctrl+x'
    • 'Y'

    It may take a bit of time for the url to start working.

    Static IP

    As a final note, sometimes, the raspberry pi's ip address within rhe router(eg. 192.168.0.141) might change. To prevent this, the raspberry pi can requesta particular ip. A tutorial on this can be found at[https://www.modmypi.com/blog/tutorial-how-to-give-your-raspberry-pi-a-static-ip-address](https://www.modmypi.com/blog/tutorial-how-to-give-your-raspberry-pi-a-static-ip-address). It involves editing the file /etc/network/interfaces (using'sudo nano /etc/network/interfaces') to read like the following

    auto lo
    
    iface lo inet loopback
    
    iface eth0 inet static
        address 192.168.0.141
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.254
    
    allow-hotplug wlan0
    iface default inet dhcp


    The 'iface eth0 inet static' section is the important part, and it's largelyfilled out with data from 'ifconfig'. If you didn't get the pi's ip address fromthe eth0 section, swap out eth0 for whatever had it (eg.'iface wlan0 inet static'). The 'broadcast' and 'netmask' are listed in the samesection (as 'Bcast' and 'Mask'). 'network' and 'gateway' can be found by running'netstat -nr'. They will be listed as "Destination" and "Gateway", eg.

    netstat -nr
    Kernel IP routing table
    Destination Gateway     Genmask     Flags   MSS Window   irtt Iface
    0.0.0.0     192.168.0.254   0.0.0.0     UF    0 0           0 eth0
    192.168.0.0 0.0.0.0     255.255.255.0   UF    0 0           0 eth0


    Address can the first three number from network, followed by any number below255 that is not in use. It's a good idea to pick something between 100 and 200,since these are probably available. Bear in mind that if the ip of theraspberry pi is changed to something new, the ip for the router's portforwarding must be changed as well.

    Posted in: Discussion
  • 1

    posted a message on How To: Raspberry Pi Server

    Make a Spigot Minecraft server

    Spigot is an alternative to the official minecraft server. Here's a quickfeature comparison:

    Plugin Support          YES    NO     
    Speed                   FAST   SLOW   
    Configuration Options   MANY   FEW    
    Official                NO     YES    


    Because the Raspberry Pi is slow, the extra speed of Spigot is vital.


    Setup

    Prerequisites


    The spigot server requires two other programs: java and git. On Raspbian,these should already be installed. If they aren't, installation can be done with a program called apt-get, which can be used from the terminal with these commands:


    #This is a comment. It doesn't do anything
    sudo apt-get update             #update installer
    sudo apt-get install git            #installs git
    git config --global --unset core.autocrlf   #configures git
    #If java isn't already installed, this command will install it:
    sudo apt-get install oracle-java8-jdk


    Note: We use Oracle's JVM because OpenJDK is slow on the Pi's ARM processor.



    Spigot

    Installing Spigot itself isn't quite this easy. It's a good idea to put the server files in their own folder, named minecraft.

    mkdir minecraft #make a folder called 'minecraft'
    cd minecraft #go into that folder



    Next, download the Spigot installer (BuildTools.jar):


    #backslash \ allows a command to take two lines
    wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/\
    artifact/target/BuildTools.jar 
    #Now, the `ls` command should show BuildTools.jar in this folder
    ls


    Then run BuildTools.jar:

    java -jar BuildTools.jar #This might take a while
    ls #List files in this folder


    Once it finishes, there should be a file called spigot-x.jar, except instead of x, it will contain the Minecraft server version (eg. spigot-1.11.2.jar). This is the jar that runs the Minecraft server. Now is a good time to test it.


    Test

    Before starting the server, its a good idea to find out the raspberry pi's ip.Run `ifconfig` in the terminal, and look for a line with "inet addr". Something like the following will appear.


    ifconfig
    eth0      Link encap:Ethernet  HWaddr b8:27:eb:55:ab:2e  
              inet addr:192.168.0.141  Bcast:192.168.0.255  Mask:255.255.255.0
              inet6 addr: fe80::a6ab:6d32:e1a2:7c14/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:7314163 errors:0 dropped:2178 overruns:0 frame:0
              TX packets:22266859 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:738999375 (704.7 MiB)  TX bytes:2909519668 (2.7 GiB)
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:4 errors:0 dropped:0 overruns:0 frame:0
              TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1 
              RX bytes:416 (416.0  B)  TX bytes:416 (416.0 B)
    
    wlan0     Link encap:Ethernet  HWaddr b8:27:eb:00:fe:7b  
              inet6 addr: fe80::94f:3bf8:e0a4:4646/64 Scope:Link
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:9 errors:0 dropped:9 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:1157 (1.1 KiB)  TX bytes:0 (0.0 B)


    "inet addr" is the ip of the raspberry pi. Ignore the section labeled "lo" with "inet addr: 127.0.0.1". In the example above,the ip is "192.168.0.141". Write this down; it will be used to connect to the server later.

    Note: Ips have four numbers, and most local ips start with 192.168.

    To run the server:

    java -jar -Xmx512m -server spigot-x.jar #replace x with the spigot version

    The arguments are there for the following reasons:


    • `java` - The minecraft server is a java program
    • `-jar` - Tells java to run a jar file
    • `-Xmx512m` - Tells java to only allocate 512MB (0.5G) of ram, because theraspberry pi doesn't have much ram
    • `-server` - This option appears to make the server run across multiple cores
    • `spigot-x.jar` - The server jar that java will run

    The first time it is run, it will crash, saying that you need to agree to the EULA:

    [14:59:41 WARN]: Failed to load eula.txt
    [14:59:41 INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info.
    [14:59:41 INFO]: Stopping server

    To do this, simply open eula.txt (`nano eula.txt`), and change eula=false to "eula=true". Save, exit, and run the server again.

    This time, it will take a while to start up, but eventually it will finish preparing spawn.Now another computer on the same network can log in to the server using the ipfrom the `ifconfig` command (eg. 192.168.0.141). To close the server, simply enter `stop` into the minecraft console.


    Tmux

    The minecraft server is now running, but there's a problem. If you close the terminal (or ssh session) that the server is running in, the server will be killed. However, a program called `tmux` can run things in the background, even when you're not logged in.

    First, close the server, and install tmux.


    #If the minecraft server is running, the stop command will turn of the server
    stop
    #Install tmux
    sudo apt-get install tmux


    Now, tmux can create a minecraft server that will run even if you log out.

    #Start a tmux session (named minecraft) that will run in the background:
    tmux new -s minecraft
    #Once the background terminal starts up, run the server
    java -jar -Xmx512m -server spigot-x.jar

    Press "Ctrl+b", then "d" to leave the tmux session. Now, even if the terminal window is closed, or ssh session is ended, the server will continue running. In order to return to the background terminal, run tmux a -t minecraft.


    tmux a -t minecraft
    #Now you can issue minecraft commands
    difficulty 2
    op notch
    say hi
    #Press `Ctrl+b d` to leave without stopping the server
    #To stop the server and exit screen entirely:
    stop #Stops the minecraft server
    exit #Closes tmux
    Posted in: Discussion
  • 1

    posted a message on How To: Raspberry Pi Server

    How to make a Raspberry Pi Minecraft Server


    Many people have long wanted to make the ultimate minecraft server on a raspberry pi... AND NOW YOU CAN!

    Here's what you need:


      • Raspberry Pi 2 Model B
        • It must have internet

      • A computer that can play minecraft (Technically this is optional, but it's helpful, and you probably have it already.)
      • An expert understanding of the terminal
        • By "expert understanding", I mean "a cheet sheet with common bash commands on it"
        • The "terminal" is that empty window with nothing but text that says: `pi@raspberrypi:~

    If you haven't set up the raspberry pi yet:



    Here's the plan:


      1. Make a spigot minecraft server
        • This can use bukkit plugins (eg. world border)
        • This cannot use forge mods (eg. buildcraft)

      1. Share it with your friends
        • Make it so that other people can log in to your server
        • IE people who aren't in your house

    Common bash commands:


      • `ls`
        • list everything in the current folder (folder = directory)

      • `cd <folder>`
        • go into folder (folder = directory)

      • `cp <file> <newfile>`
        • copies a file to a new file
        • eg. `cp server.properties backup/server.properties`

      • `mv <file> <newfile>`
        • moves a file somewhere else
        • eg. `mv WorldBorder.jar plugins/WorldBorder.jar`

      • `sudo apt-get install <program>`
        • installs program
        • eg. `sudo apt-get install oracle-java8-jdk`

      • `nano <file>`
        • edit a file (makes a new one if <file> doesn't exist)
        • eg. `nano server.properties`, or `nano spigot.yml`


      • `java -jar <jarfile>`
        • Runs a .jar file
        • eg. `java -jar spigot-1.10.2.jar`

      • tab
        • If you type the first few letters of a filename, then press tab, it will auto-complete
        • eg. "`java -jar sp`"+tab = "`java -jar spigot-1.10.2.jar`"
    Posted in: Discussion
  • 1

    posted a message on Antique Atlas

    Okay, I think I solved my own problem. I grouped all of the tiles by texture, and rendered each texture's tiles in one sweep without rebinding. It seems like the hash map and array lists would be to much overhead to be worth it, but the frame rate is up so I'm keeping it until I find something better.

    Posted in: Minecraft Mods
  • 1

    posted a message on Chocolate quest. Mods for the adventurers
    Yeah, you're right. I guess I'll keep looking. maybe if I delete the test.prop...

    @HingedPrism, thanks, that worked

    @rckymtnrfc, make sure that there are no hidden back-up files in that folder. I had a hidden test.prop~ file that kept trying to load the missing files.
    Posted in: Minecraft Mods
  • To post a comment, please .