Add initial rail generator implementation#86
Conversation
feature: added a first version for the convex rail generator
- Added a railway generator entry to the generator menu - Made railway documentation links clickable in chat - Added RailSelectionPointReader for cuboid, polygonal, and convex selections - Validated supported rail selections before generation - Added RailPath and RailPathBuilder for center path generation - Moved center path generation out of RailScripts - Kept RailScripts focused on generation flow and placement
- Improved path handling for curves, diagonals, gaps, and direction changes - Added side block builder for railway side/anvil placement - Added orientation resolver for side block facing - Added RailBlockPlacement and RailBlockRole placement model - Added RailType interface and SampleRailType implementation - Moved block data creation into the rail type system - Added WorldEdit/Bukkit placement handler for rail generation - Refactored RailScripts into an orchestration flow
Qodana for JVM6 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
- Normalised vectors before comparing block positions - Used Vector#getBlockX/Y/Z instead of manual rounding - Moved rail validation logic into hasValidRailSelection - Kept checkForPlayer aligned with the generator component contract - Improved readability of rail path and selection validation code
- Added path, side block and placement builders - Added validation for unsupported, too small and too large selections - Used Bukkit scheduler for safer async generation flow - Fixed rail help command so it does not start generation - Fixed copied rail command to use /gen rail - Removed lane support from v1 scope - Fixed rail undo history for repeated generation on the same selection - Skipped unchanged blocks to avoid unnecessary undo entries
MineFact
left a comment
There was a problem hiding this comment.
Your current RailScript does not use the already existing Generator Library at all. AI basically tried to reinvent everything from scratch adding boilerplate code for every action that its currently trying to achieve. For this simple rail track this might work ok but as soon as it will get more complex this will create lots of issues and duplicated code. Please implement the rail generator the same way the road or house generator is implemented. If you can't do this yourself tell AI to first explore the repository and understand how the other generators are working. I can't accept this PR in this current state.
- Made sure the existing Generator Library is used directly for the rail generator instead of making my own one. feature: - The rail generator now generators slower 'async' to make sure it doesn't overload servers.
- Made sure the existing Generator Library from alplibs is used directly for the rail generator where possible feature: - The rail generator now uses real worldedit commands and is thus much smoother and faster. - The path curves are way smoother instead of blocky.
- Rail generator side block placement
Zoriot
left a comment
There was a problem hiding this comment.
Generally it works. Sometimes it generates nothing for part's also it's in the air where it shouldn't be. The User feedback is bad, you put in the cmd, it waits for some seconds and then pastes everything at once, no feedback at all at start.
It currently doesn't check if you are in the right mode. (In that case at least for cyl the error message Rail Generator needs at least two points is outputted twice).
I don't see where more rail types or other gen features can be easily added. It would be nice to have at least one settings so that's also considered.
There is also no menu. Please also link the requirements milanote in the pr.
Please also take the comments from Nudelsuppe into consideration.
Count position block changes by placement count, use persistent data for internal generator commands, remove unused rail flag handling and the unused help overload, restore the field menu flow, and simplify rail path point handling.
Apply documentation click events to the full message, use shared command argument handling for rail, rename the rail generator enum, use generator error messages on failures, and extract history entry and block change models.
Replace player metadata with an internal command queue, use the non-deprecated WorldEdit setBlock overload, combine duplicate catch handling, run rail generation through the Bukkit scheduler, and keep history models extracted.
Use a clearer WorldEdit selection check, send rail errors with Adventure components, document missing control point heights, and note that the old RailPathBuilder block comparison code no longer exists.
- validate rail selections before generation - add rail type settings and menu flow - place rail blocks on terrain surface per column - fix missing side anvils and anvil facing in rail corners - use Alps-Lib block placement helper
Summary
Adds an initial implementation of the rail generator and re-enables
/gen rail.Changes
Milanote
https://app.milanote.com/1WgUAs1mA492a6?p=9H9SRXRJA3f