Skip to content

[Feature Request] Allow Mods to Implement Custom Sound Playback for the Jukebox Upgrade #472

Description

@ming-sc

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions