• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

jkutner/heroku-buildpack-minecraft: A buildpack for running a Minecraft Server o ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

jkutner/heroku-buildpack-minecraft

开源软件地址(OpenSource Url):

https://github.com/jkutner/heroku-buildpack-minecraft

开源编程语言(OpenSource Language):

Shell 93.9%

开源软件介绍(OpenSource Introduction):

Heroku Minecraft Buildpack

This is a Heroku Buildpack for running a Minecraft server in a dyno.

Deploy to Heroku

Usage

Create a free ngrok account and copy your Auth token. Then create a new Git project with a eula.txt file:

$ echo 'eula=true' > eula.txt
$ git init
$ git add eula.txt
$ git commit -m "first commit"

Then, install the Heroku CLI. Create a Heroku app, set your ngrok token, and push:

$ heroku create
$ heroku buildpacks:add heroku/python
$ heroku buildpacks:add heroku/jvm
$ heroku buildpacks:add jkutner/minecraft
$ heroku config:set NGROK_API_TOKEN="xxxxx"
$ git push heroku master

Finally, open the app:

$ heroku open

This will display the ngrok logs, which will contain the name of the server (really it's a proxy, but whatever):

Server available at: 0.tcp.ngrok.io:17003

Copy the 0.tcp.ngrok.io:17003 part, and paste it into your local Minecraft app as the server name.

Syncing to S3

The Heroku filesystem is ephemeral, which means files written to the file system will be destroyed when the server is restarted.

Minecraft keeps all of the data for the server in flat files on the file system. Thus, if you want to keep you world, you'll need to sync it to S3.

First, create an AWS account and an S3 bucket. Then configure the bucket and your AWS keys like this:

$ heroku config:set AWS_BUCKET=your-bucket-name
$ heroku config:set AWS_ACCESS_KEY=xxx
$ heroku config:set AWS_SECRET_KEY=xxx

The buildpack will sync your world to the bucket every 60 seconds, but this is configurable by setting the AWS_SYNC_INTERVAL config var.

Connecting to the server console

The Minecraft server runs inside a screen session. You can use Heroku Exec to connect to your server console.

Once you have Heroku Exec installed, you can connect to the console using

$ heroku ps:exec
Establishing credentials... done
Connecting to web.1 on ⬢ lovely-minecraft-2351...
$ screen -r minecraft

WARNING You are now connected to the Minecraft server. Use Ctrl-A Ctrl-D to exit the screen session. (If you hit Ctrl-C while in the session, you'll terminate the Minecraft server.)

Customizing

ngrok

You can customize ngrok by setting the NGROK_OPTS config variable. For example:

$ heroku config:set NGROK_OPTS="--remote-addr 1.tcp.ngrok.io:25565"

Minecraft

You can choose the Minecraft version by setting the MINECRAFT_VERSION like so:

$ heroku config:set MINECRAFT_VERSION="1.18.1"

You can also configure the server properties by creating a server.properties file in your project and adding it to Git. This is how you would set things like Creative mode and Hardcore difficulty. The various options available are described on the Minecraft Wiki.

You can add files such as banned-players.json, banned-ips.json, ops.json, whitelist.json to your Git repository and the Minecraft server will pick them up.

Adding New Minecraft Versions

Please submit Pull Requests to etc/files.json

Using the Buildpack from source

If you want the bleeding edge version of this buildpack run:

$ heroku buildpacks:remove jkutner/minecraft
$ heroku buildpacks:add https://github.com/jkutner/heroku-buildpack-minecraft



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap