Skip to content

Implements the second version of the rail generator.#98

Open
Jasupa wants to merge 3 commits into
mainfrom
railgen-v2
Open

Implements the second version of the rail generator.#98
Jasupa wants to merge 3 commits into
mainfrom
railgen-v2

Conversation

@Jasupa

@Jasupa Jasupa commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Rail Generator v2 with configurable and persistent rail types, reliable parallel-track generation, sleepers, and optional overhead wire infrastructure. Builders can select, create, edit, delete, reload, and browse saved rail types entirely in-game.

What Changed

  • Added persistent custom rail types via rail-types.yml, including schema migration and safe handling of missing, outdated, or invalid data.
  • Added configurable rail blocks, blocks below rails, sleeper blocks and spacing, track count, and individual spacing between parallel tracks.
  • Added support for one to eight parallel tracks while retaining single-track generation.
  • Added aligned parallel paths for straights and curves, rail shape/orientation handling, and overlap detection for unsafe curves.
  • Added sleeper placement along generated tracks.
  • Added optional overhead poles, supports, and simple overhead wires with configurable blocks, spacing, offset, and height.
  • Added a per-rail-type track-switch toggle as an extendable foundation for future switch generation.
  • Added in-game rail type selection, creation, editing, deletion, reloading, searching, and pagination.
  • Added dedicated permissions for generator use, opening the menu, creating, editing, deleting, and generating multiple tracks.
  • Added validation for materials, required settings, track counts, spacings, generated block limits, invalid paths, and overlapping tracks.
  • Generated and validated the complete railway before queuing any block placement through setBlockStatesAtPositions.
  • Added a safe generation envelope around the selected WorldEdit path so parallel tracks and overhead structures are validated without treating the path selection itself as a filled build volume.
  • Made rail type save and delete operations transactional in memory when writing rail-types.yml fails.
  • Cleaned up validation, progress state, clamping, menu interaction, packaging, and static-analysis issues.

Testing

  • Ran ./gradlew.bat clean build successfully.
  • Ran git diff --check successfully.
  • Manually checked the rail type menu flow during implementation:
    • selecting rail types.
    • creating and editing custom rail types.
    • deleting and reloading custom rail types.
    • page navigation and search controls.
    • track count and per-track spacing controls.
    • sleeper spacing and block choices.
    • overhead pole and wire settings.

Full Milanote explanation

https://app.milanote.com/1Wnyov18INZrcn/rail-generator-v2-requirements?p=9H9SRXRJA3f

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Qodana for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@Jasupa Jasupa force-pushed the railgen-v2 branch 6 times, most recently from 8d01487 to ccc8e63 Compare July 11, 2026 20:23
@Jasupa Jasupa requested a review from Zoriot July 11, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant