Fluid emptying sound API
Juuxel opened this issue ยท 8 comments
This would be sort of similar to the existing fluid rendering APIs - a fluid like lava could provide its own emptying sounds unless they want to use the default (water) sounds.
Can't fluid filling sounds be done in vanilla? For example:
@Override
public Optional<SoundEvent> getBucketFillSound() {
return Optional.of(SoundEvents.ITEM_BUCKET_FILL_LAVA);
}
TIL. Anyway, there's still the emptying sound that is hardcoded in BucketItem.playEmptyingSound
. Even if a modded bucket overrode that, you couldn't access the sound event in other mods.
I've added this in #2043 please check if is correct!
Is what I am suggesting in #2095 for the transfer API enough?
My idea is to inject the method inside the fluid class, to have a direct acces without using FluidVariant.
I really don't see what this achieves though. Given the few use cases, FluidVariantAttributes.getEmptySound(FluidVariant.of(fluid))
should be concise enough imo.
I don't like the idea of injecting this method to the Fluid
class, it feels unnecessary (a static registry like in #2095 works fine) and will lead to a messy API if we start doing it for 100s of classes imo.
@Technici4n This would be for fluids, not variants, so not fully. Requiring the transfer api for all use cases of a simple fluid emptying sound doesn't really make sense.