2019-06-29 22:01:28 -04:00
|
|
|
package com.minelittlepony.client;
|
|
|
|
|
2021-05-16 19:05:35 +02:00
|
|
|
import com.minelittlepony.common.client.gui.ScrollContainer;
|
|
|
|
import com.minelittlepony.common.client.gui.Tooltip;
|
|
|
|
import com.minelittlepony.common.client.gui.element.Button;
|
2019-06-29 22:01:28 -04:00
|
|
|
import com.mojang.authlib.GameProfile;
|
|
|
|
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
2022-12-10 19:36:55 +00:00
|
|
|
|
|
|
|
import java.util.Optional;
|
|
|
|
import java.util.Set;
|
|
|
|
|
2019-06-29 22:01:28 -04:00
|
|
|
import net.minecraft.client.MinecraftClient;
|
2021-05-16 19:05:35 +02:00
|
|
|
import net.minecraft.client.gui.screen.Screen;
|
2020-11-10 22:49:30 +02:00
|
|
|
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
2019-06-29 22:01:28 -04:00
|
|
|
import net.minecraft.client.texture.PlayerSkinProvider;
|
2022-12-10 19:36:55 +00:00
|
|
|
import net.minecraft.entity.Entity;
|
2019-06-29 22:01:28 -04:00
|
|
|
import net.minecraft.util.Identifier;
|
|
|
|
|
2021-06-10 19:32:21 +02:00
|
|
|
import org.jetbrains.annotations.Nullable;
|
2019-06-29 22:01:28 -04:00
|
|
|
|
|
|
|
public class SkinsProxy {
|
|
|
|
|
|
|
|
public static SkinsProxy instance = new SkinsProxy();
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
public Identifier getSkinTexture(GameProfile profile) {
|
|
|
|
PlayerSkinProvider skins = MinecraftClient.getInstance().getSkinProvider();
|
|
|
|
|
2019-07-16 09:20:40 +02:00
|
|
|
@Nullable
|
2019-06-29 22:01:28 -04:00
|
|
|
MinecraftProfileTexture texture = skins.getTextures(profile).get(MinecraftProfileTexture.Type.SKIN);
|
2019-07-16 09:20:40 +02:00
|
|
|
|
|
|
|
if (texture == null) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2019-07-03 22:06:00 -04:00
|
|
|
return skins.loadSkin(texture, MinecraftProfileTexture.Type.SKIN);
|
2019-06-29 22:01:28 -04:00
|
|
|
}
|
2020-11-10 22:49:30 +02:00
|
|
|
|
2021-05-17 23:27:21 +02:00
|
|
|
public void renderOption(Screen screen, @Nullable Screen parent, int row, int RIGHT, ScrollContainer content) {
|
2021-05-16 19:05:35 +02:00
|
|
|
content.addButton(new Button(RIGHT, row += 20, 150, 20))
|
|
|
|
.setEnabled(false)
|
|
|
|
.getStyle()
|
|
|
|
.setTooltip(Tooltip.of("minelp.options.skins.hdskins.disabled", 200))
|
|
|
|
.setText("minelp.options.skins.hdskins.open");
|
|
|
|
}
|
|
|
|
|
2022-12-10 19:36:55 +00:00
|
|
|
public Optional<Identifier> getSkin(Identifier skinTypeId, AbstractClientPlayerEntity player) {
|
|
|
|
return Optional.empty();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Set<Identifier> getAvailableSkins(Entity entity) {
|
|
|
|
return Set.of();
|
2020-11-10 22:49:30 +02:00
|
|
|
}
|
2019-06-29 22:01:28 -04:00
|
|
|
}
|
2021-05-16 19:05:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|