Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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 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/<mod>/` extend `GTBMIntegrationSubmodule`.

Comment on lines +32 to +38

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n --glob '*.java' 'ASMDataTable|IClassTransformer|`@GTEModule`|`@GregTechModule`|`@ModuleContainer`|class (GTE)?ModuleManager' .

Repository: GTModpackTeam/GTBeesMatrix

Length of output: 1738


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- candidate files ---'
fd -i -t f '(ModuleManager|BaseGTEModule|GTEModules|GTEModule|TModule|ModuleContainer|IClassTransformer|AGENTS|coderabbit)' . | sort

printf '%s\n' '--- module references in guidance ---'
rg -n -C 4 'Module|ASM|IClassTransformer|GTEModule|TModule|ModuleContainer|modDependencies' AGENTS.md .coderabbit.yaml

printf '%s\n' '--- module source outline ---'
ast-grep outline src/main/java/com/github/gtexpert/gtbm/module/ModuleManager.java --view expanded

printf '%s\n' '--- relevant manager implementation ---'
sed -n '1,130p' src/main/java/com/github/gtexpert/gtbm/module/ModuleManager.java
sed -n '350,435p' src/main/java/com/github/gtexpert/gtbm/module/ModuleManager.java

printf '%s\n' '--- annotation, container, and base-type declarations/usages ---'
rg -n -C 5 --glob '*.java' 'interface TModule|`@interface` TModule|class .*ModuleContainer|`@interface` ModuleContainer|interface IModule|class BaseGTEModule|GTBMIntegrationSubmodule|modDependencies|IClassTransformer|implements IClassTransformer|extends .*Module' src

Repository: GTModpackTeam/GTBeesMatrix

Length of output: 50384


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- exact declarations ---'
cat -n src/main/java/com/github/gtexpert/gtbm/api/modules/TModule.java
cat -n src/main/java/com/github/gtexpert/gtbm/api/modules/ModuleContainer.java
cat -n src/main/java/com/github/gtexpert/gtbm/module/Modules.java
cat -n src/main/java/com/github/gtexpert/gtbm/module/BaseModule.java
cat -n src/main/java/com/github/gtexpert/gtbm/integration/GTBMIntegrationSubmodule.java

printf '%s\n' '--- module manager entry points and references ---'
rg -n -C 5 'ModuleManager|getInstance\(\)|\.setup\(|ASMDataTable|ModuleContainer|TModule' src/main/java --glob '*.java' \
  | grep -E 'ModuleManager|setup\(|ASMDataTable|ModuleContainer|TModule' \
  | head -n 180

printf '%s\n' '--- transformation mechanisms ---'
rg -n -C 3 'IClassTransformer|ClassTransformer|transform\(|ASM|CoreMod|IFMLLoadingPlugin|Transformer' . \
  --glob '!AGENTS.md' --glob '!.coderabbit.yaml' --glob '!*.json' --glob '!*.md' \
  | head -n 240

printf '%s\n' '--- stale identifiers and paths ---'
rg -n 'GTEModule|GTEModuleManager|BaseGTEModule|GTEModules|`@GTEModule`|modules/ModuleManager|module/ModuleManager|TModule|BaseModule|Modules|ModuleContainer' AGENTS.md .coderabbit.yaml src/main/java --glob '*.java' | head -n 240

Repository: GTModpackTeam/GTBeesMatrix

Length of output: 25127


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- transformation-related files and symbols ---'
rg -n 'IClassTransformer|ClassTransformer|IFMLLoadingPlugin|transform\(|ASM|CoreMod|coremod' . \
  --glob '!AGENTS.md' --glob '!.coderabbit.yaml' --glob '!*.md' \
  --glob '!*.json' --glob '!*.yml' --glob '!*.yaml' \
  | head -n 180

printf '%s\n' '--- core package files ---'
fd -t f . src/main/java/com/github/gtexpert/gtbm/core | sort

printf '%s\n' '--- core source excerpts ---'
for f in $(fd -t f . src/main/java/com/github/gtexpert/gtbm/core | sort); do
  echo "### $f"
  rg -n -C 4 'class |interface |ASM|transform|IFML|CoreMod|LoadingPlugin' "$f" || true
done

printf '%s\n' '--- module container annotation usage ---'
rg -n -C 4 '`@ModuleContainer`|implements IModuleContainer|new Modules|class Modules' src/main/java --glob '*.java'

Repository: GTModpackTeam/GTBeesMatrix

Length of output: 6351


Align both guidance files with the current module contract.

  • Use ModuleManager at src/main/java/com/github/gtexpert/gtbm/module/ModuleManager.java.
  • State that Forge ASMDataTable scans @TModule and @ModuleContainer; module discovery does not use IClassTransformer.
  • Replace BaseGTEModule and GTEModules with BaseModule and Modules. Modules is registered manually by GTBMMod.
  • State that modules implement IModule, integration modules extend GTBMIntegrationSubmodule, and TModule.modDependencies contains the required mod IDs.
📍 Affects 2 files
  • .coderabbit.yaml#L32-L38 (this comment)
  • AGENTS.md#L46-L52
  • AGENTS.md#L63-L63
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.coderabbit.yaml around lines 32 - 38, Align the module guidance in
.coderabbit.yaml lines 32-38 and AGENTS.md lines 46-52 and 63 with the current
contract: reference ModuleManager at
src/main/java/com/github/gtexpert/gtbm/module/ModuleManager.java; state that
Forge ASMDataTable scans `@TModule` and `@ModuleContainer` and discovery does not
use IClassTransformer; replace BaseGTEModule/GTEModules with BaseModule/Modules,
noting that Modules is manually registered by GTBMMod; and state that modules
implement IModule, integration modules extend GTBMIntegrationSubmodule, and
TModule.modDependencies lists required mod IDs.

Source: MCP tools

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`).
102 changes: 102 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -nP --glob '*.java' 'class\s+\w*CoreMod|IClassTransformer|ASMDataTable|ClassTransformer' .

