PropertyHelper .java

net.minecraft.block.properties.PropertyHelper (class): members: valueClass, getValueClass, name, hashCode, equals, getName, toString. strings: "clazz".

net.minecraft.block.propertiesclass53 linescommonextends Comparable<T>>1.3 KB

Implements

API Surface (5)

String getName()
Class<T> getValueClass()
String toString()
boolean equals(Object p_equals_1_)
int hashCode()

Fields & Constants (2)

valueClass
name

String literals (2)

"clazz"
"values"

Code Graph: Dependencies (1)

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

Full Source

PropertyHelper.java53 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.block.properties;
2
3
import com.google.common.base.Objects;
4
5
public abstract class PropertyHelper<T extends Comparable<T>> implements IProperty<T>
6
{
7
    private final Class<T> valueClass;
8
    private final String name;
9
10
    protected PropertyHelper(String name, Class<T> valueClass)
11
    {
12
        this.valueClass = valueClass;
13
        this.name = name;
14
    }
15
16
    public String getName()
17
    {
18
        return this.name;
19
    }
20
21
    public Class<T> getValueClass()
22
    {
23
        return this.valueClass;
24
    }
25
26
    public String toString()
27
    {
28
        return Objects.toStringHelper(this).add("name", this.name).add("clazz", this.valueClass).add("values", this.getAllowedValues()).toString();
29
    }
30
31
    public boolean equals(Object p_equals_1_)
32
    {
33
        if (this == p_equals_1_)
34
        {
35
            return true;
36
        }
37
        else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass())
38
        {
39
            PropertyHelper propertyhelper = (PropertyHelper)p_equals_1_;
40
            return this.valueClass.equals(propertyhelper.valueClass) && this.name.equals(propertyhelper.name);
41
        }
42
        else
43
        {
44
            return false;
45
        }
46
    }
47
48
    public int hashCode()
49
    {
50
        return 31 * this.valueClass.hashCode() + this.name.hashCode();
51
    }
52
}
53

Deobfuscated MCP 1.8.9 source of PropertyHelper from Marcelektro/MavenMCP-1.8.9 (net/minecraft/block/properties/PropertyHelper.java), stored verbatim.