This is a Sunday test to create some real terrain into the great game Minecraft. The idea was to use DEM files (Digital Elevation Model) to get the real elevations of a known place. DEM files can be found around internet. The next step was to be able to send the information to Minecraft. To solve this, I choose to install the Canarymod Minecraft Server with a plugin that allows to send commands via python.
These are the main steps:
- Python virtual environment
- Canarymod
- Raspberry Juice Plugin
- DEM files
- Run script
- Play
mkvirtualenv minecraft_terrain
pip install -r requirements.txt
- Create a folder for Canarymod.
- Download https://canarymod.net/releases/CanaryMod-1.2.0_0.zip
- Unzip it
- Edit the file eula.txt and set eula=true
- Run java -jar CanaryMod-1.8.0-1.2.0.jar
This is necessary to run your Minecraft with an API.
- Download the source code from https://github.com/martinohanlon/CanaryRaspberryJuice/archive/master.zip
- Open the zip file and copy the latest version of the plugin CanaryRaspberryJuice-#.#.jar from the jars folder to the plugins folder in the Canarymod folder.
For example, in Barcelona Area, the ICGC has 5x5 Elevation Models http://www.icgc.cat/appdownloads/
- build a VRT from all downloaded datasets
gdalbuildvrt -te 395000 4603000 405500 4607180 montserrat.vrt dems/*.txt
- Start up Canarymod (with the Raspberry Juice Plugin)
- Run the terrain.py script to read the DEM file and create the terrain
- Start minecraft
- Fly and enjoy the tour (/gamemode 1 )