BaseAttribute .java

net.minecraft.entity.ai.attributes.BaseAttribute (class): members: field_180373_a, setShouldWatch, shouldWatch, getAttributeUnlocalizedName, func_180372_d.

net.minecraft.entity.ai.attributesclass58 linescommon1.4 KB

Implements

API Surface (7)

String getAttributeUnlocalizedName()
double getDefaultValue()
boolean getShouldWatch()
BaseAttribute setShouldWatch(boolean shouldWatchIn)
IAttribute func_180372_d()
int hashCode()
boolean equals(Object p_equals_1_)

Fields & Constants (4)

field_180373_a
unlocalizedName
defaultValue
shouldWatch

String literals (1)

"Name cannot be null!"

Code Graph: Dependencies (1)

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

Full Source

BaseAttribute.java58 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.entity.ai.attributes;
2
3
public abstract class BaseAttribute implements IAttribute
4
{
5
    private final IAttribute field_180373_a;
6
    private final String unlocalizedName;
7
    private final double defaultValue;
8
    private boolean shouldWatch;
9
10
    protected BaseAttribute(IAttribute p_i45892_1_, String unlocalizedNameIn, double defaultValueIn)
11
    {
12
        this.field_180373_a = p_i45892_1_;
13
        this.unlocalizedName = unlocalizedNameIn;
14
        this.defaultValue = defaultValueIn;
15
16
        if (unlocalizedNameIn == null)
17
        {
18
            throw new IllegalArgumentException("Name cannot be null!");
19
        }
20
    }
21
22
    public String getAttributeUnlocalizedName()
23
    {
24
        return this.unlocalizedName;
25
    }
26
27
    public double getDefaultValue()
28
    {
29
        return this.defaultValue;
30
    }
31
32
    public boolean getShouldWatch()
33
    {
34
        return this.shouldWatch;
35
    }
36
37
    public BaseAttribute setShouldWatch(boolean shouldWatchIn)
38
    {
39
        this.shouldWatch = shouldWatchIn;
40
        return this;
41
    }
42
43
    public IAttribute func_180372_d()
44
    {
45
        return this.field_180373_a;
46
    }
47
48
    public int hashCode()
49
    {
50
        return this.unlocalizedName.hashCode();
51
    }
52
53
    public boolean equals(Object p_equals_1_)
54
    {
55
        return p_equals_1_ instanceof IAttribute && this.unlocalizedName.equals(((IAttribute)p_equals_1_).getAttributeUnlocalizedName());
56
    }
57
}
58

Deobfuscated MCP 1.8.9 source of BaseAttribute from Marcelektro/MavenMCP-1.8.9 (net/minecraft/entity/ai/attributes/BaseAttribute.java), stored verbatim.