mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-04 15:43:00 +00:00
Prevent playing music discs with speaker.playSound
I have mixed feelings about speaker.playSound. On one hand, it's pretty useful to be able to play any sound. On the other, it sometimes feels ... maybe a little too magic? One particular thing I don't like is that it allows you to play arbitrary records, which sidesteps both a vanilla mechanic (finding record discs) and existing CC functionality (disk.playAudio). We now prevent playing record tracks from the speaker.
This commit is contained in:
@@ -29,4 +29,15 @@ class Speaker_Test {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [SpeakerPeripheral.playSound] will not play records.
|
||||
*/
|
||||
@GameTest
|
||||
fun Will_not_play_record(helper: GameTestHelper) = helper.sequence {
|
||||
thenOnComputer {
|
||||
callPeripheral("right", "playSound", SoundEvents.MUSIC_DISC_PIGSTEP.location.toString())
|
||||
.assertArrayEquals(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user