String literals (1)
"minecraft:minecart.inside"
Code Graph: Dependencies (5)
Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.
Full Source
| 1 | package net.minecraft.client.audio;
|
| 2 |
|
| 3 | import net.minecraft.entity.item.EntityMinecart;
|
| 4 | import net.minecraft.entity.player.EntityPlayer;
|
| 5 | import net.minecraft.util.MathHelper;
|
| 6 | import net.minecraft.util.ResourceLocation;
|
| 7 |
|
| 8 | public class MovingSoundMinecartRiding extends MovingSound
|
| 9 | {
|
| 10 | private final EntityPlayer player;
|
| 11 | private final EntityMinecart minecart;
|
| 12 |
|
| 13 | public MovingSoundMinecartRiding(EntityPlayer playerRiding, EntityMinecart minecart)
|
| 14 | {
|
| 15 | super(new ResourceLocation("minecraft:minecart.inside"));
|
| 16 | this.player = playerRiding;
|
| 17 | this.minecart = minecart;
|
| 18 | this.attenuationType = ISound.AttenuationType.NONE;
|
| 19 | this.repeat = true;
|
| 20 | this.repeatDelay = 0;
|
| 21 | }
|
| 22 |
|
| 23 | /**
|
| 24 | * Like the old updateEntity(), except more generic.
|
| 25 | */
|
| 26 | public void update()
|
| 27 | {
|
| 28 | if (!this.minecart.isDead && this.player.isRiding() && this.player.ridingEntity == this.minecart)
|
| 29 | {
|
| 30 | float f = MathHelper.sqrt_double(this.minecart.motionX * this.minecart.motionX + this.minecart.motionZ * this.minecart.motionZ);
|
| 31 |
|
| 32 | if ((double)f >= 0.01D)
|
| 33 | {
|
| 34 | this.volume = 0.0F + MathHelper.clamp_float(f, 0.0F, 1.0F) * 0.75F;
|
| 35 | }
|
| 36 | else
|
| 37 | {
|
| 38 | this.volume = 0.0F;
|
| 39 | }
|
| 40 | }
|
| 41 | else
|
| 42 | {
|
| 43 | this.donePlaying = true;
|
| 44 | }
|
| 45 | }
|
| 46 | }
|
| 47 |
|
Deobfuscated MCP 1.8.9 source of MovingSoundMinecartRiding from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/audio/MovingSoundMinecartRiding.java), stored verbatim.