Repository navigation
Code Structure
Brennan Hatton edited this page May 4, 2026
·
6 revisions
A visual breakdown of the Java packages and classes that make up the mod.
Base package: games.brennan.dungeontrain
Totals: 206 main classes + 16 test classes across 18 top-level sub-packages.
Generated against the post-NeoForge / Sable port tree (see PR #120). Latest update: Template OOP refactor Phase 3 (PR #155) — *Template static placers renamed to *Placer, Template.*Model records to bare names.
games.brennan.dungeontrain (204 main classes)
│
├── DungeonTrain.java [root mod entrypoint]
│
├── client/ (57) ── UI, HUDs, screens
│ │ DungeonTrainClient · ContainerHotkeyClient · VariantHotkeyClient
│ │ EditorStatusHudOverlay · VariantHoverHudOverlay · VersionHudOverlay
│ │ VersionMenuOverlay · DungeonTrainOptionsScreen · DungeonTrainSettingsScreen
│ │ VersionInfo · PendingWorldChoices
│ │
│ ├── menu/ (26) ── in-world command menu
│ │ │ CommandMenuState/Renderer/Layout/Raycast/InputHandler
│ │ │ CommandMenuToggleHandler · CommandMenuKeyBindings · CommandMenuEntry
│ │ │ CommandRunner · MenuScreen · MainMenuScreen · TrainMenuScreen
│ │ │ CarriagesMenuScreen · EditorMenuScreen · SpeedMenuScreen
│ │ │ EnterCategoryMenuScreen · NewSourcePickerScreen
│ │ │ DebugMenuScreen · WireframesMenuScreen
│ │ │ PrefabNameScreen · PrefabSideTabButton · PrefabTabState
│ │ │ PrefabClientLifecycleEvents · MenuTypingScreen · MenuRenderStates
│ │ │ ConfirmScreen
│ │ │
│ │ ├── blockvariant/ (7) BlockVariantMenu(+ Renderer/Raycast/Input/Wireframe/SearchScreen/LockIdRenderer)
│ │ ├── containercontents/ (5) ContainerContentsMenu(+ Renderer/Raycast/Input/SearchScreen)
│ │ └── parts/ (5) PartPositionMenu(+ Renderer/Raycast/Input/SearchScreen)
│ │
│ ├── tooltip/ (3) PrefabIconsClientTooltipComponent · PrefabIconsTooltipData · PrefabTooltipEvents
│ └── worldgen/ (2) FloorYState · PendingStartingDimension
│
├── command/ (5) ── /slash commands
│ DebugCommand · EditorCommand · ResetCommand · SaveCommand · TrainCommand
│
├── config/ (1) DungeonTrainConfig
├── debug/ (2) CarriageDebug · DebugFlags
├── item/ (1) VariantClipboardItem
├── util/ (1) BundledNbtScanner
│
├── editor/ (44) ── live in-world editing
│ CarriageEditor · CarriagePartEditor · CarriageContentsEditor
│ TrackEditor · TunnelEditor · PillarEditor · EditorLayout
│ EditorCategory · EditorDevMode
│ CarriageTemplateStore · CarriagePartTemplateStore · TrackTemplateStore
│ TunnelTemplateStore · PillarTemplateStore · ContainerContentsStore
│ LootPrefabStore · BlockVariantPrefabStore · CarriageContentsStore
│ CarriagePartRegistry · CarriageVariantPartsStore
│ CarriageVariantBlocks · CarriageContentsVariantBlocks · CarriagePartVariantBlocks
│ VariantState · VariantRotation · VariantHotkeyState · VariantOverlayRenderer
│ VariantEditorPreviewState · VariantEditorPreviewTicker · VariantBlockInteractions
│ VariantBlockBreakHandler · RotationApplier · VasePotLootDrop
│ ContainerContentsEntry · ContainerContentsPlacement · ContainerContentsPool
│ ContainerContentsRoller · ContainerHotkeyState
│ BlockVariantMenuController · ContainerContentsMenuController · PartPositionMenuController
│ BlockVariantPlot · TrackPlotLocator · TrackSidePlots
│
├── event/ (8) ── NeoForge event handlers
│ PlayerJoinEvents · WorldLifecycleEvents · TrainBootstrapEvents · TrainTickEvents
│ TrackChunkEvents · CorridorCleanupEvents
│ CommandEvents · PrefabUseHandler
│
├── mixin/ (10) ── ASM mixins
│ │ CreateWorldScreenMixin · CreateWorldScreenAccessor · CreateWorldScreenWorldTabMixin
│ │ PlayerFudgeSpawnMixin · DecoratedPotBlockEntityPotLootMixin
│ └── client/ (5) CreateWorldScreenMixin · CreateWorldScreenDefaultPresetMixin
│ AbstractContainerScreenPrefabTintMixin
│ CreativeModeInventoryScreenAccessor · CreativeModeInventoryScreenPrefabMixin
│
├── net/ (20) ── client/server packets
│ DungeonTrainNet
│ BlockVariantEditPacket · BlockVariantSyncPacket · BlockVariantOutlinePacket
│ BlockVariantMenuTogglePacket · BlockVariantLockIdsPacket
│ ContainerContentsEditPacket · ContainerContentsSyncPacket · ContainerContentsMenuTogglePacket
│ ContainerHotkeyPacket
│ PartAssignmentEditPacket · PartAssignmentSyncPacket · PartMenuTogglePacket
│ VariantHotkeyPacket · VariantHoverPacket
│ CarriageIndexPacket · EditorStatusPacket · PrefabRegistrySyncPacket
│ SaveBlockVariantPrefabPacket · SaveLootPrefabPacket
│
├── registry/ (2) ModItems · ModCreativeTabs
│
├── template/ (11) ── unified template-identity + persistence layer (Phases 1–3)
│ Template · TemplateKind · TemplateType
│ TemplateRegistry · TemplateStore · SaveResult · Stores
│ PillarTemplateId · StairsTemplateId · TunnelTemplateId · CarriagePartTemplateId
│ Sealed `Template` interface permits 7 records — Carriage, Contents, Part,
│ Track, Pillar, Adjunct, Tunnel — each carrying capability metadata (kind,
│ type, isBuiltin, canPromote), persistence handles (store, registry), and
│ Phase-3 dispatch methods (weight, variantName, restampPlot, hasBundledTier,
│ bundled, editorPlotOrigin, eraseEditorPlot). The 6 type-discriminator
│ enums elsewhere in the tree (CarriageType, ContentsType, CarriagePartKind,
│ PillarSection, PillarAdjunct, TunnelVariant) implement `TemplateType`.
│ Phase 2 added the generic `TemplateRegistry<T>` / `TemplateStore<T>`
│ interfaces and collapsed `SaveCommand`'s per-kind `instanceof` dispatch
│ onto `template.store().save / .promote`. Phase 3 added the 4 identifier
│ records (storage-layer surface only), renamed records + static placers to
│ free the `*Template` namespace, and collapsed the remaining 12-arm chains
│ in `VariantOverlayRenderer` and `ResetCommand` —
│ see [Feature Template Refactor](Feature-Template-Refactor.md).
│
├── ship/ (9) ── VS2 → Sable port abstraction
│ │ ManagedShip · Shipyard · Shipyards · KinematicDriver
│ │ ShipFilterProcessor · InertiaSnapshot
│ └── sable/ (3) SableManagedShip · SableShipyard · SableKinematicTicker
│
├── track/ (11) ── track generation
│ │ TrackGenerator · TrackGeometry · TrackPlacer · TrackPalette
│ │ PillarSection · PillarAdjunct
│ └── variant/ (4) TrackKind · TrackVariantRegistry · TrackVariantStore · TrackVariantBlocks · TrackVariantWeights
│
├── train/ (20) ── train assembly + carriages
│ Trains · TrainAssembler · TrainCarriageAppender · TrainTransformProvider
│ CarriagePlacer · CarriageVariant · CarriageVariantRegistry
│ CarriageContents · CarriageContentsPlacer · CarriageContentsRegistry · CarriageContentsWeights
│ CarriagePartPlacer · CarriagePartAssignment · CarriagePartKind
│ CarriageDims · CarriageFootprint · CarriageWeights
│ CarriageGenerationConfig · CarriageGenerationMode · CarriagePersistenceStore
│
├── tunnel/ (5) TunnelGenerator · TunnelGeometry · TunnelPlacer · TunnelPalette · LegacyTunnelPaint
│
├── world/ (3) DungeonTrainWorldData · StairsRegistryData · StartingDimension
│
└── worldgen/ (3) SilentBlockOps
└── feature/ (2) ModFeatures · TrackBedFeature
| Domain | Packages | Classes |
|---|---|---|
| Client / UI (HUDs, screens, menus) | client/* |
57 |
| Editor (variants, templates, content) | editor/ |
44 |
| Template identity + persistence (Phases 1–3) | template/ |
11 |
| Networking (packets) | net/ |
20 |
| Train logic (carriages, assembly) | train/ |
20 |
| Track generation | track/* |
11 |
| Mixins (ASM patches) | mixin/* |
10 |
| Ship abstraction (VS2 → Sable) | ship/* |
9 |
| NeoForge events | event/ |
9 |
| Tunnels | tunnel/ |
5 |
| Commands | command/ |
5 |
| World / data / worldgen |
world/, worldgen/*
|
6 |
| Mod plumbing (entry, config, registry, item, debug, util) | root + various | 7 |
The two heaviest packages are client/ (57 — UI surface) and editor/ (45 — the live in-world editing system). The ship/ package is the abstraction layer introduced in the recent VS2 → Sable port, with ship/sable/ being the new backend.
client/menu/ EditorMenuScreenTest
editor/ CarriagePartEditorPlotLayoutTest · CarriageVariantBlocksTest
CarriageVariantBlocksWeightedTest · EditorCategoryTest
VariantEditorPreviewStateTest · VariantEditorPreviewTickerMathTest · VariantRotationTest
template/ TemplateTest
net/ EditorStatusPacketTest
train/ CarriageContentsRegistryTest · CarriageContentsWeightsTest · CarriagePlacerTest
CarriageWeightsTest · TrainCarriageAppenderTest · TrainTransformProviderTest
- Development — build & run instructions
- Features — what each gameplay package surfaces in-game
- Compatibility — Valkyrien Skies / Sable interactions