use of thaumcraft.api.aspects.Aspect in project ArsMagica2 by Mithion.
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));
// if (!temptags.remove(tag, aspects.getAmount(tag))) return null;
}
itags = temptags;
return itags;
}
use of thaumcraft.api.aspects.Aspect in project LogisticsPipes by RS485.
the class ThaumCraftProxy method renderAspectsDown.
/**
* Renders the aspect icons for a given stack downwards starting at x, y.
*
* @param x
* The x coord of the screen.
* @param y
* The y coord of the screen.
* @param item
* The ItemStack to render aspects for.
* @param gui
* The Gui screen to render on.
*/
@Override
@SideOnly(Side.CLIENT)
public void renderAspectsDown(ItemStack item, int x, int y, GuiScreen gui) {
GL11.glPushMatrix();
AspectList tags = getTagsForStack(item);
tags = ThaumcraftApiHelper.getBonusObjectTags(item, tags);
if (tags != null) {
int index = 0;
for (Aspect tag : tags.getAspectsSortedAmount()) {
if (tag == null) {
continue;
}
int yPos = y + index * 18;
renderAspectAt(tag, x, yPos, gui, tags.getAmount(tag), true);
index++;
}
}
GL11.glPopMatrix();
}
use of thaumcraft.api.aspects.Aspect in project LogisticsPipes by RS485.
the class ThaumCraftProxy method renderAspectAt.
/**
* Used to render a icon of an aspect at a give x and y on top of a given
* GuiScreen.
*
* @param tag
* The EnumTag (aspect) to render
* @param x
* @param y
* @param gui
* The gui to render on.
*/
private void renderAspectAt(Aspect tag, int x, int y, GuiScreen gui, int amount, boolean drawBackground) {
if (!(tag instanceof Aspect)) {
return;
}
Minecraft mc = FMLClientHandler.instance().getClient();
if (drawBackground) {
UtilsFX.bindTexture("textures/aspects/_back.png");
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glTranslated(x - 2, y - 2, 0.0D);
GL11.glScaled(1.25D, 1.25D, 0.0D);
UtilsFX.drawTexturedQuadFull(0, 0, gui.zLevel);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
if (Thaumcraft.proxy.playerKnowledge.hasDiscoveredAspect(mc.thePlayer.getDisplayName(), tag)) {
UtilsFX.drawTag(x, y, tag, amount, 0, gui.zLevel);
} else {
UtilsFX.bindTexture("textures/aspects/_unknown.png");
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glTranslated(x, y, 0.0D);
UtilsFX.drawTexturedQuadFull(0, 0, gui.zLevel);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
}
use of thaumcraft.api.aspects.Aspect in project Railcraft by Railcraft.
the class ResearchItem method getResearchPrimaryTag.
/**
* @return the aspect aspects ordinal with the highest value. Used to determine scroll color and similar things
*/
public Aspect getResearchPrimaryTag() {
Aspect aspect = null;
int highest = 0;
if (tags != null)
for (Aspect tag : tags.getAspects()) {
if (tags.getAmount(tag) > highest) {
aspect = tag;
highest = tags.getAmount(tag);
}
;
}
return aspect;
}
use of thaumcraft.api.aspects.Aspect in project TecTech by Technus.
the class AspectDefinitionCompatEnabled method run.
@Override
public void run() {
AspectDefinitionCompat.defToAspect.put(magic_air, "aer");
AspectDefinitionCompat.defToAspect.put(magic_earth, "terra");
AspectDefinitionCompat.defToAspect.put(magic_fire, "ignis");
AspectDefinitionCompat.defToAspect.put(magic_water, "aqua");
AspectDefinitionCompat.defToAspect.put(magic_order, "ordo");
AspectDefinitionCompat.defToAspect.put(magic_entropy, "perditio");
AspectDefinitionCompat.aspectToDef.put("aer", magic_air);
AspectDefinitionCompat.aspectToDef.put("terra", magic_earth);
AspectDefinitionCompat.aspectToDef.put("ignis", magic_fire);
AspectDefinitionCompat.aspectToDef.put("aqua", magic_water);
AspectDefinitionCompat.aspectToDef.put("ordo", magic_order);
AspectDefinitionCompat.aspectToDef.put("perditio", magic_entropy);
ArrayList<Aspect> list = Aspect.getCompoundAspects();
Aspect[] array = list.toArray(new Aspect[list.size()]);
while (!list.isEmpty()) {
for (Aspect aspect : array) {
if (list.contains(aspect)) {
Aspect[] content = aspect.getComponents();
if (content.length != 2) {
list.remove(aspect);
} else if (AspectDefinitionCompat.aspectToDef.containsKey(content[0].getTag()) && AspectDefinitionCompat.aspectToDef.containsKey(content[1].getTag())) {
try {
dComplexAspectDefinition newAspect;
if (content[0].getTag().equals(content[1].getTag())) {
newAspect = new dComplexAspectDefinition(AspectDefinitionCompat.aspectToDef.get(content[0].getTag()).getStackForm(2));
} else {
newAspect = new dComplexAspectDefinition(AspectDefinitionCompat.aspectToDef.get(content[0].getTag()).getStackForm(1), AspectDefinitionCompat.aspectToDef.get(content[1].getTag()).getStackForm(1));
}
AspectDefinitionCompat.aspectToDef.put(aspect.getTag(), newAspect);
AspectDefinitionCompat.defToAspect.put(newAspect, aspect.getTag());
} catch (tElementalException e) {
/**/
} finally {
list.remove(aspect);
}
}
}
}
}
}
Aggregations