MovementInputFromOptions .java

net.minecraft.util.MovementInputFromOptions (class, 49 lines): extends MovementInput. members: updatePlayerMoveState, gameSettings. imports: GameSettings.

net.minecraft.utilclass49 linescommonextends MovementInput1.2 KB

API Surface (1)

void updatePlayerMoveState()

Fields & Constants (1)

gameSettings

Code Graph: Dependencies (2)

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

Full Source

MovementInputFromOptions.java49 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.util;
2
3
import net.minecraft.client.settings.GameSettings;
4
5
public class MovementInputFromOptions extends MovementInput
6
{
7
    private final GameSettings gameSettings;
8
9
    public MovementInputFromOptions(GameSettings gameSettingsIn)
10
    {
11
        this.gameSettings = gameSettingsIn;
12
    }
13
14
    public void updatePlayerMoveState()
15
    {
16
        this.moveStrafe = 0.0F;
17
        this.moveForward = 0.0F;
18
19
        if (this.gameSettings.keyBindForward.isKeyDown())
20
        {
21
            ++this.moveForward;
22
        }
23
24
        if (this.gameSettings.keyBindBack.isKeyDown())
25
        {
26
            --this.moveForward;
27
        }
28
29
        if (this.gameSettings.keyBindLeft.isKeyDown())
30
        {
31
            ++this.moveStrafe;
32
        }
33
34
        if (this.gameSettings.keyBindRight.isKeyDown())
35
        {
36
            --this.moveStrafe;
37
        }
38
39
        this.jump = this.gameSettings.keyBindJump.isKeyDown();
40
        this.sneak = this.gameSettings.keyBindSneak.isKeyDown();
41
42
        if (this.sneak)
43
        {
44
            this.moveStrafe = (float)((double)this.moveStrafe * 0.3D);
45
            this.moveForward = (float)((double)this.moveForward * 0.3D);
46
        }
47
    }
48
}
49

Deobfuscated MCP 1.8.9 source of MovementInputFromOptions from Marcelektro/MavenMCP-1.8.9 (net/minecraft/util/MovementInputFromOptions.java), stored verbatim.