UnderLiquidSubSound .java

net.minecraft.client.resources.sounds.UnderLiquidSubSound (class, 29 lines): members: player, tick. imports: LocalPlayer, SoundSource, SoundEvent.

net.minecraft.client.resources.soundsclass29 linesclientextends AbstractTickableSoundInstance782 B

API Surface (1)

void tick()

Fields & Constants (1)

player

Code Graph: Dependencies (5)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

UnderLiquidSubSound.java29 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.resources.sounds;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
import net.minecraft.client.player.LocalPlayer;
6
import net.minecraft.sounds.SoundEvent;
7
import net.minecraft.sounds.SoundSource;
8
9
@Environment(EnvType.CLIENT)
10
public class UnderLiquidSubSound extends AbstractTickableSoundInstance {
11
	private final LocalPlayer player;
12
13
	protected UnderLiquidSubSound(final LocalPlayer player, final SoundEvent event) {
14
		super(event, SoundSource.AMBIENT, SoundInstance.createUnseededRandom());
15
		this.player = player;
16
		this.looping = false;
17
		this.delay = 0;
18
		this.volume = 1.0F;
19
		this.relative = true;
20
	}
21
22
	@Override
23
	public void tick() {
24
		if (this.player.isRemoved() || !this.player.isUnderWater()) {
25
			this.stop();
26
		}
27
	}
28
}
29

Decompiled Minecraft 26.3 source of UnderLiquidSubSound (net/minecraft/client/resources/sounds/UnderLiquidSubSound.java) with Mojang official mappings, stored verbatim on the site.