Overview#
CoFHLib (CoFH Common Library) is a critical technical component for Minecraft modding. Developed by TeamCoFH, it serves as a shared repository of code, interfaces, and APIs designed to prevent "reinventing the wheel" across multiple mods. While it does not add player-facing content like mobs or biomes directly to the creative menu, it provides the underlying logic for energy management, fluid handling, and item interactions used by millions of players.
By centralizing essential functions, CoFHLib reduces the memory footprint (PermGen space) of large modpacks and ensures that different mods can communicate seamlessly. It is most famous for housing the Redstone Flux (RF) API, which became the industry standard for power systems in the 1.7.10 era.
Redstone Flux (RF) API#
The Redstone Flux (RF) system is the primary mechanic managed by CoFHLib. It is a standardized energy system used to power machines, tools, and armor. CoFHLib defines how this energy is stored, transmitted, and consumed.
Energy Mechanics
- Generation: Defined through interfaces that allow blocks (like Dynamos) to produce energy from fuel.
- Storage: Provides the logic for internal buffers in machines and portable storage items like Flux Capacitors.
- Transmission: Manages the rules for how energy moves through cables (Fluxducts) or wireless transmitters (Tesseracts).
| Feature | Description |
|---|---|
| Standard Unit | Redstone Flux (RF) |
| Transfer Rate | Defined by the specific cable or machine interface |
| Loss Mechanics | Typically 0% loss over distance (depending on implementation) |
| Compatibility | Native support for all TeamCoFH mods and hundreds of third-party mods |
Technical Mechanics#
As a library, CoFHLib handles complex backend operations that ensure game stability and performance.
- Fluid Handling: Provides a robust framework for transporting liquids (like Steam, Enderium, or Lava) through ducts and storing them in tanks.
- Inventory Management: Standardizes how machines pull items from adjacent chests or eject them into pipes.
- Packet Handling: Manages the communication between the server and the client to ensure that machine progress bars and energy levels update accurately in the GUI.
- Augment System: Defines the logic for "Augments," which are plug-in modules that upgrade machine speed, efficiency, or output.
Mod Integration & Dependencies#
CoFHLib is a mandatory requirement for the following 1.7.10 mods. Without it, these mods will fail to load or crash upon startup:
- Thermal Expansion: The primary tech mod utilizing the RF API and machine frameworks.
- Thermal Foundation: Provides the ores, ingots, and fluids that the library manages.
- Thermal Dynamics: Uses the transport APIs for item, fluid, and energy ducts.
- Redstone Arsenal: Implements the RF-powered tool and armor interfaces.
- Vanilla+ Satchels: Utilizes the shared inventory and NBT storage code for portable storage.
Note: In many versions of CoFH Core 1.7.10, CoFHLib is bundled inside the Core jar file, meaning a separate download is not always necessary if CoFH Core is present.
Update History & Maintenance#
CoFHLib received consistent updates throughout the 1.7.10 lifecycle to maintain compatibility with evolving Forge versions and third-party mods.
May 25 Updates
On May 25, 2019, a significant maintenance update was released for the entire CoFH suite. For CoFHLib, this included:
- Bugfixes: Resolved minor issues with energy synchronization in multiplayer.
- Tweaks: Improved the efficiency of fluid transport logic.
- Vanilla+ Integration: Added support for the Void Satchel, a specialized storage item that automatically destroys items placed inside it, useful for automated mining setups.
- Refactors: Internal code cleanup to improve compatibility with late-stage 1.7.10 modpacks.