Skip to content

voxelearth/minecraft-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voxel Earth — Minecraft Plugin

VoxelEarth monorepo with consistent versions: https://github.com/ryanhlewis/VoxelEarth

A Paper plugin that streams voxelized Google Earth 3D tiles into Minecraft on demand.

⚠️ Requirements (read first!)

  • WSL2 Ubuntu environment (Windows Subsystem for Linux 2)
  • NVIDIA GPU (the plugin relies on our GPU voxelizer)
  • Java 11 + Maven, Python 3 + pip, Node.js + npm

The steps below copy the CUDA toolkit + build guidance used in the monorepo so the voxelizer works in WSL2 Ubuntu.


1) Prepare WSL2 Ubuntu + core tools

Install Ubuntu from the Microsoft Store. Inside Ubuntu:

sudo apt update
sudo apt install -y openjdk-11-jdk maven python3 python3-pip nodejs npm

2) Create a Paper server and drop in the plugin scaffolding

mkdir -p ~/paper-server
cd ~/paper-server
wget https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/499/downloads/paper-1.20.4-499.jar -O paper.jar
mkdir -p plugins
wget -O plugins/FastAsyncWorldEdit-Bukkit-2.12.3.jar https://github.com/IntellectualSites/FastAsyncWorldEdit/releases/download/2.12.3/FastAsyncWorldEdit-Bukkit-2.12.3.jar
echo "eula=true" > eula.txt

# Pull the monorepo to get the server-folder-items + voxelizer pieces
git clone https://github.com/ryanhlewis/VoxelEarth.git voxelearth
cp -r voxelearth/minecraft-plugin/server-folder-items/* ./
chmod 777 cuda_voxelizer

# Node scripts used by helpers in server-folder-items
cd scripts
npm install
cd ..

3) CUDA toolkit (WSL2 Ubuntu) + GPU voxelizer build

After installing CUDA:

export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
source ~/.bashrc
nvcc --version  # should print a version

Lay out dependencies for our voxelizer:

# Copy these for Makefile references
cp -r ~/voxelearth/trimesh2/ ~
cp -r ~/voxelearth/cuda_voxelizer/ ~

# System libs for Trimesh2
sudo apt install -y libgl-dev libglu-dev libxi-dev

Build Google Draco (compression libs) and expose headers:

cd ~
git clone https://github.com/google/draco.git
cd draco
mkdir build && cd build
cmake ..
make

# copy headers and built libs where Trimesh2 expects them
cp -r ~/draco/src/draco ~/trimesh2/include/
cp -r ~/draco/build/draco/* ~/trimesh2/include/draco/

Build Trimesh2 for the voxelizer:

cd ~/trimesh2
chmod 777 copyFiles.sh
./copyFiles.sh

Build the CUDA voxelizer:

cd ~/cuda_voxelizer
chmod 777 build.sh
./build.sh

chmod 777 build/cuda_voxelizer
./build/cuda_voxelizer -h

Test on a file:

./build/cuda_voxelizer -f myfile.glb -s 64 -o glb
# Or to export JSON for Minecraft
./build/cuda_voxelizer -f myfile.glb -s 64 -o json

4) Run the Paper server with the plugin

cd ~/paper-server
java -Xms512M -Xmx1024M -jar paper.jar nogui

NOTE: This plugin is still in development. Make backups and test on a clean server.

Plugin commands

visit:
  description: Teleport to a city or location using geocoding.
  usage: /visit <location>
visitradius:
  description: Set how many tiles /visit loads around the target
  usage: /visitradius <tiles>
moveradius:
  description: Set how many tiles movement-triggered loads will fetch
  usage: /moveradius <tiles>
movethreshold:
  description: Set the movement distance threshold (in blocks) for triggering loads
  usage: /movethreshold <blocks>
moveload:
  description: Toggle movement-based loading for yourself
  usage: /moveload <on|off|toggle|status>

Developing this plugin

cd ~/voxelearth/minecraft-plugin/
mvn -Pdebug clean package
# or just:
mvn clean package

cp target/*.jar ~/paper-server/plugins/

Useful files & dirs

  • server-folder-items/ — files copied into the Paper server root (scripts, config, helpers).
  • scripts/ — Node helpers used by the server.
  • src/main/java/.../VoxelChunkGenerator.java — main logic mapping player position to lat/lon and spawning voxelized chunks.

Acknowledgements

  • Lucas Dower — ObjToSchematic (CPU voxelizer).
  • ForceFlow — cuda_voxelizer & TriMesh2 groundwork.
  • Cesium / Google — 3D Tiles & Photorealistic Tiles.
  • Omar Shehata — viewer inspiration.

About

Voxel Earth is a plugin for converting 3D Tiles to Minecraft blocks!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published