Search in sources :

Example 1 with Aspect

use of thaumcraft.api.aspects.Aspect in project LogisticsPipes by RS485.

the class ThaumCraftProxy method getListOfTagsForStack.

/**
	 * Used to get a list of integers representing the IDs of all the aspects in
	 * the given ItemStack. Returns null if object has no tags.
	 * 
	 * @param stack
	 *            The item to get tags for.
	 * @return An Integer list of aspect IDs.
	 */
@Override
public List<String> getListOfTagsForStack(ItemStack stack) {
    if (stack == null) {
        return null;
    }
    List<String> list = new LinkedList<>();
    AspectList tags = getTagsForStack(stack);
    Aspect[] tagArray = tags.getAspectsSorted();
    if (tagArray.length == 0 || tagArray == null) {
        return null;
    }
    for (Aspect element : tagArray) {
        if (element == null) {
            continue;
        }
        list.add(element.getTag());
    }
    return list;
}
Also used : AspectList(thaumcraft.api.aspects.AspectList) Aspect(thaumcraft.api.aspects.Aspect) LinkedList(java.util.LinkedList)

Example 2 with Aspect

use of thaumcraft.api.aspects.Aspect in project Railcraft by Railcraft.

the class ItemGenericEssentiaContainer method getSubItems.

@SideOnly(Side.CLIENT)
@Override
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
    for (Aspect tag : Aspect.aspects.values()) {
        ItemStack i = new ItemStack(this);
        this.setAspects(i, new AspectList().add(tag, base));
        par3List.add(i);
    }
}
Also used : AspectList(thaumcraft.api.aspects.AspectList) Aspect(thaumcraft.api.aspects.Aspect) ItemStack(net.minecraft.item.ItemStack) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 3 with Aspect

use of thaumcraft.api.aspects.Aspect in project Railcraft by Railcraft.

the class ItemFocusBasic method addInformation.

@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
    AspectList al = this.getVisCost(stack);
    if (al != null && al.size() > 0) {
        list.add(I18n.translateToLocal(isVisCostPerTick(stack) ? "item.Focus.cost2" : "item.Focus.cost1"));
        for (Aspect aspect : al.getAspectsSortedByName()) {
            DecimalFormat myFormatter = new DecimalFormat("#####.##");
            String amount = myFormatter.format(al.getAmount(aspect));
            list.add(" §" + aspect.getChatcolor() + aspect.getName() + "§r x " + amount);
        }
    }
    addFocusInformation(stack, player, list, par4);
}
Also used : AspectList(thaumcraft.api.aspects.AspectList) DecimalFormat(java.text.DecimalFormat) Aspect(thaumcraft.api.aspects.Aspect)

Example 4 with Aspect

use of thaumcraft.api.aspects.Aspect in project Railcraft by Railcraft.

the class ThaumcraftPlugin method addBrickAspects.

private static void addBrickAspects(BrickTheme brick, int baseAmount, Aspect... baseAspects) {
    Block block = brick.getBlock();
    if (block == null)
        return;
    AspectList aspects = new AspectList().add(Aspect.EARTH, 4);
    for (Aspect a : baseAspects) {
        aspects.add(a, baseAmount);
    }
    ThaumcraftApi.registerObjectTag(new ItemStack(block, 1, OreDictionary.WILDCARD_VALUE), aspects);
    ThaumcraftApi.registerObjectTag(brick.getStack(BrickVariant.COBBLE), aspects.copy().remove(Aspect.EARTH, 2).add(Aspect.ENTROPY, 2));
    ThaumcraftApi.registerObjectTag(brick.getStack(BrickVariant.BLOCK), aspects.copy().remove(Aspect.EARTH, 2).add(Aspect.ORDER, 2));
    ThaumcraftApi.registerObjectTag(brick.getStack(BrickVariant.ETCHED), aspects.copy().remove(Aspect.EARTH, 2).add(Aspect.DESIRE, 2));
}
Also used : AspectList(thaumcraft.api.aspects.AspectList) Block(net.minecraft.block.Block) Aspect(thaumcraft.api.aspects.Aspect) ItemStack(net.minecraft.item.ItemStack)

Example 5 with Aspect

use of thaumcraft.api.aspects.Aspect in project Railcraft by Railcraft.

the class ItemGenericEssentiaContainer method getSubItems.

@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
    for (Aspect tag : Aspect.aspects.values()) {
        ItemStack i = new ItemStack(this);
        this.setAspects(i, new AspectList().add(tag, base));
        items.add(i);
    }
}
Also used : AspectList(thaumcraft.api.aspects.AspectList) Aspect(thaumcraft.api.aspects.Aspect) ItemStack(net.minecraft.item.ItemStack)

Aggregations

Aspect (thaumcraft.api.aspects.Aspect)26 AspectList (thaumcraft.api.aspects.AspectList)21 DecimalFormat (java.text.DecimalFormat)3 ItemStack (net.minecraft.item.ItemStack)3 com.github.technus.tectech.elementalMatter.core.tElementalException (com.github.technus.tectech.elementalMatter.core.tElementalException)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1 Block (net.minecraft.block.Block)1 Minecraft (net.minecraft.client.Minecraft)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1 IAspectContainer (thaumcraft.api.aspects.IAspectContainer)1 INode (thaumcraft.api.nodes.INode)1