Skip to content

Instantly share code, notes, and snippets.

@codehz
Last active September 22, 2019 23:22
Show Gist options
  • Save codehz/35ff48b84807bec8bfdf7bade66bc992 to your computer and use it in GitHub Desktop.
Save codehz/35ff48b84807bec8bfdf7bade66bc992 to your computer and use it in GitHub Desktop.
StoneServer

codehz/StoneServer
codehz/stoneserver
You can find docker-compose.yml file in the github repo.

This tutorial is written for user that don't want to use Docker (or Archlinux).

Prerequirement

git cmake make or ninja jq curl redis-server

Minecraft 1.9.0.15 x86 apk

Linux kernal 4.4+ (and enabled user namespace feature) WSL is not support

Steps

  1. git clone https://github.com/minecraft-linux/mcpelauncher-extract
  2. build it
    (cd mcpelauncher-extract && mkdir -p build && cd build && cmake .. && cmake --build . && sudo cmake --build . --target install)
  3. extract apk
    mcpelauncher-extract <minecraft>.apk game
  4. (optional) clean up
    only game folder is needed
  5. download launcher core
    curl -fsSL https://stone.codehz.one/dump.sh | bash -eE
  6. extract it
    (mkdir -p core/{tmp,proc,dev} && cd core && tar xvf ../dump.tar.gz)
  7. create data folder
    mkdir -p data
  8. download nsroot
    curl -o nsroot https://stone.codehz.one/nsroot && chmod +x nsroot
  9. modify redis config
    add unixsocket /tmp/apid.socket to /etc/redis.conf
  10. start redis-server daemon
    systemctl start redis
  11. start the minecraft server
    ./nsroot -xr core -w /run -b /tmp -b data:/run/data -b game:/run/game -b /proc -b /dev ./stone

Tips

  1. It is unstable software (compare to official BDS). And sometime it may destroy your world, so dont forget to backup.
  2. If you want to use command, you should install cli tools for StoneServer (see below)
  3. To enable the scripting feature, you need to set the experiment-mode to true in data/server.properities
  4. Only server side script will work...
  5. You can use dump.sh to update the server core. (and re-extract)
  6. The extra API for script: https://github.com/codehz/minecraft-scripting-typings-server-side/blob/master/types/stone.d.ts

Cli tools

Prerequirement

node npm cmake 3.12 make or ninja gcc-8.2.1 or clang 7.0

Steps

  1. npm install -g stoneapi-js
    add --unsafe-perm if you want to install as root user
  2. stonecli
@codehz
Copy link
Author

codehz commented Feb 13, 2019

screenshot
image

@codehz
Copy link
Author

codehz commented Feb 13, 2019

directory structure

.
├── core
│   ├── etc
│   ├── lib
│   ├── run
│   ├── tmp
│   └── usr
├── data
│   ├── deviceid.txt
│   ├── games
│   ├── premium_cache
│   ├── server.properties
│   ├── treatments
│   └── valid_known_packs.json
├── dump.sh
├── game
│   ├── assets
│   └── libs
├── nsroot
├── redis
│   ├── cli.sh
│   ├── data
│   ├── etc
│   ├── proc
│   ├── server.sh
│   ├── tmp
│   └── usr
└── start.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment