Search in sources :

Example 21 with Aspect

use of thaumcraft.api.aspects.Aspect in project PneumaticCraft by MineMaarten.

the class CrucibleRecipe method removeMatching.

public AspectList removeMatching(AspectList itags) {
    AspectList temptags = new AspectList();
    temptags.aspects.putAll(itags.aspects);
    for (Aspect tag : aspects.getAspects()) {
        temptags.remove(tag, aspects.getAmount(tag));
    }
    itags = temptags;
    return itags;
}
Also used : AspectList(thaumcraft.api.aspects.AspectList) Aspect(thaumcraft.api.aspects.Aspect)

Example 22 with Aspect

use of thaumcraft.api.aspects.Aspect in project PneumaticCraft by MineMaarten.

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(StatCollector.translateToLocal(isVisCostPerTick(stack) ? "item.Focus.cost2" : "item.Focus.cost1"));
        for (Aspect aspect : al.getAspectsSorted()) {
            DecimalFormat myFormatter = new DecimalFormat("#####.##");
            String amount = myFormatter.format(al.getAmount(aspect) / 100f);
            list.add(" \u00A7" + aspect.getChatcolor() + aspect.getName() + "\u00A7r x " + amount);
        }
    }
    addFocusInformation(stack, player, list, par4);
}
Also used : AspectList(thaumcraft.api.aspects.AspectList) DecimalFormat(java.text.DecimalFormat) Aspect(thaumcraft.api.aspects.Aspect)

Example 23 with Aspect

use of thaumcraft.api.aspects.Aspect in project PneumaticCraft by MineMaarten.

the class ThaumcraftApiHelper method getAllAspects.

public static AspectList getAllAspects(int amount) {
    if (allAspects.get(amount) == null) {
        AspectList al = new AspectList();
        for (Aspect aspect : Aspect.aspects.values()) {
            al.add(aspect, amount);
        }
        allAspects.put(amount, al);
    }
    return allAspects.get(amount);
}
Also used : AspectList(thaumcraft.api.aspects.AspectList) Aspect(thaumcraft.api.aspects.Aspect)

Example 24 with Aspect

use of thaumcraft.api.aspects.Aspect in project PneumaticCraft by MineMaarten.

the class ThaumcraftApiHelper method getAllCompoundAspects.

public static AspectList getAllCompoundAspects(int amount) {
    if (allCompoundAspects.get(amount) == null) {
        AspectList al = new AspectList();
        for (Aspect aspect : Aspect.getCompoundAspects()) {
            al.add(aspect, amount);
        }
        allCompoundAspects.put(amount, al);
    }
    return allCompoundAspects.get(amount);
}
Also used : AspectList(thaumcraft.api.aspects.AspectList) Aspect(thaumcraft.api.aspects.Aspect)

Example 25 with Aspect

use of thaumcraft.api.aspects.Aspect in project PneumaticCraft by MineMaarten.

the class BlockTrackEntryThaumcraft method addInformation.

@Override
public void addInformation(World world, int x, int y, int z, TileEntity te, List<String> infoList) {
    if (te instanceof IAspectContainer) {
        IAspectContainer container = (IAspectContainer) te;
        AspectList aspects = container.getAspects();
        if (aspects != null && aspects.size() > 0) {
            infoList.add("blockTracker.info.thaumcraft");
            for (Map.Entry<Aspect, Integer> entry : aspects.aspects.entrySet()) {
                infoList.add("-" + entry.getValue() + "x " + entry.getKey().getName());
            }
        } else {
            infoList.add(I18n.format("blockTracker.info.thaumcraft") + " -");
        }
        if (container instanceof INode) {
            INode node = (INode) container;
            infoList.add(I18n.format("blockTracker.info.thaumcraft.nodetype") + " " + I18n.format("nodetype." + node.getNodeType() + ".name"));
            if (node.getNodeModifier() != null)
                infoList.add(I18n.format("blockTracker.info.thaumcraft.nodeModifier") + " " + I18n.format("nodemod." + node.getNodeModifier() + ".name"));
        }
    }
}
Also used : INode(thaumcraft.api.nodes.INode) IAspectContainer(thaumcraft.api.aspects.IAspectContainer) AspectList(thaumcraft.api.aspects.AspectList) Aspect(thaumcraft.api.aspects.Aspect) Map(java.util.Map)

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