Voxelum / minecraft-launcher-core-node

Provide packages to install Minecraft, launch Minecraft and more to build launcher with NodeJs/Electron!
https://docs.xmcl.app/en/core/
MIT License
176 stars 25 forks source link

Couple of questions regarding this "ecosystem" #122

Open HoldYourWaffle opened 4 years ago

HoldYourWaffle commented 4 years ago

I just found this repository while doing the whole "this must have been done before"-search for a project I'm working on, and I have to say it looks very promising and I'd love to contribute 😄

I have a few questions however to clear up some confusion:

  1. I found two other repositories in this organization that look very similar to some modules in this one, minecraft-three-model and minecraft-resource-manager-js. What's the relation between those repositories and their "corresponding" modules in this repository? ([model]() and [resource-manager]())

  2. What's the relation between [resourcepack]() and [resource-manager]()? Intuitively I'd think resourcepack would be a "resource implementation" for resource-manager, but various "common resource interfaces" like Resource and ResourceLocation are defined in the (more specific) resourcepack.

  3. The documentation on what is a resource/resource-manager/resource-pack/resource-source doesn't seem to "add up" so to speak. For example, the resource-manager readme mentions an addResourceSource method on ResourceManager, but I can't find the definition for this. The documentation for ResourceManager also mentions a generic parameter for the "type of resource content", but it doesn't seem to actually exist. I know there are more of these kinds of discrepancies, but right now I only remember those two. Is the documentation just outdated or am I missing something here?

  4. What is the zlib folder inside the nbt module?

As I said before, I'd love to contribute to this project (https://github.com/Voxelum/minecraft-launcher-core-node/issues/102#issuecomment-604104557), but right now I'm mostly getting confused by it 😅

ci010 commented 4 years ago
  1. They are the legacy repo to manage the code. Currently, those two are managed under this monorepo (@xmcl/model and @xmcl/resource-manager)
  2. ResourcePack module only provides read resource from a single resource pack (a zip or a folder). The ResourceManager can manage multiple resource pack at once, just like Minecraft. You will need to add resource pack into it and calling loadResource from it will load the resource from "top to bottom" (just like Minecraft). Overall, the resource-manager is a higher level module.
  3. That's a outdated document. When I migrate the code to this repo, I forgot to rename the code in doc. I will rename and update other docs in next patch. The addResourceSource should be addResourcePack.
  4. You will see the folder inside a package like nbt/zlib, or user/util. In short, it's an abstract layer to make the package works in both node and browser. The zlib is the abstract layer for the compress/decompress functions. The nbt module require('./zlib') will require either index.ts or index.browser.ts according to the environment (the bundler like webpack will pick a correct one!).

Finally, I'm appreciated your passion. It's welcome to contribute on chunk parsing feature! I'll add more detail in roadmap thread.

HoldYourWaffle commented 4 years ago

Thank you so much for your rapid response!

  1. So if I understand correctly, these repositories could just as well be deleted (or marked as archived)?

  2. I guess that makes sense. It might be good to further clarify this relationship in the documentation.

  3. I just read (most of) the updated documentation, this makes a lot more sense indeed.

  4. I guess that make sense. However, this also raises some new questions for me, regarding the overall "(sub)module structure" of this project, but I'll wait to post them until I have fully "analyzed" it (to prevent things like stupid oversights).