Upload files to "src/openonyx/music"
This commit is contained in:
1 parent
35040eaade
commit
43d62845c7
3 files changed
+220
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user