use of riskyken.armourersWorkshop.client.gui.skinlibrary.GuiSkinLibrary in project Armourers-Workshop by RiskyKen.
the class ContainerArmourLibrary method updateSkinName.
@SideOnly(Side.CLIENT)
public void updateSkinName(int slotId) {
Minecraft mc = Minecraft.getMinecraft();
GuiScreen screen = mc.currentScreen;
if (screen != null && screen instanceof GuiSkinLibrary) {
GuiSkinLibrary libScreen = (GuiSkinLibrary) screen;
ItemStack stack = getSlot(36).getStack();
if (stack == null) {
libScreen.setFileName("");
} else {
SkinPointer skinPointer = SkinNBTHelper.getSkinPointerFromStack(stack);
if (skinPointer != null) {
if (ClientSkinCache.INSTANCE.isSkinInCache(skinPointer)) {
Skin skin = ClientSkinCache.INSTANCE.getSkin(skinPointer);
String skinName = skin.getCustomName();
if (!StringUtils.isNullOrEmpty(skinName)) {
libScreen.setFileName(skinName);
}
}
}
}
}
}
Aggregations