use of thaumcraft.api.aspects.AspectList in project PneumaticCraft by MineMaarten.
the class ThaumcraftApi method exists.
/**
* Checks to see if the passed item/block already has aspects associated with it.
* @param id
* @param meta
* @return
*/
public static boolean exists(Item item, int meta) {
AspectList tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, meta));
if (tmp == null) {
tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, OreDictionary.WILDCARD_VALUE));
if (meta == OreDictionary.WILDCARD_VALUE && tmp == null) {
int index = 0;
do {
tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, index));
index++;
} while (index < 16 && tmp == null);
}
if (tmp == null)
return false;
}
return true;
}
use of thaumcraft.api.aspects.AspectList 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;
}
use of thaumcraft.api.aspects.AspectList 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);
}
use of thaumcraft.api.aspects.AspectList 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);
}
use of thaumcraft.api.aspects.AspectList 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);
}
Aggregations