GuardianSound .java

net.minecraft.client.audio.GuardianSound (class, 39 lines): members: guardian, update. strings: "minecraft:mob.guardian.attack". imports: EntityGuardian.

net.minecraft.client.audioclass39 linesclientextends MovingSound1.1 KB

API Surface (1)

void update()

Fields & Constants (1)

guardian

String literals (1)

"minecraft:mob.guardian.attack"

Code Graph: Dependencies (3)

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

Full Source

GuardianSound.java39 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.audio;
2
3
import net.minecraft.entity.monster.EntityGuardian;
4
import net.minecraft.util.ResourceLocation;
5
6
public class GuardianSound extends MovingSound
7
{
8
    private final EntityGuardian guardian;
9
10
    public GuardianSound(EntityGuardian guardian)
11
    {
12
        super(new ResourceLocation("minecraft:mob.guardian.attack"));
13
        this.guardian = guardian;
14
        this.attenuationType = ISound.AttenuationType.NONE;
15
        this.repeat = true;
16
        this.repeatDelay = 0;
17
    }
18
19
    /**
20
     * Like the old updateEntity(), except more generic.
21
     */
22
    public void update()
23
    {
24
        if (!this.guardian.isDead && this.guardian.hasTargetedEntity())
25
        {
26
            this.xPosF = (float)this.guardian.posX;
27
            this.yPosF = (float)this.guardian.posY;
28
            this.zPosF = (float)this.guardian.posZ;
29
            float f = this.guardian.func_175477_p(0.0F);
30
            this.volume = 0.0F + 1.0F * f * f;
31
            this.pitch = 0.7F + 0.5F * f;
32
        }
33
        else
34
        {
35
            this.donePlaying = true;
36
        }
37
    }
38
}
39

Deobfuscated MCP 1.8.9 source of GuardianSound from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/audio/GuardianSound.java), stored verbatim.