Resource
Static Resources
ApricityUI mainly works with these resource types right now: HTML, CSS, JS, images, and fonts.
Audio and video are not in scope yet.
Where Resources Are Loaded From
There are three resource layers, from highest priority to lowest:
- Development path:
src/main/resources/assets/apricityui/apricity/... - Game instance directory:
apricity/... - Mod resource pack:
assets/apricityui/apricity/...
If the same path exists in all three layers, the topmost one wins.
This lookup order is intentionally designed for development and customization:
- During development, edit source resources directly for the highest priority.
- Modpack authors can override files in the instance-level
apricityfolder without repackaging the mod. - The mod's bundled resources act as the fallback default.
How To Write Paths
Relative paths are recommended.
For example, if an image is in the same directory as the HTML file:
<img src="loading.gif" />
If CSS references a font in a child folder:
@font-face {
font-family: "myfont";
src: url("fonts/myfont.ttf");
}
If you use a path starting with /, it is resolved from the Apricity resource root, not from a browser website root.
Relative traversal like .. is also supported.
How HTML, CSS, And JS Are Loaded
HTML itself is loaded through entry points such as ApricityUI.createDocument(path) or ApricityUI.openScreen(path).
CSS and JS both support external and inline forms:
<style src="panel.css"></style>
<style>
.panel {
width: 120px;
}
</style>
<script src="panel.js"></script>
<script>
// inline script
</script>
A few important notes:
- External CSS is loaded asynchronously and also supports
@import. - External JS is currently resolved as local resources. Do not interpret it like a browser script tag.
- The HTML entry page itself is still a local resource, not a remote web page.
Images And Fonts
Common image formats are already supported, including PNG, JPG, and GIF.
GIF support is real animation support, not a placeholder.
For fonts, ApricityUI supports @font-face with resources such as TTF and OTF. It also ships a built-in lxgw font.
One detail: the built-in font is a compact subset. It contains about 3500 commonly used Chinese characters and is optimized for practical usage and small size.
Remote Resources
ApricityUI supports some remote resources, but not as a general "load everything from the internet" mechanism.
The stable use cases right now are:
- Remote images
- Remote CSS
- Remote fonts
There are also several restrictions:
- Only
https://is allowed - Loading is asynchronous
- There are size and content-type limits
So it is suitable for:
- Hosted images
- Online theme styles
- Online fonts
It is not suitable as a remote HTML page system, and remote JS should not be treated like browser-style script distribution.
Remote HTML and remote JS may be considered in the future.
Hot Reload
The instance-level apricity folder exists specifically for hot reload and customization.
The most direct way is pressing END, which reloads static resources immediately and refreshes the current Document.
In debug mode, these file types are watched automatically:
.html.css.js
The watcher covers:
src/main/resources/assets/apricityui/apricityin development- The instance-level
apricityfolder
The resource-pack layer is mainly for default resources, not the main hot-reload workflow.
Debugging And Resource Inspection
ApricityUI includes a Resource Manager that shows you the final merged resource list directly.
This is useful because it tells you:
- Whether the current file comes from the development directory, the instance directory, or the resource pack
- Which resource finally overrides another at the same path
- Which exact image, stylesheet, or HTML file is actually being used
If you are debugging "I changed the file but nothing happened", check this first.
A Recommended Workflow
If you are a modpack author or prefer a front-end-style workflow, this is a practical setup:
- Put resources in
apricity/modid/...under the instance directory - Use relative paths for HTML, CSS, images, and fonts
- Use
ENDfor hot reload while styling - Package them into a resource pack or mod resources only when needed
This is usually the most efficient workflow and the least likely to be disrupted by path issues.