OpenBagTwo / FoxNap

A survival-, multiplayer- and copyright-friendly mod for adding custom music discs to your world
GNU General Public License v3.0
1 stars 1 forks source link

Set placeholder record behavior #38

Closed OpenBagTwo closed 1 year ago

OpenBagTwo commented 1 year ago

Resolves #29 by implementing the following behaviors for placeholder records (tracks > n_discs and <= max_discs)

The way this is done is through a little bit of a hodgepodge:

Validation Performed

With n_discs set to 12

Discs up to 12 appear in the creative inventory, everything beyond 7 has missing textures and item names

With n_discs set to 3

Only three FoxNap records appear in the creative inventory, and the previous missing textures and text are now the placeholder ones

Jukebox "now playing" behavior functioning as expected

OpenBagTwo commented 1 year ago

Dang it.

n_discs mismatching between server and client leads to incompatible sound registries

OpenBagTwo commented 1 year ago

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

client placeholder settings taking precedence over server settings

OpenBagTwo commented 1 year ago

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()