-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chunk: Support block aliases properly.
- Loading branch information
1 parent
c465a38
commit d295bc3
Showing
6 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,36 @@ | ||
# worldcompute | ||
live-computation, parsing, and savings of minecraft: bedrock worlds | ||
|
||
live-computation, parsing, and saves of minecraft: bedrock servers using gophertunnel and dragonfly. | ||
|
||
![example of worldcompute on the hive](example.png) | ||
|
||
## usage | ||
|
||
download the latest release and move it to its own folder. run the executable and authenticate with xbox live. | ||
|
||
when completed, worldcompute will save your xbox live token in the same folder under `token.tok`. unless you delete the | ||
file, you'll be able to use worldcompute without authenticating again. | ||
|
||
after authenticating, you can close worldcompute. you'll notice that a configuration will be generated. edit the | ||
configuration to your liking, and then run worldcompute. the worldcompute proxy will now forward connections to the | ||
target server specified. | ||
|
||
worldrenderer will automatically run and render the chunks in cache in real-time. | ||
|
||
## commands | ||
|
||
- `reset` - reset all downloaded chunks in cache. | ||
- `save` - save all downloaded chunks to a folder. | ||
- `cancel` - terminate a save-in-progress. | ||
|
||
## supported formats | ||
|
||
- `v0` (pre-v1.2.13) (legacy, only used by PM3) | ||
- `v1` (post-v1.2.13, only a single layer) | ||
- `v8/v9` (post-v1.2.13, up to 256 layers) (persistent and runtime) | ||
- `v9 (sub-chunk request system)` (post-v1.18.0, up to 256 layers) (persistent and runtime) | ||
|
||
## credits | ||
|
||
special thanks to [T 14Raptor](https://github.com/T14Raptor) for the original worldcompute project, and | ||
[Sandertv](https://github.com/Sandertv) for his work on gophertunnel and dragonfly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package world | ||
|
||
import ( | ||
_ "embed" | ||
"github.com/sandertv/gophertunnel/minecraft/nbt" | ||
) | ||
|
||
var ( | ||
//go:embed block_aliases.nbt | ||
blockAliasesData []byte | ||
// aliasMappings maps from a legacy block name alias to an updated name. | ||
aliasMappings = make(map[string]string) | ||
) | ||
|
||
// upgradeAliasEntry upgrades a possible alias block entry to the correct/updated block entry. | ||
func upgradeAliasEntry(entry blockState) (blockState, bool) { | ||
if alias, ok := aliasMappings[entry.Name]; ok { | ||
entry.Name = alias | ||
return entry, true | ||
} | ||
if entry.Name == "minecraft:barrier" { | ||
entry.Name = "minecraft:info_update" | ||
} | ||
return blockState{}, false | ||
} | ||
|
||
// init creates conversions for each legacy and alias entry. | ||
func init() { | ||
if err := nbt.Unmarshal(blockAliasesData, &aliasMappings); err != nil { | ||
panic(err) | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters