Simplify update method

Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
jolheiser
2021-08-06 14:13:49 -05:00
parent 782f70ba21
commit 77dff83b0c
6 changed files with 11 additions and 6 deletions

View File

@ -1,7 +1,7 @@
## Updating `data`
1. Go to [https://github.com/PrismarineJS/minecraft-data/tree/master/data/pc/{version}](https://github.com/PrismarineJS/minecraft-data/tree/master/data/pc)
2. Update the URL in the following files if there is a new corresponding JSON file available:
2. Update `version` in the following files if there is a new corresponding JSON file available:
- [gen_block.go](block/gen_block.go) - `blocks.json`
- [gen_entity.go](entity/gen_entity.go) - `entities.json`
- [gen_item.go](item/gen_item.go) - `items.json`

View File

@ -14,7 +14,8 @@ import (
)
const (
infoURL = "https://raw.githubusercontent.com/PrismarineJS/minecraft-data/master/data/pc/1.17/blocks.json"
version = "1.17"
infoURL = "https://raw.githubusercontent.com/PrismarineJS/minecraft-data/master/data/pc/" + version + "/blocks.json"
//language=gohtml
blockTmpl = `// Code generated by gen_block.go; DO NOT EDIT.

View File

@ -14,7 +14,8 @@ import (
)
const (
infoURL = "https://raw.githubusercontent.com/PrismarineJS/minecraft-data/master/data/pc/1.17/entities.json"
version = "1.17"
infoURL = "https://raw.githubusercontent.com/PrismarineJS/minecraft-data/master/data/pc/" + version + "/entities.json"
//language=gohtml
entityTmpl = `// Code generated by gen_entity.go DO NOT EDIT.
// Package entity stores information about entities in Minecraft.

View File

@ -14,7 +14,8 @@ import (
)
const (
infoURL = "https://raw.githubusercontent.com/PrismarineJS/minecraft-data/master/data/pc/1.17/items.json"
version = "1.17"
infoURL = "https://raw.githubusercontent.com/PrismarineJS/minecraft-data/master/data/pc/" + version + "/items.json"
//language=gohtml
itemTmpl = `// Code generated by gen_item.go DO NOT EDIT.
// Package item stores information about items in Minecraft.

View File

@ -15,7 +15,8 @@ import (
)
const (
protocolURL = "https://raw.githubusercontent.com/PrismarineJS/minecraft-data/master/data/pc/1.17.1/protocol.json"
version = "1.17.1"
protocolURL = "https://raw.githubusercontent.com/PrismarineJS/minecraft-data/master/data/pc/" + version + "/protocol.json"
//language=gohtml
packetidTmpl = `// This file is automatically generated by gen_packetIDs.go. DO NOT EDIT.

View File

@ -13,7 +13,8 @@ import (
)
const (
protocolURL = "https://pokechu22.github.io/Burger/1.17.1.json"
version = "1.17.1"
protocolURL = "https://pokechu22.github.io/Burger/" + version + ".json"
//language=gohtml
soundTmpl = `// Code generated by gen_soundid.go. DO NOT EDIT.