Created
May 23, 2020 02:19
-
-
Save reedacartwright/9c09989cc23e00c65053bb7dc02e6388 to your computer and use it in GitHub Desktop.
Plotting Overworld Chunks
This file contains hidden or 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
library(tidyverse) | |
library(rbedrock) | |
# generate a list of worlds | |
list_worlds() | |
# use the most recent file, adjust as needed | |
dbpath <- list_worlds()$folder[1] | |
# open the world db | |
db <- bedrockdb(dbpath) | |
# read all the keys in the database | |
keys <- db$keys() | |
# extract chunk info | |
chunks <- parse_chunk_keys(keys) | |
# extract overworld x,z chunk coords | |
xz <- chunks %>% | |
filter(dimension == 0 & tag == "ChunkVersion") %>% | |
select(x,z) | |
# create figure | |
g <- ggplot(aes(xmin=16*x, ymin=16*z, xmax=16*(x+1), ymax=16*(z+1)),data=xz) + | |
geom_rect() | |
g <- g + coord_fixed() + scale_y_reverse() + xlab("x") + ylab("z") | |
print(g) | |
# close database | |
db$close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment