Java Code Examples for thaumcraft.api.aspects.Aspect#isPrimal()

The following examples show how to use thaumcraft.api.aspects.Aspect#isPrimal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RegisteredManipulations.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public boolean affect(World world, INode node) {
    AspectList baseList = node.getAspectsBase();
    AspectList list = node.getAspects();
    for(Aspect a : baseList.getAspects()) {
        if(!a.isPrimal()) {
            Aspect[] subComponents = a.getComponents();
            int initialValue = baseList.getAmount(a);
            list.remove(a);
            baseList.remove(a);
            baseList.add(subComponents[0], initialValue);
            list.add(subComponents[0], initialValue);
            baseList.add(subComponents[1], initialValue);
            list.add(subComponents[1], initialValue);
            return true;
        }
    }
    return false;
}
 
Example 2
Source File: GrowingNodeBehavior.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
private double getSaturation(AspectType type, Aspect aspect) {
    double mult = 1D;
    switch (type) {
        case WISP:
            mult -= 0.2D; //Growing node doesn't get saturated by wisps that fast.
            break;
        case WISP_ESSENCE:
            mult += 0.2D; //Growing node doesn't like essences all the time..
            break;
        case ASPECT_ORB:
            mult -= 0.3D; //Growing node prefers aspects in their most natural form.
            break;
        case MANA_BEAN:
        case CRYSTAL_ESSENCE:
            mult += 0.4D; //Mana beans are hard to breed but easy to multiply.. thus growing node doesn't like. Same goes for crystallized essentia
    }
    if(lastFedAspect != null) {
        if(lastFedAspect.equals(aspect)) {
            mult += 0.4D;
            lastFedRow++;
        }
    }
    lastFedAspect = aspect;
    double sat = aspect.isPrimal() ? 1.4D : 1D;
    return sat * mult;
}
 
Example 3
Source File: EssentiasOutputs.java    From Electro-Magic-Tools with GNU General Public License v3.0 5 votes vote down vote up
public static void addOutput(Aspect aspect) {
    if (!aspect.isPrimal()) {
        Aspect[] parents = aspect.getComponents();
        if (ConfigHandler.outputCap == (-1)) {
            outputs.put(aspect.getTag(), (outputs.get(parents[0].getTag()) + outputs.get(parents[1].getTag())));
        } else {
            double originalOutput = (outputs.get(parents[0].getTag()) + outputs.get(parents[1].getTag()));
            if (originalOutput > ConfigHandler.outputCap)
                outputs.put(aspect.getTag(), ConfigHandler.outputCap);
        }
    }
}
 
Example 4
Source File: EssentiasOutputs.java    From Electro-Magic-Tools with GNU General Public License v3.0 5 votes vote down vote up
public static void addOutputs() {
    Collection<Aspect> aspectCollection = Aspect.aspects.values();
    for (Aspect aspect : aspectCollection) {
        if (!aspect.isPrimal())
            addOutput(aspect);
    }
}