Closed OpenBagTwo closed 1 year ago
Dang it.
Working on a client with n_discs
set to 3 and a server with n_discs
set to 12.
Connected successfully, no warnings about missing sound files, and popping in Track 6 (for which a music file could have been played if n_discs
hasn't disabled it, resulted in nothing but silence on the client-side
An interesting (though not unwanted) behavior is that even with n_discs
set to 3 _I can still run the command /playsound foxnap:track_5 master @s
and hear the built-in music. This is presumably because sounds.json
is registering the sound event to a code path that's separate from the one that uses SoundEvent.getId()
Resolves #29 by implementing the following behaviors for placeholder records (tracks >
n_discs
and <=max_discs
)n_discs
that's greater than the number of discs they've provided in their custom disc resource pack (this has also been verified)The way this is done is through a little bit of a hodgepodge:
Disc
class now has a boolean flag that can be used to tell the client that thee disc should be treated as a placeholder (this explicitly changes nothing about the server behavior)theas of 1eca37d, thediscRegistry
will set each disc's SoundEvent to a placeholder event (just overriding the client-side sound isn't enough to get rid of the "missing sound for event" warnings)SoundEvent
s for these discs are a custom class that overrides the sound event ID on the client-side if a placeholder flag is setValidation Performed
With
n_discs
set to 12With
n_discs
set to 3