Upload files to "src/openonyx/music"

This commit is contained in:
winterflyt committed 2026-11-30 06:04:34 +02:00
1 parent 35040eaade
commit 43d62845c7
3 files changed
+220

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
package openonyx.music;
import net.minecraft.util.ResourceLocation;
public record TrackInfo(String title, String artist, ResourceLocation art, boolean playing, int progressMs, int durationMs, long capturedAtNanos) {
public float L() {
if (this.durationMs <= 0) {
return 0.0F;
}
long l = this.playing ? (System.nanoTime() - this.capturedAtNanos) / 1000000L : 0L;
return Math.clamp((float)Math.min(this.durationMs, this.progressMs + l) / this.durationMs, 0.0F, 1.0F);
}
}