CC: Tweaked

CC: Tweaked

65M Downloads

Drive API - Method to Check if Music Disc is Playing

Peekofwar opened this issue ยท 0 comments

commented

Currently there is no way to check if a music disc is currently playing in a Disk Drive. This means that when a computer is rebooted, or a music disc has started playing, the computer cannot determine if the music disc is currently playing.

The programmer can make a guess as to whether or not a music disc is playing by hard-coding timers into the program, however this breaks as soon as a user inserts a music disc not in the program's database.

Jukeboxes emit a redstone signal in modern versions of Minecraft whenever they are playing a music disc, and stop emitting a signal once the disc has finished playing. A big problem with using Jukeboxes for automatic music playback is that only hoppers can insert and extract from Jukeboxes. I've tried Computercraft's Inventory API, Mekanism Logitistcal Pipes, Create Funnels, and LaserIO--nothing except hoppers work. This also means a Computercraft terminal cannot interrupt a Jukebox, as there's no way to extract from a Jukebox while it's emitting a redstone signal, and the computer cannot directly access the Jukebox.

What I'd like is simply some way to check if a music disc is currently playing in a Disk Drive.

From what I've heard, the game determines if a Jukebox is currently playing by starting a timer, and once that time has elapsed, the Jukebox is no longer considered playing a music disc. Perhaps Computercraft could use a similar method...?