How alex3025/useful-additions works
Project type and purpose
• This is a Minecraft Forge mod—an extension/plugin for the Minecraft game engine.
• Its purpose is to introduce new blocks, machines, items, GUIs and related logic (“Useful Additions”) to make in-game tasks easier.
File structure
• Entry point: com/rgbcraft/usefuladditions/UsefulAdditions.java
• Packages group by responsibility:
– api: shared interfaces and registries for blocks/items
– blocks, items, liquids: domain objects
– tiles: tile-entity implementations (stateful machines)
– containers + guis: server-side inventories and client-side screens (MVC pattern)
– renderers, models, assets: client rendering pipeline
– network: custom packet dispatch and sync
– handlers: event-bus subscribers (config, recipes, world gen, GUI, sounds, achievements)
– proxies: CommonProxy vs ClientProxy (proxy pattern for side-specific code)
– compat: integration adapters for Buildcraft, GregTech
– utils: shared helper classes
• Build/deployment hints: mcmod.info, .gitignore, GitHub workflows
README for additional insights
• Confirms project goal (“Useful things and machines”)
• Roadmap link and credits—no impact on architecture
a. Main components
– Minecraft Engine (Forge)
– UsefulAdditions Mod Core (mod entry, lifecycle hooks)
– Side-Specific Proxies (CommonProxy, ClientProxy)
– Event Handlers (ConfigHandler, RecipesHandler, WorldGenHandler, etc.)
– Registry Modules (Blocks.java, Items.java, Liquids.java)
– Tile Entities (machines, e.g., TileOsmosisGenerator)
– Container & GUI Layer (ContainerBase ↔ Gui classes)
– Network Layer (NetworkHandler, INetworkMember)
– Rendering Layer (RenderSmartSafe, models, textures)
– Compatibility Adapters (BuildcraftCompat, GregTechCompat)
– Assets (textures, GUIs, models)
b. Relationships and interactions
– On startup, the Mod Core uses Forge’s event bus to register blocks/items/liquids via registry modules
– Handlers subscribe to preInit, init, postInit events to set up configs, recipes, world generation
– Proxy pattern directs rendering (client only) vs logic (common) into proper side
– Tile Entities hold machine state; Container classes expose inventories to GUIs
– GUI components communicate user actions back to server via NetworkHandler packets
– Compatibility adapters hook into the same lifecycle after core registration
– Assets (located under assets/) are loaded by Forge’s resource manager when needed
c. Architectural patterns and design principles
– Proxy Pattern: separate client-only and common logic
– Event-Driven Architecture: handlers register to Forge event bus
– MVC for GUIs: tile entity = model, container = controller, GUI = view
– Component Registry: central registries for blocks/items/liquids
– Extensibility Points: api package and compat adapters
d. Relevant technologies, frameworks, or libraries
– Java 8+
– Minecraft Forge API
– Gradle (implied by standard Forge project layout)
– GitHub Actions (code scanning via codeql-analysis.yml)
– Third-party mod APIs (Buildcraft, GregTech)
Detail
• Lifecycle hooks and message paths.
• Don’t over-abstract—show the raw components (blocks, items, tiles, GUIs, assets, network) and how they connect.