minecraft-src/net/minecraft/client/resources/PlayerSkin.java
2025-07-04 01:41:11 +03:00

51 lines
1 KiB
Java

package net.minecraft.client.resources;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.Nullable;
@Environment(EnvType.CLIENT)
public record PlayerSkin(
ResourceLocation texture,
@Nullable String textureUrl,
@Nullable ResourceLocation capeTexture,
@Nullable ResourceLocation elytraTexture,
PlayerSkin.Model model,
boolean secure
) {
@Environment(EnvType.CLIENT)
public static enum Model {
SLIM("slim"),
WIDE("default");
private final String id;
private Model(final String id) {
this.id = id;
}
public static PlayerSkin.Model byName(@Nullable String name) {
if (name == null) {
return WIDE;
} else {
byte var2 = -1;
switch (name.hashCode()) {
case 3533117:
if (name.equals("slim")) {
var2 = 0;
}
default:
return switch (var2) {
case 0 -> SLIM;
default -> WIDE;
};
}
}
}
public String id() {
return this.id;
}
}
}