Search in sources :

Example 1 with ExPropsPlayerSkinData

use of riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData in project Armourers-Workshop by RiskyKen.

the class MessageClientSkinWardrobeUpdate method onMessage.

@Override
public IMessage onMessage(MessageClientSkinWardrobeUpdate message, MessageContext ctx) {
    ExPropsPlayerSkinData customEquipmentData = ExPropsPlayerSkinData.get(ctx.getServerHandler().playerEntity);
    customEquipmentData.setSkinInfo(message.equipmentWardrobeData, true);
    return null;
}
Also used : ExPropsPlayerSkinData(riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData)

Example 2 with ExPropsPlayerSkinData

use of riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData in project Armourers-Workshop by RiskyKen.

the class ItemSkinUnlock method onItemRightClick.

@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
    if (world.isRemote) {
        return itemStack;
    }
    ISkinType skinType = getSkinTypeFormStack(itemStack);
    ExPropsPlayerSkinData equipmentData = ExPropsPlayerSkinData.get(player);
    int count = equipmentData.getEquipmentWardrobeData().getUnlockedSlotsForSkinType(skinType);
    count++;
    String localizedSkinName = SkinTypeRegistry.INSTANCE.getLocalizedSkinTypeName(skinType);
    if (count <= ExPropsPlayerSkinData.MAX_SLOTS_PER_SKIN_TYPE) {
        equipmentData.setSkinColumnCount(skinType, count);
        player.addChatComponentMessage(new ChatComponentTranslation("chat.armourersworkshop:slotUnlocked", localizedSkinName.toLowerCase(), Integer.toString(count)));
        itemStack.stackSize--;
    } else {
        player.addChatComponentMessage(new ChatComponentTranslation("chat.armourersworkshop:slotUnlockedFailed", localizedSkinName));
    }
    return itemStack;
}
Also used : ISkinType(riskyken.armourersWorkshop.api.common.skin.type.ISkinType) ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation) ExPropsPlayerSkinData(riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData)

Example 3 with ExPropsPlayerSkinData

use of riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData in project Armourers-Workshop by RiskyKen.

the class SkinDataHandler method isArmourRenderOverridden.

@Override
public boolean isArmourRenderOverridden(EntityPlayer player, int slotId) {
    ExPropsPlayerSkinData entityProps = ExPropsPlayerSkinData.get(player);
    BitSet armourOverride = entityProps.getArmourOverride();
    if (slotId < 4 & slotId >= 0) {
        return armourOverride.get(slotId);
    }
    return false;
}
Also used : ExPropsPlayerSkinData(riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData) BitSet(java.util.BitSet)

Example 4 with ExPropsPlayerSkinData

use of riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData in project Armourers-Workshop by RiskyKen.

the class SkinDataHandler method removeSkinFromPlayer.

@Override
public void removeSkinFromPlayer(EntityPlayer player, ISkinType skinType, int index) {
    ExPropsPlayerSkinData entityProps = getExtendedPropsPlayerForPlayer(player);
    entityProps.clearEquipmentStack(skinType, index);
}
Also used : ExPropsPlayerSkinData(riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData)

Example 5 with ExPropsPlayerSkinData

use of riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData in project Armourers-Workshop by RiskyKen.

the class SkinDataHandler method setSkinOnPlayer.

@Override
public void setSkinOnPlayer(EntityPlayer player, ItemStack stack, int index) {
    ExPropsPlayerSkinData entityProps = getExtendedPropsPlayerForPlayer(player);
    entityProps.setEquipmentStack(stack, index);
}
Also used : ExPropsPlayerSkinData(riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData)

Aggregations

ExPropsPlayerSkinData (riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData)6 BitSet (java.util.BitSet)1 WrongUsageException (net.minecraft.command.WrongUsageException)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 ChatComponentTranslation (net.minecraft.util.ChatComponentTranslation)1 ISkinType (riskyken.armourersWorkshop.api.common.skin.type.ISkinType)1 EquipmentWardrobeData (riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData)1