Fix Age celestial path rotation
Build / build (push) Canceled after 0s

This commit is contained in:
dnorberg committed 2026-09-22 22:40:57 -04:00
1 parent 08caa98c0b
commit a48c0e8691
3 files changed
+11 -3

No files matched your search

@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
/** Tilts the vanilla sun, moon, and star plane by each Age's saved angle. */
/** Rotates the vanilla sun, moon, and star path by each Age's saved angle. */
@Mixin(LevelRenderer.class)
public abstract class LevelRendererMixin {
@Shadow
@@ -26,6 +26,10 @@ public abstract class LevelRendererMixin {
)
private Quaternionf rivencraft$rotateCelestialPlane(Axis axis, float degrees) {
float angle = ClientAgeCelestialAngles.get(level.dimension());
return new Quaternionf(Axis.ZP.rotationDegrees(angle)).mul(axis.rotationDegrees(degrees));
// Vanilla's -90 degree Y rotation fixes every sunrise to the same
// east/west line. Offset that rotation around the world's vertical
// axis so the saved Age angle changes the compass direction of the
// entire sun, moon, and star path.
return axis.rotationDegrees(degrees + angle);
}
}