From ed596f944c8f17410c6449730dbe8ceca55f3d57 Mon Sep 17 00:00:00 2001 From: tier940 Date: Thu, 6 Aug 2026 14:13:50 +0900 Subject: [PATCH 1/2] chore: add CodeRabbit config and make AGENTS.md canonical Successor to the removed Gemini Code Assist / Claude PR review setups. - knowledge_base.mcp.usage: enabled - 'auto' disables MCP for public repositories, which would prevent the DeepWiki MCP server from being used as review context. - reviews.path_instructions: give the reviewer the GTCEu context it needs (this repo is a GregTech CE: Unofficial add-on), plus the module system and mixin conventions specific to this repo. Also make AGENTS.md the canonical file: CLAUDE.md is now a symlink to it, matching Claude Code's own documented pattern (ln -s AGENTS.md CLAUDE.md) and letting CodeRabbit's AGENTS.md/CLAUDE.md auto-detection pick up the real content either way. --- .coderabbit.yaml | 49 +++++++++++++++++++++++ AGENTS.md | 102 +++++++++++++++++++++++++++++++++++++++++++++++ CLAUDE.md | 1 + 3 files changed, 152 insertions(+) create mode 100644 .coderabbit.yaml create mode 100644 AGENTS.md create mode 120000 CLAUDE.md diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000..754dbc5 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,49 @@ +knowledge_base: + mcp: + # "auto" disables MCP for public repositories, so set it explicitly. + # This is what allows the DeepWiki MCP server to be used as review context. + usage: enabled + +reviews: + path_instructions: + - path: "src/main/java/**/*.java" + instructions: | + Minecraft 1.12.2 Forge mod (GTBeesMatrix / GTBM), an add-on for + GregTech CE: Unofficial (GTCEu, https://github.com/GregTechCEu/GregTech). + Also integrates with Forestry, Binnie's Mods (Extra Bees, Extra Trees), + Gendustry, GregTech Food Option (GTFO) and The One Probe. + + GTCEu context — use DeepWiki (GregTechCEu/GregTech) to verify: + - Confirm GTCEu APIs, registries, recipe builders and multiblock/apiary + related classes are used correctly, and that referenced methods/fields + actually exist in the pinned GTCEu version. + - Flag use of GTCEu internals that are not part of its public API when a + public equivalent exists. + + Platform constraints (1.12.2 / Java 8 bytecode): + - Do NOT suggest Java APIs or language features unavailable on this platform + (e.g. `List.of`, records, switch expressions, text blocks). + - Do NOT suggest modern Minecraft/Forge APIs; this is the 1.12.2 Forge line. + + Side boundary: + - Flag client-only types or `@SideOnly(Side.CLIENT)` members referenced from + common/server code paths — this crashes a dedicated server. + + Module system: + - Modules are annotated `@GTEModule` and discovered via ASM. Check that new + modules extend the correct base class and declare `modDependencies` + correctly for optional integrations. + - Integration modules under `integration//` extend `GTBMIntegrationSubmodule`. + + Mixins (`mixins/`, targets: chisel, draconicevolution, gcym, gregtech): + - Verify the target class, method signature and descriptor plausibly exist in + the targeted mod. + - Any new mixin must be registered in the matching mixin config. + + Optional integrations: + - Optional mod integrations must be gated so a missing optional mod + (Gendustry, Binnie's Mods, GTFO, TOP) cannot crash the game. + + Build: + - `build.gradle` is auto-generated. Never edit it + (configure via `buildscript.properties` / `dependencies.gradle`). diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..95fd4a8 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,102 @@ +# AGENTS.md + +This file provides guidance to AI coding agents when working with code in this repository. + +## Project Overview + +GTBeesMatrix (GTBM) is a Minecraft 1.12.2 Forge mod that adds tweaks, fixes, and integrations for Forestry bees in GregTech-based modpacks. It extends GregTech CE Unofficial (CEu) with bee breeding fixes, GT machine recipes for bee products, and multiblock apiaries. + +Note: This project was renamed from GTExpert (GTE). Many internal class names still use the GTE prefix (e.g., `GTEModule`, `GTEModuleManager`, `BaseGTEModule`), but the mod ID and package path use `gtbm`. + +## Build Commands + +```bash +# Setup development workspace (required first time) +./gradlew setupDecompWorkspace + +# Build the mod +./gradlew build + +# Run Minecraft client +./gradlew runClient + +# Run Minecraft server +./gradlew runServer + +# Apply code formatting (Spotless) +./gradlew spotlessApply + +# Check code formatting +./gradlew spotlessCheck + +# Run tests +./gradlew test + +# Run a single test class +./gradlew test --tests "com.github.gtexpert.core.GTETest" + +# Update buildscript to latest version +./gradlew updateBuildScript +``` + +## Architecture + +### Module System + +The mod uses a custom module system for organizing features and integrations: + +- **Module Manager** (`modules/GTEModuleManager.java`): Discovers and loads modules via ASM, manages lifecycle events, and handles module dependencies +- **Base Module** (`modules/BaseGTEModule.java`): Abstract base class all modules extend +- **Module Container** (`modules/GTEModules.java`): Registers the main module container + +Modules are annotated with `@GTEModule` and automatically discovered at runtime. Module configuration is in `config/gtexpert/modules.cfg`. + +### Integration Modules + +Located in `integration/`, each subdirectory contains integration code for a specific mod: +- `forestry` - Forestry (farms, bees, recipes) +- `gendustry` - Gendustry (industrial apiary, bee status widget) +- `binnies` - Binnie's Mods (Extra Bees, Extra Trees) +- `gtfo` - GregTech Food Option +- `top` - The One Probe (tooltip providers for apiaries) + +Integration modules extend `GTBMIntegrationSubmodule` and declare mod dependencies via the `@GTEModule(modDependencies = {...})` annotation. + +### Core Components + +- **CoreMod** (`core/GTECoreMod.java`): FML loading plugin that performs ASM transformations and handles dependency loading +- **Mixins** (`mixins/`): Mixin classes organized by target mod (chisel, draconicevolution, gcym, gregtech) +- **Common** (`common/`): Blocks, items, metatileentities, config, and event handlers +- **API** (`api/`): Public API including recipes, materials, capabilities, and utilities +- **Loaders** (`loaders/`): Recipe and material loaders + +### Key Dependencies + +- GregTech CE Unofficial (CEu) - Required +- Forestry - Required +- MixinBooter - Required for mixin support +- GroovyScript - Required for scripting support + +## Code Style + +- **Formatting**: Enforced via Spotless using Eclipse formatter (run `./gradlew spotlessApply`) +- **Import order**: Defined in `spotless.importorder` (gregtech, net, codechickenlib, other, javax/java, static) +- **Line length**: 120 characters max +- **Indentation**: 4 spaces + +## Configuration + +- `buildscript.properties`: Main build configuration (mod version, features, dependencies) +- `dependencies.gradle`: Add new mod dependencies here +- `repositories.gradle`: Add new maven repositories here +- Debug flags in `buildscript.properties` enable runtime dependencies for specific mod integrations during development + +## Testing Integration Mods + +Enable debug flags in `buildscript.properties` to load specific mods at runtime: +```properties +debug_all = false # Enable all optional mods +debug_gendustry = true # Enable just Gendustry +debug_binnies = true # Enable just Binnie's Mods +debug_gtfo = true # Enable just GregTech Food Option +``` diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 0000000..47dc3e3 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file From 7dc9e1456eb12512e9c9ce40f312ab1895f7ce92 Mon Sep 17 00:00:00 2001 From: tier940 Date: Thu, 6 Aug 2026 14:33:05 +0900 Subject: [PATCH 2/2] chore: clarify module discovery mechanism in path_instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unlike GTExpert-Core, this repo has no IClassTransformer/ASM bytecode rewriting — ModuleManager uses Forge's ASMDataTable annotation scanning only, which is a safe, standard Forge mechanism. State this explicitly so the reviewer does not conflate it with the riskier bytecode-transformer pattern used elsewhere in the org's repos. --- .coderabbit.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 754dbc5..244819e 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -30,9 +30,10 @@ reviews: common/server code paths — this crashes a dedicated server. Module system: - - Modules are annotated `@GTEModule` and discovered via ASM. Check that new - modules extend the correct base class and declare `modDependencies` - correctly for optional integrations. + - Modules are annotated `@GTEModule` and discovered via Forge's `ASMDataTable` + annotation scanning (`modules/ModuleManager.java`), not bytecode rewriting. + Check that new modules extend the correct base class and declare + `modDependencies` correctly for optional integrations. - Integration modules under `integration//` extend `GTBMIntegrationSubmodule`. Mixins (`mixins/`, targets: chisel, draconicevolution, gcym, gregtech):