Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes: - A few more changes to what I've been working on for the last few days. This commit makes the tag reading methods for the Reader more consistent, and de-abstracts the logic for reading the bytes from the data buffer. It was challenging for me to find where the function calls were when I first looked into the original NBT.js library, so while a bit repetitive, I took those function calls out of the extra `read()` method and moved their logic directly into their own tag methods, to better show what they were doing to get the byte data using the `DataView`. - I also renamed some of the Reader attributes, just to make them a little more readable too. I have nothing against camelcase haha, but it's sometimes easier to just have to remember one word for a variable in some spots. - Simplified the header checking functions! Took out a few extra steps that get you to the same place. Got some inspiration and help from a few different places for these last few commits: https://github.com/janispritzkau/nbt-ts https://gist.github.com/jonathanlurie/04fa6343e64f750d03072ac92584b5df (Will be using this soon, thought I'd add it now just in case I lose track of it) C4K3/nbted#4 https://stackoverflow.com/questions/30229522/how-can-i-join-an-array-of-numbers-into-1-concatenated-number https://stackoverflow.com/questions/54019143/issue-with-combining-large-array-of-numbers-into-one-single-number
- Loading branch information