Java Code Examples for thaumcraft.api.aspects.AspectList#remove()

The following examples show how to use thaumcraft.api.aspects.AspectList#remove() . 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: NodeManipulatorResultHandler.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void combine(AspectList containingList, Aspect a, Aspect b, int addition) {
    if(!canCombine(a, b)) return;
    Aspect combination = NodeManipulatorResultHandler.getCombination(a, b);
    int lowerAmount;
    if(containingList.getAmount(a) < containingList.getAmount(b)) {
        lowerAmount = containingList.getAmount(a);
    } else {
        lowerAmount = containingList.getAmount(b);
    }
    containingList.remove(a, lowerAmount);
    containingList.remove(b, lowerAmount);
    containingList.add(combination, lowerAmount + addition);
}
 
Example 3
Source File: CrucibleRecipe.java    From AdvancedMod with GNU General Public License v3.0 5 votes vote down vote up
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;
}
 
Example 4
Source File: CrucibleRecipe.java    From Chisel-2 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 5
Source File: CrucibleRecipe.java    From GardenCollection with MIT License 5 votes vote down vote up
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;
}
 
Example 6
Source File: CrucibleRecipe.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
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;
}
 
Example 7
Source File: CrucibleRecipe.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
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;
}