Skip to content

Download Java resourcepacks sent by the server, and load translations from them - #6578

Draft
eclipseisoffline wants to merge 12 commits into
GeyserMC:masterfrom
eclipseisoffline:java-pack-download
Draft

Download Java resourcepacks sent by the server, and load translations from them#6578
eclipseisoffline wants to merge 12 commits into
GeyserMC:masterfrom
eclipseisoffline:java-pack-download

Conversation

@eclipseisoffline

Copy link
Copy Markdown
Member

This PR implements the downloading and loading of Java resourcepacks sent to Geyser sessions by the server.

The code to implement this functionality is spread over multiple classes, all residing within the org.geysermc.geyser.pack.java package (or its children). The JavaPackContents record reads a Java ZIP resourcepack and holds the contents extracted from it. JavaPackManager is responsible for downloading, verifying, and caching resourcepacks across sessions. JavaPackStack is a per-session class holding the current current stack of resourcepacks, and lastly, JavaPackComposed holds the flattened-down contents of the session's stack of resourcepacks. This record is the main entrypoint for accessing Java resourcepack data.

This PR is currently unfinished. Resourcepacks are correctly downloaded, cached, and its contents (translations) are loaded and composed successfully. However, these composed translations are currently not used within Geyser, as this is facing some major refactors within the MessageTranslator/MinecraftLocale system.

The PR also depends on #6573, and that PR will have to be merged first.

TO-DO:

  • Implement re-usable structure for registry-like assets, which may be loaded in the future
  • Rework translations and actually use loaded translations within Geyser, maybe load vanilla JAR pack
  • Proper debug logs
  • Investigate threading/potential memory issues (does JavaPackManager need its own ExecutorService?)
  • Merge Refactor WebUtils to make use of modern HTTP APIs in Java #6573 (seems to have an urgent issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant