NBTTagByte .java

net.minecraft.nbt.NBTTagByte (class): members: getShort, getByte, getLong, getDouble, getFloat, getInt, copy, data, getId, hashCode, equals, toString.

net.minecraft.nbtclass104 linescommonextends NBTBase.NBTPrimitive1.8 KB

API Surface (11)

byte getId()
String toString()
NBTBase copy()
boolean equals(Object p_equals_1_)
int hashCode()
long getLong()
int getInt()
short getShort()
byte getByte()
double getDouble()
float getFloat()

Fields & Constants (1)

data

Code Graph: Dependencies (2)

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

Full Source

NBTTagByte.java104 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.nbt;
2
3
import java.io.DataInput;
4
import java.io.DataOutput;
5
import java.io.IOException;
6
7
public class NBTTagByte extends NBTBase.NBTPrimitive
8
{
9
    /** The byte value for the tag. */
10
    private byte data;
11
12
    NBTTagByte()
13
    {
14
    }
15
16
    public NBTTagByte(byte data)
17
    {
18
        this.data = data;
19
    }
20
21
    /**
22
     * Write the actual data contents of the tag, implemented in NBT extension classes
23
     */
24
    void write(DataOutput output) throws IOException
25
    {
26
        output.writeByte(this.data);
27
    }
28
29
    void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException
30
    {
31
        sizeTracker.read(72L);
32
        this.data = input.readByte();
33
    }
34
35
    /**
36
     * Gets the type byte for the tag.
37
     */
38
    public byte getId()
39
    {
40
        return (byte)1;
41
    }
42
43
    public String toString()
44
    {
45
        return "" + this.data + "b";
46
    }
47
48
    /**
49
     * Creates a clone of the tag.
50
     */
51
    public NBTBase copy()
52
    {
53
        return new NBTTagByte(this.data);
54
    }
55
56
    public boolean equals(Object p_equals_1_)
57
    {
58
        if (super.equals(p_equals_1_))
59
        {
60
            NBTTagByte nbttagbyte = (NBTTagByte)p_equals_1_;
61
            return this.data == nbttagbyte.data;
62
        }
63
        else
64
        {
65
            return false;
66
        }
67
    }
68
69
    public int hashCode()
70
    {
71
        return super.hashCode() ^ this.data;
72
    }
73
74
    public long getLong()
75
    {
76
        return (long)this.data;
77
    }
78
79
    public int getInt()
80
    {
81
        return this.data;
82
    }
83
84
    public short getShort()
85
    {
86
        return (short)this.data;
87
    }
88
89
    public byte getByte()
90
    {
91
        return this.data;
92
    }
93
94
    public double getDouble()
95
    {
96
        return (double)this.data;
97
    }
98
99
    public float getFloat()
100
    {
101
        return (float)this.data;
102
    }
103
}
104

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