Fabric API

Fabric API

108M Downloads

Fluid emptying sound API

Juuxel opened this issue ยท 8 comments

commented

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.

commented

Can't fluid filling sounds be done in vanilla? For example:

@Override
public Optional<SoundEvent> getBucketFillSound() {
	return Optional.of(SoundEvents.ITEM_BUCKET_FILL_LAVA);
}
commented

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.

commented

I've added this in #2043 please check if is correct!

commented

Is what I am suggesting in #2095 for the transfer API enough?

commented

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.

commented

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.

commented

@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.

commented

Well, you could FluidVariantProperties.getEmptySound(FluidVariant.of(fluid)). Imo it doesn't make sense to require modders to implement this twice, hence the suggestion to only implement it once for the transfer api.