A modern technology framework for Minecraft servers, providing modular systems for energy, fluids, machines, and automation.
Foundry is a comprehensive technology framework designed for Minecraft plugin developers. It provides a capability-based architecture for creating industrial-style content with energy systems, fluid handling, complex machines, and automation networks.
- Capability-Driven: Machines declare what they can do, not what they are. Query capabilities at runtime without hard dependencies.
- Type-Safe: Strong typing throughout the API prevents runtime errors and enables IDE assistance.
- Modular Design: Use only the modules you need. Each system is independent yet interoperable.
- Performance-First: Efficient tick handling, lazy evaluation, and async-ready architecture.
- Developer-Friendly: Annotation-based registration, sensible defaults, and comprehensive documentation.
Public API surface. Defines core interfaces, annotations, and contracts that all other modules implement.
- Registry system with lifecycle management
- Capability framework for extensible behaviors
- Physical unit system (energy, fluids, temperature, pressure)
- Type-safe identifiers and keys
Framework implementation and runtime engine.
- Registry lifecycle orchestration
- Annotation processor for auto-registration
- Event system and hook points
- Plugin integration layer
Shared utilities and data structures used across modules.
- Common data types and constants
- Serialization/deserialization utilities
- Math and geometry helpers
- Logging and debugging tools
Custom block system with state management.
- Block definition and registration
- Block state persistence
- Block entity management
- Custom block interactions
Energy generation, storage, and distribution.
- Energy handlers and storage implementations
- Unit conversion (EU, RF, J, FE)
- Energy network routing
- Power generation and consumption APIs
Fluid handling and tank systems.
- Fluid handlers and tank implementations
- Fluid stack management
- Pipe networks and flow simulation
- Temperature-aware fluid properties
Tick-based machine infrastructure.
- Machine lifecycle management
- Tick scheduling and optimization
- Progress tracking and state machines
- Multi-block structure support
GUI system for machine interfaces.
- Declarative GUI builder
- Slot management and validation
- Progress bars and status displays
- Client-server synchronization
Recipe system for processing machines.
- Recipe definition and matching
- Recipe registry and lookup
- Shapeless and shaped patterns
- Custom recipe types
Item and inventory management.
- Item handler implementations
- Slot-based inventory abstractions
- Directional item routing
- Filter and sorting systems
Network communication layer.
- Packet system for client-server sync
- Capability network propagation
- Chunk-aware network segmentation
- Bandwidth optimization
Custom entity support for machines.
- Entity-based machines (minecarts, drones)
- Mobile capability providers
- Entity persistence
- Pathfinding integration
Folia (multi-threaded server) compatibility layer.
- Region-aware scheduling
- Thread-safe capability access
- Entity/block region checks
- Fallback for non-Folia servers
Platform abstraction for Bukkit/Paper/Spigot variants.
- Platform detection and adaptation
- Version-specific NMS bridges
- Fallback implementations
- Feature flag system
Add Foundry to your plugin:
Gradle (Kotlin DSL)
repositories {
maven("https://maven.pkg.github.com/ian171/Foundry") {
credentials {
username = project.findProperty("gpr.user") as String?
password = project.findProperty("gpr.token") as String?
}
}
}
dependencies {
compileOnly("io.github.ian171:foundry:0.0.1.2-SNAPSHOT")
}plugin.yml
depend: [Foundry]@Foundry(namespace = "myplugin", id = "coal_generator")
@FoundryBlock(material = Material.NOTE_BLOCK, isMachine = true)
@FoundryMachine(tickInterval = 20)
public class CoalGenerator implements CapabilityProvider {
private final EnergyStorage energy = new SimpleEnergyStorage(10000);
public void tick() {
if (hasFuel()) {
energy.insert(100.0, false); // Generate 100 EU/second
}
}
@Override
public <T extends Capability> Optional<T> getCapability(
CapabilityKey<T> key, Direction side
) {
if (key == FoundryCapabilities.ENERGY) {
return Optional.of(key.getType().cast(energy));
}
return Optional.empty();
}
@Override
public Set<CapabilityKey<?>> getCapabilities() {
return Set.of(FoundryCapabilities.ENERGY);
}
}- API Guide - Complete API documentation
- Examples - Working example projects
- Registry System - Understanding the registry
- Development Plan - Roadmap and architecture
./gradlew buildOutput: build/libs/Foundry-<version>.jar
- Java 21+
- Paper 1.21+ (Spigot/Bukkit compatible)
- Gradle 8.5+ (for development)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Follow existing code style
- Add tests for new functionality
- Submit a pull request
Foundry is licensed under the GNU General Public License v3.0.
This allows you to:
- Use Foundry in your plugins (including commercial ones)
- Modify and distribute modified versions
- Must disclose source code of modifications
- Must use GPL v3 for derivative works
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Foundry - Build industrial automation in Minecraft, the right way.