Repository: GTModpackTeam/GTBeesMatrix

Length of output: 1532


🏁 Script executed:

#!/bin/bash
set -euo pipefail
printf '%s\n' '--- AGENTS.md context ---'
sed -n '55,75p' AGENTS.md
printf '%s\n' '--- core-related Java files ---'
git ls-files '*.java' | grep -Ei '(^|/)(core|.*core.*|.*transform.*)' || true
printf '%s\n' '--- core and transformer references ---'
rg -n -i --glob '*.{java,gradle,xml,md}' 'GTECoreMod|CoreMod|IClassTransformer|transformer|ASM|FML.*Loading|IFMLLoadingPlugin' . || true
printf '%s\n' '--- Java declarations containing Core ---'
rg -n --glob '*.java' 'class\s+\w*Core\w*|interface\s+\w*Core\w*|enum\s+\w*Core\w*' . || true

Repository: GTModpackTeam/GTBeesMatrix

Length of output: 10481


🏁 Script executed:

#!/bin/bash
set -euo pipefail
printf '%s\n' '--- tracked core-plugin declarations and references ---'
python3 - <<'PY'
import subprocess
from pathlib import Path

files = subprocess.check_output(["git", "ls-files"], text=True).splitlines()
terms = ("GTECoreMod", "CoreMod", "IFMLLoadingPlugin", "IClassTransformer", "ClassTransformer")
hits = []
for name in files:
    path = Path(name)
    if not path.is_file():
        continue
    try:
        text = path.read_text(errors="replace")
    except OSError:
        continue
    for term in terms:
        if term in text:
            hits.append((name, term))
print("\n".join(f"{name}: {term}" for name, term in hits) or "no tracked references found")

print("--- tracked Java declarations ---")
for name in files:
    if not name.endswith(".java"):
        continue
    text = Path(name).read_text(errors="replace")
    for line_no, line in enumerate(text.splitlines(), 1):
        if "class " in line or "interface " in line or "enum " in line:
            if "Core" in line or "Transformer" in line:
                print(f"{name}:{line_no}:{line.strip()}")
PY
printf '%s\n' '--- module discovery implementation ---'
sed -n '35,110p' src/main/java/com/github/gtexpert/gtbm/GTBMMod.java
sed -n '370,425p' src/main/java/com/github/gtexpert/gtbm/module/ModuleManager.java

Repository: GTModpackTeam/GTBeesMatrix

Length of output: 6054


🏁 Script executed:

#!/bin/bash
set -euo pipefail
printf '%s\n' '--- core-mod configuration ---'
rg -n -C 3 'coreModClass|IFMLLoadingPlugin|containsMixinsAndOrCoreModOnly|usesMixins' build.gradle buildscript.properties gradle.properties 2>/dev/null || true
printf '%s\n' '--- all tracked source paths under core ---'
git ls-files | grep -E '(^|/)(core|mixins)(/|$)' || true
printf '%s\n' '--- exact CoreMod-related source references ---'
rg -n -C 2 'CoreMod|core mod|coreMod|ASM transformation|bytecode|dependency loading' --glob '!libs/**' --glob '!AGENTS.md' --glob '!CLAUDE.md' .

Repository: GTModpackTeam/GTBeesMatrix

Length of output: 17023


Remove the stale CoreMod entry. The project does not define or configure GTECoreMod. Module discovery uses ASMDataTable, while mixins handle class changes. Describe CoreModule as a module instead of an FML loading plugin.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@AGENTS.md` at line 67, Remove the stale CoreMod entry from the documentation
and update the corresponding CoreModule description to identify it as a module,
not an FML loading plugin; do not reference the nonexistent GTECoreMod or ASM
transformation/dependency-loading behavior.

Source: MCP tools

- **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
```
1 change: 1 addition & 0 deletions CLAUDE.md