How george8188625/create-diesel-generators works
1. Project shape
This is a Minecraft Forge mod, create-diesel-generators, built as an extension to the Create mod. The architecture is split between Java source in src/main/java, hand-authored runtime resources in src/main/resources, and generated assets/data in src/generated/resources.
2. Mod entry and bootstrap
CreateDieselGenerators is the main mod entry point. Startup is organized through a small set of central bootstrap classes: CDGRegistries, CDGBlocks, CDGItems, CDGFluids, CDGBlockEntityTypes, CDGMenuTypes, CDGRecipes, CDGSoundEvents, CDGTags, CDGCreativeTab, and related registries. These act as the wiring layer between the mod lifecycle and the content packages.
3. Core content domains
The codebase is organized by gameplay feature under content/. Major domains are:
• oil extraction: pumpjack, oil chunks, oil barrel
• fuel processing: distillation, fermentation, biodiesel/ethanol/gasoline
• power generation: diesel engines in normal, modular, huge variants
• utility blocks/tools: burner, canister, lighter, hammer, wire cutters, oil scanner, chemical sprayer, entity filter
• construction blocks: asphalt, chip wood, sheet metal, concrete-encased pipes, andesite girder
Each domain typically owns its block, block entity, renderer, item, recipe, and behavior classes.
4. Block/entity/renderer pattern
Most interactive blocks follow the same three-layer model: a block class for world interaction, a block entity for stateful logic/storage, and a renderer for visuals. Examples include DieselEngineBlock/DieselEngineBlockEntity/DieselEngineRenderer, DistillationTankBlock/DistillationTankBlockEntity/DistillationTankRenderer, and PumpjackBearingBlock/PumpjackBearingBlockEntity/PumpjackCrankRenderer. This is the main runtime boundary between gameplay logic and presentation.
5. Machine and fluid processing pipeline
The primary gameplay flow is oil and fuel processing:
• oil is discovered/extracted via oil chunk data and pumpjack machinery
• crude oil is stored/transferred through barrels and tanks
• distillation and fermentation convert inputs into fuels and intermediates
• final fuels are exposed through Forge fluid tags and fuel_type definitions
This means the mod’s data flow is mostly item/fluid transformation through block entities and custom recipes, not a general-purpose automation framework.
6. Create integration as the main dependency boundary
The mod leans heavily on Create concepts: contraption movement, kinetic shafts, ponder scenes, custom recipes, and mechanical crafting. Classes like DieselEngineMovementBehaviour, PumpjackHeadMovementBehaviour, and PumpjackBearingBMovementBehaviour show that some blocks can move as contraptions or participate in Create’s moving machinery model. There are also Create-specific behaviors such as CTBehavior classes and custom partial models/sprite shifts.
7. Recipe and data-driven gameplay
A large portion of behavior is data-driven under src/main/resources/data/createdieselgenerators. This includes crafting, mixing, distillation, fermentation, crushing, cutting, hammering, wire cutting, mechanical crafting, and compat recipes. The generated resources in src/generated/resources mirror blockstates, loot tables, models, and tags, indicating the mod relies on datagen rather than hand-maintaining all JSON assets.
8. Compatibility subsystem
Compat is isolated under compat/ and behaves like a set of optional adapters:
• jei provides recipe categories and animated UI entries for JEI
• computercraft exposes peripherals/behaviors for programmable control
• kubejs exposes script hooks like fuel types, molds, lighter skins, and chunk oil amounts
• EveryCompatCompat bridges with EveryCompat
This layer is intentionally separate from core gameplay so the mod can degrade gracefully when integrations are absent.
9. Client/UI-specific code
Client-facing logic is split into renderers, model helpers, and screen/menu classes. Examples include EntityFilterScreen, EntityFilterMenu, multiple item/block renderers, CDGPartialModels, and CDGSpriteShifts. The repo also contains many custom model JSONs for animated machinery, suggesting the visual system is heavily asset-driven with code mainly selecting states and animation variants.
10. Ponder documentation content
ponder/ contains scripted showcase scenes used by Create’s in-game tutorial system. These are backed by .nbt scene assets in resources. This is a separate “documentation/runtime demo” subsystem: it does not drive gameplay logic, but it explains machine setup and flow in-game.
11. World state and generation
The mod persists oil chunk information in world/OilChunksSavedData.java and supplies worldgen tags for oil-biome selection and oil deposits. There is also a structure file for oil chunks. This indicates a small persistent world-state layer supporting oil resource discovery rather than broad terrain generation.
12. Networking and command/event hooks
packets/ contains mod networking for client-server synchronization, such as entity filter screen updates. commands/ adds admin/debug commands. events/ holds Forge lifecycle hooks that connect registration, config, and runtime behaviors. These are the glue layers for syncing state and reacting to game events.
13. Mixins as targeted engine patches
mixins/ and mixin_interfaces/ are used for surgical modification of Minecraft/Create behavior where extension points are not enough. The presence of accessors, invokers, and mixins for contraptions, loot tables, creepers, render models, and shaft behavior shows the mod modifies base mechanics at the framework boundary rather than reimplementing them.
14. Assets and generated outputs
The repository contains extensive textures, models, blockstates, language files, sounds, and tags. The generated tree under src/generated/resources is effectively the output of the mod’s datagen pipeline, while src/main/resources contains the curated runtime assets and pack metadata. This separation is important for diagramming: Java code defines behavior, resources define content, and generated assets fill in the bulk of the registration surface.
15. Overall architectural shape
At a high level, this is a content-heavy mod built around a small set of industrial systems: oil extraction, refining, fuel consumption, and Create-style mechanical integration. The architecture is modular by feature, with each feature owning its own block/entity/recipe/rendering stack, while compatibility, networking, ponder, and datagen are isolated cross-cutting subsystems.
Main entry points: content Content packs · createdieselgenerators Hooks · resources Main assets · compat Compat layer
Components 17
Java code
Main mod code, runtime systems, content, integrations, and hooks.
- Main mod · Forge mod entrypoint and lifecycle bootstrap.
src/main/java/com/jesz/createdieselgenerators/CreateDieselGenerators.java - Registries · Central registration layer for blocks, items, fluids, entities, menus, recipes, sounds, tags, and creative tab.
src/main/java/com/jesz/createdieselgenerators/CDGRegistries.java - Content packs · Feature-owned blocks, items, block entities, renderers, and behaviors for machines, tools, and construction blocks.
src/main/java/com/jesz/createdieselgenerators/content - Pumpjack · Oil discovery and extraction machinery, including bearing, crank, head, hole, and world oil amount display.
src/main/java/com/jesz/createdieselgenerators/content/pumpjack - Distillation · Crude-oil refining tower, controller, recipes, and visual/model support.
src/main/java/com/jesz/createdieselgenerators/content/distillation - Fermenting · Basin and bulk fermentation machines plus recipes and Create transfer behaviors.
src/main/java/com/jesz/createdieselgenerators/content/bulk_fermenter - Diesel engines · Normal, modular, and huge engine variants plus upgrades, sounds, and movement behavior.
src/main/java/com/jesz/createdieselgenerators/content/diesel_engine - Fluid storage · Oil barrel, canister, concrete-encased pipes, and fluid-coupling blocks for moving liquids.
src/main/java/com/jesz/createdieselgenerators/content/oil_barrel - Tools · Fueled and specialized items such as lighter, hammer, wire cutters, oil scanner, and chemical sprayer.
src/main/java/com/jesz/createdieselgenerators/content/tools - Construction · Asphalt, chip wood, sheet metal, and girder building materials that extend the industrial palette.
src/main/java/com/jesz/createdieselgenerators/content - Compat layer · Integration modules for JEI, ComputerCraft, KubeJS, and EveryCompat.
src/main/java/com/jesz/createdieselgenerators/compat - Ponder · Create tutorial scenes and showcase scripts for the main machines and flows.
src/main/java/com/jesz/createdieselgenerators/ponder - Hooks · Commands, Forge events, networking, and targeted mixins that bridge mod systems with game/runtime behavior.
src/main/java/com/jesz/createdieselgenerators - World data · Saved oil chunk data and resource-selection world state for oil deposits.
src/main/java/com/jesz/createdieselgenerators/world - Datagen · Data generation entrypoint for models, blockstates, loot, recipes, and tags.
src/main/java/com/jesz/createdieselgenerators/datagen/CDGDatagen.java
Resources
Hand-authored and generated assets, recipes, tags, and documentation content.
- Main assets · Curated runtime JSON, textures, sounds, tutorials, and data-driven recipes/tags.
src/main/resources - Generated assets · Generated blockstates, models, loot tables, language files, and tags.
src/generated/resources
Connections 21
- Main mod → Registries: bootstraps · Main mod initialization delegates to the registration layer.
- Registries → Content packs: registers · Central registries expose the content subsystems to Forge/Create.
- Content packs → Pumpjack: includes · Oil extraction feature package.
- Content packs → Distillation: includes · Refining feature package.
- Content packs → Fermenting: includes · Fermentation feature package.
- Content packs → Diesel engines: includes · Engine power-generation package.
- Content packs → Fluid storage: includes · Liquid handling and storage package.
- Content packs → Tools: includes · Utility item package.
- Content packs → Construction: includes · Architectural/building-material package.
- Content packs → Ponder: documents · In-game tutorial scenes explain core machines.
- Content packs → Compat layer: adapts · Optional integrations extend core gameplay and UI.
- Content packs → World data: persists · Oil discovery and deposit state is stored in world data.
- Content packs → Hooks: depends on · Content relies on mixins, packets, commands, and events for glue.
- Content packs → Datagen: drives · Content definitions feed the datagen pipeline.
- Datagen → Generated assets: writes · Datagen produces the generated resource tree.
- Main assets → Content packs: describes · Runtime JSON assets define recipes, tags, models, sounds, and tutorial scenes.
- Main assets → Ponder: stores scenes · Ponder runtime demos are backed by resource NBT scenes.
- Compat layer → Main assets: ships assets · Compatibility-specific resource overrides and textures are packaged in main resources.
- Hooks → Pumpjack: supports · Contraption movement, packet sync, and behavior patches support machine runtime.
- Hooks → Diesel engines: supports · Movement behaviors and engine-specific hooks support running machinery.
- Hooks → Compat layer: gates · Optional adapters are activated through runtime hooks and platform checks.