Rotations .java

net.minecraft.util.Rotations (class, 77 lines): members: getX, getY, getZ, writeToNBT, equals. imports: NBTTagFloat, NBTTagList.

net.minecraft.utilclass77 linescommon1.5 KB

API Surface (5)

NBTTagList writeToNBT()
boolean equals(Object p_equals_1_)
float getX()
float getY()
float getZ()

Fields & Constants (3)

x
y
z

Code Graph: Dependencies (2)

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

Full Source

Rotations.java77 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.util;
2
3
import net.minecraft.nbt.NBTTagFloat;
4
import net.minecraft.nbt.NBTTagList;
5
6
public class Rotations
7
{
8
    /** Rotation on the X axis */
9
    protected final float x;
10
11
    /** Rotation on the Y axis */
12
    protected final float y;
13
14
    /** Rotation on the Z axis */
15
    protected final float z;
16
17
    public Rotations(float x, float y, float z)
18
    {
19
        this.x = x;
20
        this.y = y;
21
        this.z = z;
22
    }
23
24
    public Rotations(NBTTagList nbt)
25
    {
26
        this.x = nbt.getFloatAt(0);
27
        this.y = nbt.getFloatAt(1);
28
        this.z = nbt.getFloatAt(2);
29
    }
30
31
    public NBTTagList writeToNBT()
32
    {
33
        NBTTagList nbttaglist = new NBTTagList();
34
        nbttaglist.appendTag(new NBTTagFloat(this.x));
35
        nbttaglist.appendTag(new NBTTagFloat(this.y));
36
        nbttaglist.appendTag(new NBTTagFloat(this.z));
37
        return nbttaglist;
38
    }
39
40
    public boolean equals(Object p_equals_1_)
41
    {
42
        if (!(p_equals_1_ instanceof Rotations))
43
        {
44
            return false;
45
        }
46
        else
47
        {
48
            Rotations rotations = (Rotations)p_equals_1_;
49
            return this.x == rotations.x && this.y == rotations.y && this.z == rotations.z;
50
        }
51
    }
52
53
    /**
54
     * Gets the X axis rotation
55
     */
56
    public float getX()
57
    {
58
        return this.x;
59
    }
60
61
    /**
62
     * Gets the Y axis rotation
63
     */
64
    public float getY()
65
    {
66
        return this.y;
67
    }
68
69
    /**
70
     * Gets the Z axis rotation
71
     */
72
    public float getZ()
73
    {
74
        return this.z;
75
    }
76
}
77

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