You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Centralize icon sizing and enhance AI documentation
- Add IconSizeConfig class for centralized icon dimension constants
(ADDON_ICON_SIZE=64, INSTALLED_INDICATOR_SIZE=32)
- Update all GUI components to use IconSizeConfig instead of hardcoded sizes
(AddonDetailScreen, BrowseAddonsScreen, InstalledAddonsScreen, WAddonCard)
- Update IconPreloadSystem to use centralized size constants for texture creation
Documentation improvements:
- Expand CLAUDE.md with project structure, architecture patterns,
and detailed icon sizing/texture rendering documentation
- Add comprehensive GEMINI.md with project context, threading model,
build instructions, and code search guidelines
- Add Gemini MCP server configuration (.gemini/settings.json)
This refactoring makes icon sizes configurable from a single location
and provides comprehensive guidance for AI assistants working on the codebase.
- `systems/` - Meteor Systems (singleton managers with NBT persistence)
67
+
- `gui/` - All GUI code organized by type (tabs, screens, widgets)
68
+
- `util/` - Utility classes with static helper methods
69
+
- `models/` - Data classes mapping to JSON structures
70
+
26
71
## Architecture
27
72
28
73
### Threading Model (CRITICAL)
@@ -33,7 +78,7 @@ This is a **Meteor Client addon** that provides an in-game GUI for browsing, ins
33
78
- Use `mc.execute(() -> { ... })` to schedule GUI updates back on the render thread
34
79
- See `AddonManager.fetchAddonMetadata()` for the pattern
35
80
36
-
**Icon Cache Pattern**: `IconCache` uses async texture loading - always returns immediately with a default texture, then loads the real texture in the background and triggers a UI refresh callback.
81
+
**Icon Cache Pattern**: Icons are preloaded during startup. `IconPreloadSystem` downloads PNG bytes in background threads, then converts them to GPU textures during resource reload (render thread). `IconCache.get(addon)` returns instantly - either the cached texture or a gray placeholder.
37
82
38
83
### Systems Architecture
39
84
@@ -81,42 +126,67 @@ public MyWidget(GuiTheme theme, Data data) {
81
126
82
127
The `theme` field is set by the framework when the widget is added to the widget tree. Never set it manually or call `init()` from the constructor.
83
128
129
+
### Icon Sizing (IMPORTANT)
130
+
131
+
All addon icon sizes are centralized in `IconSizeConfig.java`:
132
+
133
+
```java
134
+
public static final int ADDON_ICON_SIZE = 64; // Change here to adjust globally
135
+
public static final int INSTALLED_INDICATOR_SIZE = 32;
136
+
```
137
+
138
+
**All icons display at 64x64 pixels** across grid view, list view, detail screens, and installed addons. To change icon sizes:
139
+
1. Edit `IconSizeConfig.ADDON_ICON_SIZE`
140
+
2. Rebuild - all GUI components and texture creation automatically use the new size
This file provides comprehensive context and guidelines for Gemini agents working on the **Meteor Addons** project.
4
+
5
+
## 1. Project Overview
6
+
7
+
**Meteor Addons** is a specialized addon for the [Meteor Client](https://meteorclient.com/) (a Minecraft utility mod). It functions as an in-game package manager, allowing users to browse, install, and update other Meteor Client addons directly from the client's GUI.
8
+
9
+
* **Type:** Java Project (Fabric Mod / Meteor Client Addon)
* **Networking:** Uses `OkHttp` (bundled via `include` in Gradle). Always verify internet access before assuming success.
83
+
* **File Operations:** Addons are downloaded to `MeteorClient.FOLDER.getParent().resolve("mods")`.
84
+
* **Version Filtering:** Checks `custom.supported_versions` array first, then `mc_version`.
85
+
86
+
## 6. Common Pitfalls to Avoid
87
+
1. **Calling `init()` manually:** Never do this for Widgets.
88
+
2. **Blocking Render Thread:** Will freeze the game. Use `MeteorExecutor`.
89
+
3. **Texture Size Mismatch:** Always resize `NativeImage` to match the texture dimensions defined in `IconSizeConfig` before uploading to prevent memory violations.
90
+
4. **Theme Shadowing:** Do not create a `theme` field in your widget if extending a Meteor widget; use the protected field from the parent.
91
+
92
+
## 7. Tools & Reference
93
+
94
+
### 7.1 Code Search (Mandatory)
95
+
Use `code-search-mcp` for all codebase exploration and navigation.
96
+
1. **Initialize:** Always ensure the workspace is added via `add_workspace` (if not already detected/listed).
97
+
2. **Search:** Prefer these tools over `grep` or basic file reading:
98
+
* `search_symbols`: Find classes, methods, and variables.
99
+
* `search_ast_pattern`: Find code based on structure (e.g., `Systems.add($$$)`).
100
+
* `search_text`: Fast, regex-based text search (uses ripgrep).
101
+
3. **Investigate:** Use `codebase_investigator` for complex, high-level architectural questions.
102
+
103
+
### 7.2 References
104
+
* **AI Reference:** The `ai_reference/` directory contains decompiled/source code of Meteor Client and other addons. Index this directory if you need to search it deeply.
0 commit comments