use of thaumcraft.api.aspects.AspectList in project LogisticsPipes by RS485.
the class ThaumCraftProxy method getTagsForStack.
/**
* Used to get an ObjectTags of all aspects inside a given stack.
*
* @param stack
* The stack to get ObjectTags for.
* @return ObjectTags containing all of the aspects for stack.
*/
private AspectList getTagsForStack(ItemStack stack) {
if (stack == null) {
return new AspectList();
}
AspectList ot = ThaumcraftApiHelper.getObjectAspects(stack);
ot = ThaumcraftApiHelper.getBonusObjectTags(stack, ot);
return ot;
}
use of thaumcraft.api.aspects.AspectList in project Railcraft by Railcraft.
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 Gaspunk by Ladysnake.
the class ThaumcraftCompat method generateAspectsFromBrewing.
private static AspectList generateAspectsFromBrewing(ItemStack stack) {
List<AspectList> all = new ArrayList<>();
for (IBrewingRecipe recipe : BrewingRecipeRegistry.getRecipes()) {
if (recipe instanceof AbstractBrewingRecipe) {
ItemStack output = ((AbstractBrewingRecipe) recipe).getOutput();
if (ItemGasTube.getContainedGas(output) == ItemGasTube.getContainedGas(stack)) {
AspectList aspects = new AspectList();
aspects.add(AspectHelper.getObjectAspects(((AbstractBrewingRecipe) recipe).getInput()));
if (recipe instanceof BrewingRecipe) {
aspects.add(AspectHelper.getObjectAspects(((BrewingRecipe) recipe).getIngredient()));
} else if (recipe instanceof BrewingOreRecipe) {
for (ItemStack ingredient : ((BrewingOreRecipe) recipe).getIngredient()) {
AspectList list = AspectHelper.getObjectAspects(ingredient);
for (Aspect aspect : list.getAspects()) {
aspects.add(aspect, list.getAmount(aspect) / list.size());
}
}
}
all.add(aspects);
}
}
}
AspectList ret = new AspectList();
for (AspectList list : all) {
for (Aspect aspect : list.getAspects()) {
ret.add(aspect, list.getAmount(aspect) / all.size());
}
}
return AspectHelper.cullTags(ret);
}
use of thaumcraft.api.aspects.AspectList in project Gaspunk by Ladysnake.
the class ThaumcraftCompat method registerAspects.
public static void registerAspects() {
ThaumcraftApi.registerObjectTag(new ItemStack(ModItems.SULFUR), new AspectList().add(Aspect.FIRE, 10).add(Aspect.EARTH, 8).add(Aspect.ENTROPY, 2));
ThaumcraftApi.registerObjectTag(new ItemStack(ModItems.ASH), new AspectList().add(Aspect.FIRE, 7).add(Aspect.ENTROPY, 5).add(Aspect.DEATH, 10));
ThaumcraftApi.registerObjectTag(new ItemStack(ModItems.GRENADE), new AspectList(new ItemStack(ModItems.DIFFUSER)).add(Aspect.ALCHEMY, 5).add(Aspect.ENERGY, 7).add(Aspect.AIR, 7));
ThaumcraftApi.registerObjectTag(new ItemStack(ModItems.SMOKE_POWDER), new AspectList().add(divide(AspectHelper.getObjectAspects(new ItemStack(Items.GUNPOWDER)), 1.5)).add(Aspect.SENSES, 10).add(Aspect.AIR, 6));
ThaumcraftApi.registerObjectTag(new ItemStack(ModItems.EMPTY_GRENADE), new AspectList(new ItemStack(ModItems.DIFFUSER)).add(Aspect.VOID, 8));
// register the aspects for smoke first
registerGasAspect(ModGases.SMOKE, new AspectList());
for (IGas gas : ModGases.REGISTRY.getValues()) registerGasAspect(gas, new AspectList());
}
use of thaumcraft.api.aspects.AspectList in project ArsMagica2 by Mithion.
the class ItemFocusBasic method addInformation.
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
AspectList al = this.getVisCost();
if (al != null && al.size() > 0) {
list.add(StatCollector.translateToLocal(isVisCostPerTick() ? "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);
}
}
}
Aggregations