⛏️ Ansible Crafting¶
Craft from nearby containers without moving items — a client-server Minecraft mod for Fabric, Forge, and NeoForge.
For a user-facing feature overview, see PROJECT.md.
Overview¶
Ansible Crafting scans nearby inventories on the server, syncs the data to the client via custom Fabric-style packets, and renders a side panel on the crafting screen showing all available items. Players can one-click craft recipes using items from remote containers through EMI/REI/JEI recipe viewer integration.
Key Characteristics¶
- Client-server architecture — server handles scanning, state, and crafting; client handles UI, rendering, and caching
- Custom networking — Fabric-style packets only (no HTTP/REST), with Modstitch abstracting loader-specific APIs
- Multi-version, multi-loader — single source tree targeting Fabric, Forge, and NeoForge via Stonecutter + Modstitch
- Persistent state — per-inventory enable/disable toggles saved to world data via
InventoryStateManager
Tech Stack¶
| Component | Technology |
|---|---|
| Language | Java 17/21 (JDK 21 for all builds; --release 17 for 1.20.1 targets) |
| Build System | Gradle with Stonecutter (multi-version) + Modstitch (multi-loader) |
| Mod Loaders | Fabric, Forge, NeoForge |
| Mappings | Mojang + Parchment (ParchmentMC) |
| Configuration | Cloth Config + custom screen builder |
| Recipe Viewers | EMI, REI, JEI (optional integrations) |
| Code Style | Spotless with Palantir Java Format |
| Testing | JUnit 5 + Minecraft GameTest framework |
| CI/CD | GitLab CI/CD (build, test, deploy to Modrinth/CurseForge) |
| Changelog | git-cliff with Conventional Commits |
| License | MPL-2.0 |
Project Structure¶
src/main/java/com/ansiblecrafting/
├── AnsibleCraftingMod.java # Server-side mod entrypoint
├── ServerTickHandler.java # Server tick logic (scanning, syncing)
├── client/
│ ├── AnsibleCraftingClient.java # Client-side mod entrypoint
│ ├── ClientInventoryCache.java # Caches synced inventory data
│ ├── HighlightRenderer.java # Block outline highlights
│ ├── InventoryOverlayRenderer.java# Wifi status overlay icons
│ ├── ShaderCompat.java # Iris/shader detection
│ └── ui/
│ ├── InventoryPanelWidget.java # Side panel UI widget
│ └── InventoryPanelTracker.java# Panel lifecycle management
├── config/
│ ├── ModConfig.java # Config data class + annotations
│ ├── ConfigScreenBuilder.java # Custom Cloth Config screen
│ └── ModMenuIntegration.java # Mod Menu config screen provider
├── crafting/
│ ├── RemoteCraftingHandler.java # Extracts items from remote containers
│ ├── CraftingSessionManager.java # Tracks active crafting sessions
│ ├── CombinedPlayerInventory.java # Merges player + remote inventories
│ └── VirtualInventory.java # Virtual inventory for recipe matching
├── integration/
│ ├── NearbyInventoryHelper.java # Shared helper for recipe viewers
│ ├── emi/ # EMI plugin (transfer + exclusion)
│ ├── rei/ # REI plugin (transfer + exclusion)
│ └── jei/ # JEI plugin (transfer + exclusion)
├── inventory/
│ ├── InventoryScanner.java # Scans nearby blocks for inventories
│ ├── AggregatedInventory.java # Merges inventories into one view
│ ├── InventoryStateManager.java # Persistent enable/disable per inventory
│ ├── InventoryToggleHandler.java # Toggle request handling
│ └── InventoryLookup.java # Block → inventory resolution
├── mixin/
│ ├── CraftingScreenHandlerMixin.java # Server-side crafting hooks
│ ├── AbstractRecipeScreenHandlerMixin.java # Recipe handler hooks
│ └── client/
│ ├── CraftingScreenMixin.java # Client crafting screen hooks
│ └── ContainerScreenMixin.java # Container screen hooks
└── network/
├── NetworkHandler.java # Packet registration
├── InventorySyncPacket.java # Item data → client
├── InventoryStateSyncPacket.java # Enable/disable states → client
├── InventoryToggleRequestPacket.java # Toggle → server
├── RemoteCraftFillRequestPacket.java # Craft fill → server
└── StateResyncRequestPacket.java # Resync request → server
For a detailed architecture diagram with data flows, see the Architecture Overview.
Getting Started¶
Prerequisites¶
| Requirement | Version | Notes |
|---|---|---|
| Java | 21 | All targets compile on JDK 21 |
| Git | 2.x+ | Conventional Commits workflow |
| git-cliff | Latest | Changelog generation (installation) |
Gradle is included via the wrapper — no separate install needed.
Clone and Build¶
git clone https://gitlab.com/starshadow/games/minecraft/ansible-crafting.git
cd ansible-crafting
./gradlew build
Run Development Client¶
Run Tests¶
Format Code¶
For full development setup, multi-version build targets, and Gradle tasks, see the Development Guide.
Multi-Version Build¶
The project uses Stonecutter to compile for multiple Minecraft versions from a single source tree:
| Minecraft | Fabric | Forge | NeoForge |
|---|---|---|---|
| 1.20.1 | ✅ | ✅ | — |
| 1.21.1 | ✅ | — | ✅ |
| 1.21.4 | ✅ | — | ✅ |
Version-specific code uses Stonecutter preprocessor comments:
Build artifacts are output to build/libs/ with loader and version suffixes.
CI/CD¶
The GitLab CI/CD pipeline handles:
- Build — compiles all version/loader combinations
- Test — runs JUnit and GameTest suites
- Deploy — publishes to Modrinth and CurseForge on tagged releases
Pipeline configuration: .gitlab-ci.yml · Full documentation: CI/CD Guide
Documentation¶
| Document | Description |
|---|---|
| Documentation Index | Full documentation map |
| Architecture | Package structure, key classes, data flows |
| Development Guide | Building, testing, Gradle tasks, multi-version |
| Configuration Reference | All mod config options with defaults and ranges |
| CI/CD Pipeline | Pipeline stages, jobs, required variables |
| Release Process | Release scripts, versioning, changelog |
| Shader Compatibility | Shader rendering details |
| Debug Logging | Enabling debug output |
| Guidelines | Code style, testing, conventions |
| Contributing | Contribution workflow |
| Changelog | Release history |
Contributing¶
See CONTRIBUTING.md for the contribution workflow including branch naming, commit conventions, and PR process.
Key commands before committing:
./gradlew build # Compile + license headers
./gradlew test # Run tests
./gradlew spotlessApply # Format code
License¶
Ansible Crafting is licensed under the Mozilla Public License 2.0. See LICENSE for the full text.
- Modifications to existing source files must remain under MPL-2.0
- New files you add can use any license
- Contributors automatically grant license under MPL-2.0 terms (no CLA required)
Author: Ghent Starshadow · Repository: GitLab