After the addition of the IDiscHandler interface, other mods can use it to provide custom discs. However, StorageSoundHandler currently assumes that all mods use Minecraft's audio system. This makes it difficult to integrate mods that use their own audio systems instead of Minecraft's SoundInstance-based playback, such as AudioPlayer.
I would suggest adding an ISoundWrapper interface whose implementations are responsible for holding and managing sound objects. These sound objects would not necessarily need to implement Minecraft's SoundInstance interface.
public interface ISoundWrapper {
boolean isActive();
void stop();
}
Then StorageSoundHandler could expose a method for other mods to register their sound wrappers:
public static void putStorageSoundWrapper(UUID storageUuid, ISoundWrapper wrapper) {
storageSounds.put(storageUuid, wrapper);
}
This change should be relatively low-impact. It only requires adding a new method and updating some existing logic, without changing any existing method signatures, so compatibility concerns should be minimal.
After the addition of the
IDiscHandlerinterface, other mods can use it to provide custom discs. However,StorageSoundHandlercurrently assumes that all mods use Minecraft's audio system. This makes it difficult to integrate mods that use their own audio systems instead of Minecraft'sSoundInstance-based playback, such as AudioPlayer.I would suggest adding an
ISoundWrapperinterface whose implementations are responsible for holding and managing sound objects. These sound objects would not necessarily need to implement Minecraft'sSoundInstanceinterface.Then
StorageSoundHandlercould expose a method for other mods to register their sound wrappers:This change should be relatively low-impact. It only requires adding a new method and updating some existing logic, without changing any existing method signatures, so compatibility concerns should be minimal.