Rail generator v1#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 JVMIt 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 Contact Qodana teamContact us at qodana-support@jetbrains.com
|
| return a.getBlockX() == b.getBlockX() | ||
| && a.getBlockY() == b.getBlockY() | ||
| && a.getBlockZ() == b.getBlockZ(); |
There was a problem hiding this comment.
Have you tried Vector#equals()? This would clear up the code a bit. But i am not sure if it will work due to it comparing the floats and not the blocks.
| Math.round(vector.getX()), | ||
| Math.round(vector.getY()), | ||
| Math.round(vector.getZ()) |
There was a problem hiding this comment.
Why not Vector#getBlockX() etc. like below?
| @Override | ||
| public boolean checkForPlayer(Player p) { | ||
| return !GeneratorUtils.checkForNoWorldEditSelection(p); | ||
| public boolean checkForPlayer(Player player) { |
There was a problem hiding this comment.
Method name doesnt really correspond to what is checked inside
- 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.
No description provided.