Skip to content

Fix: Align shaft rotation with large cogwheel offset#24

Open
Apostrcfo2 wants to merge 37 commits into
Gordon-Frohman:mainfrom
Apostrcfo2:main
Open

Fix: Align shaft rotation with large cogwheel offset#24
Apostrcfo2 wants to merge 37 commits into
Gordon-Frohman:mainfrom
Apostrcfo2:main

Conversation

@Apostrcfo2
Copy link
Copy Markdown
Contributor

Description

This PR fixes a visual misalignment where the shaft did not follow the rotation/tilt of the Large Cogwheel when a phase offset was applied for tooth alignment.

The Issue

In the original code, the shaft's rotation was set before the large cogwheel's offset check. When the large cogwheel applied its Math.PI / 16F (11.25°) adjustment to align with other gears, the shaft remained at the base rotation, causing it to look "straight" while the gear looked "tilted".

The Solution

The rendering logic in CogWheelTileEntityRenderer.java was reorganized so that the final angle calculation (including the offset) happens before assigning it to the models. Now, both the ShaftModel and the LargeCogWheelModel receive the same processed rotation value, ensuring perfect visual synchronization.

Changes

  • Reordered rotation assignment logic in CogWheelTileEntityRenderer.java.
  • Guaranteed that the shaft follows the adjusted angle when rendered with a Large Cogwheel.

References

Media Comparison

Before After (1) After (2)
Before After 1 After 2

Finally!
This took way longer than it should have lol.

Apostrcfo2 and others added 30 commits April 25, 2026 21:13
This reverts commit 6a61706.
I prefer this option enabled, since it makes the code easier to read. To prevent building task from crashing - just run 'verification/spotlessApply' before 'build'
Original image was obviously AI-generated, but after some adjustments it looks much better
And the contour is actually round now
The large cogwheel was not meshing correctly because the offset was applied in radians instead of degrees. Fixed it by applying an exact 11.25-degree offset. Also ensured the central shaft ignores this offset so it stays aligned with connected blocks.
- Compacted TileEntityBreakerIntegration.setBreakTexture method calls into single lines to satisfy Spotless formatting constraints and fix the CI build failure.
- Added './gradlew spotlessApply' to the GitHub Actions workflow to automatically fix styling and formatting inconsistencies, preventing Spotless check failures from blocking the CI pipeline.
Updated download instructions to reflect the change from '.zip' to '.jar' file format for the pre-release.
Refactor cogwheel rendering logic to isolate shaft rendering and improve clarity.
Refactor rendering order for cogwheel and shaft to ensure proper alignment.
@Apostrcfo2
Copy link
Copy Markdown
Contributor Author

If you want to test this version, it's in the pre-releases of my fork.

@Gordon-Frohman
Copy link
Copy Markdown
Owner

This took way longer than it should have lol.

That's exactly why I was putting this issue away for so long :D
I'll do my best to test this tomorrow

The link that redirects to the workflow download was redirecting to my repository workflow. For aesthetic reasons, I prefer the link to redirect to the original repository workflow. I believe that was the intention from the beginning.
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.

Model problem

2 participants