Skip to content

Rail generator v1#86

Open
Jasupa wants to merge 5 commits intomainfrom
rail-generator
Open

Rail generator v1#86
Jasupa wants to merge 5 commits intomainfrom
rail-generator

Conversation

@Jasupa
Copy link
Copy Markdown
Contributor

@Jasupa Jasupa commented Apr 30, 2026

No description provided.

Jasupa added 4 commits April 26, 2026 17:42
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
@Jasupa Jasupa requested review from MineFact, Zoriot and kyanvde April 30, 2026 19:53
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

Qodana for JVM

6 new problems were found

Inspection name Severity Problems
Lombok @Getter may be used 🔶 Warning 2
Call to 'printStackTrace()' 🔶 Warning 2
Constant values 🔶 Warning 1
Deprecated API usage 🔶 Warning 1

💡 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 [email protected]

Comment on lines +309 to +311
return a.getBlockX() == b.getBlockX()
&& a.getBlockY() == b.getBlockY()
&& a.getBlockZ() == b.getBlockZ();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +302 to +304
Math.round(vector.getX()),
Math.round(vector.getY()),
Math.round(vector.getZ())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not Vector#getBlockX() etc. like below?

@Override
public boolean checkForPlayer(Player p) {
return !GeneratorUtils.checkForNoWorldEditSelection(p);
public boolean checkForPlayer(Player player) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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.

2 participants