use of riskyken.armourersWorkshop.common.skin.data.SkinPointer in project Armourers-Workshop by RiskyKen.
the class SkinDataHandler method writeSkinPointerToCompound.
@Override
public void writeSkinPointerToCompound(ISkinPointer skinPointer, NBTTagCompound compound) {
if (compound == null) {
return;
}
SkinPointer sp = new SkinPointer(skinPointer);
sp.writeToCompound(compound);
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPointer in project Armourers-Workshop by RiskyKen.
the class SkinDataHandler method readSkinPointerFromCompound.
@Override
public ISkinPointer readSkinPointerFromCompound(NBTTagCompound compound) {
if (!SkinNBTHelper.compoundHasSkinData(compound)) {
return null;
}
SkinPointer sp = new SkinPointer();
sp.readFromCompound(compound);
return sp;
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPointer 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);
}
}
}
}
}
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPointer in project Armourers-Workshop by RiskyKen.
the class ContainerDyeTable method skinAdded.
public void skinAdded(ItemStack stack) {
updateLockedSlots(stack);
if (tileEntity.getWorldObj().isRemote) {
return;
}
SkinPointer skinPointer = SkinNBTHelper.getSkinPointerFromStack(stack);
ISkinDye dye = skinPointer.getSkinDye();
skinRemoved();
updateLockedSlots(stack);
putStackInSlot(45, stack.copy());
putDyesInSlots();
detectAndSendChanges();
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPointer in project Armourers-Workshop by RiskyKen.
the class ContainerDyeTable method dyeAdded.
public void dyeAdded(ItemStack dyeStack, int slotId) {
ItemStack skinStack = getSlot(45).getStack();
if (skinStack == null) {
return;
}
SkinPointer skinPointer = SkinNBTHelper.getSkinPointerFromStack(skinStack);
ISkinDye skinDye = skinPointer.getSkinDye();
byte[] rgbt = PaintingHelper.getToolPaintData(dyeStack);
String name = null;
if (dyeStack.hasDisplayName()) {
name = dyeStack.getDisplayName();
}
skinDye.addDye(slotId, rgbt, name);
SkinNBTHelper.addSkinDataToStack(skinStack, skinPointer);
}
Aggregations