DefaultPlayerSkin .java

net.minecraft.client.resources.DefaultPlayerSkin (class): members: getDefaultSkinLegacy, getDefaultSkin, TEXTURE_STEVE, TEXTURE_ALEX, getSkinType.

net.minecraft.client.resourcesclass46 linesclient1.4 KB

API Surface (3)

ResourceLocation getDefaultSkinLegacy()
ResourceLocation getDefaultSkin(UUID playerUUID)
String getSkinType(UUID playerUUID)

Fields & Constants (2)

TEXTURE_STEVE
TEXTURE_ALEX

String literals (4)

"textures/entity/steve.png"
"textures/entity/alex.png"
"slim"
"default"

Code Graph: Dependencies (1)

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

Full Source

DefaultPlayerSkin.java46 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.resources;
2
3
import java.util.UUID;
4
import net.minecraft.util.ResourceLocation;
5
6
public class DefaultPlayerSkin
7
{
8
    /** The default skin for the Steve model. */
9
    private static final ResourceLocation TEXTURE_STEVE = new ResourceLocation("textures/entity/steve.png");
10
11
    /** The default skin for the Alex model. */
12
    private static final ResourceLocation TEXTURE_ALEX = new ResourceLocation("textures/entity/alex.png");
13
14
    /**
15
     * Returns the default skind for versions prior to 1.8, which is always the Steve texture.
16
     */
17
    public static ResourceLocation getDefaultSkinLegacy()
18
    {
19
        return TEXTURE_STEVE;
20
    }
21
22
    /**
23
     * Retrieves the default skin for this player. Depending on the model used this will be Alex or Steve.
24
     */
25
    public static ResourceLocation getDefaultSkin(UUID playerUUID)
26
    {
27
        return isSlimSkin(playerUUID) ? TEXTURE_ALEX : TEXTURE_STEVE;
28
    }
29
30
    /**
31
     * Retrieves the type of skin that a player is using. The Alex model is slim while the Steve model is default.
32
     */
33
    public static String getSkinType(UUID playerUUID)
34
    {
35
        return isSlimSkin(playerUUID) ? "slim" : "default";
36
    }
37
38
    /**
39
     * Checks if a players skin model is slim or the default. The Alex model is slime while the Steve model is default.
40
     */
41
    private static boolean isSlimSkin(UUID playerUUID)
42
    {
43
        return (playerUUID.hashCode() & 1) == 1;
44
    }
45
}
46

Deobfuscated MCP 1.8.9 source of DefaultPlayerSkin from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/resources/DefaultPlayerSkin.java), stored verbatim.