本文整理汇总了Java中thaumcraft.api.aspects.AspectList.getAspects方法的典型用法代码示例。如果您正苦于以下问题:Java AspectList.getAspects方法的具体用法?Java AspectList.getAspects怎么用?Java AspectList.getAspects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thaumcraft.api.aspects.AspectList
的用法示例。
在下文中一共展示了AspectList.getAspects方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CrucibleRecipe
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
public CrucibleRecipe(String researchKey, ItemStack result, Object cat, AspectList tags) {
recipeOutput = result;
this.aspects = tags;
this.key = researchKey;
this.catalyst = cat;
if (cat instanceof String) {
this.catalyst = OreDictionary.getOres((String) cat);
}
String hc = researchKey + result.toString();
for (Aspect tag : tags.getAspects()) {
hc += tag.getTag() + tags.getAmount(tag);
}
if (cat instanceof ItemStack) {
hc += ((ItemStack) cat).toString();
}
else if ( (cat instanceof ArrayList) && ( ((ArrayList<ItemStack>) catalyst).size() > 0)) {
for (ItemStack is : (ArrayList<ItemStack>) catalyst) {
hc += is.toString();
}
}
hash = hc.hashCode();
}
示例2: CrucibleRecipe
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
public CrucibleRecipe(String researchKey, ItemStack result, Object cat, AspectList tags) {
recipeOutput = result;
this.aspects = tags;
this.key = researchKey;
this.catalyst = cat;
if (cat instanceof String) {
this.catalyst = OreDictionary.getOres((String) cat);
}
String hc = researchKey + result.toString();
for (Aspect tag:tags.getAspects()) {
hc += tag.getTag()+tags.getAmount(tag);
}
if (cat instanceof ItemStack) {
hc += ((ItemStack)cat).toString();
} else
if (cat instanceof ArrayList && ((ArrayList<ItemStack>)catalyst).size()>0) {
for (ItemStack is :(ArrayList<ItemStack>)catalyst) {
hc += is.toString();
}
}
hash = hc.hashCode();
}
示例3: renderItem
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@Override
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack stack, Object... data) {
GL11.glEnable(GL11.GL_ALPHA_TEST);
AspectList aspects = ((ItemJarFilled)ConfigItems.itemJarFilled).getAspects(stack);
if(aspects != null) {
tile.aspect = aspects.getAspects()[0];
tile.amount = aspects.getAmount(tile.aspect);
} else {
tile.aspect = null;
tile.amount = 0;
}
if(stack.hasTagCompound()) {
tile.networkId = NBTHelper.getUUID(stack.getTagCompound(), "networkId");
}
super.renderItem(type, stack, data);
GL11.glPushMatrix();
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
RenderingRegistry.instance().renderInventoryBlock(RenderBlocks.getInstance(), RegisteredBlocks.blockRemoteJar, 0, RegisteredBlocks.blockRemoteJar.getRenderType());
GL11.glPopMatrix();
}
示例4: affect
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@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;
}
示例5: placeBlockAt
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
boolean placed = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata);
if (placed && stack.hasTagCompound()) {
TileRemoteJar tile = (TileRemoteJar) world.getTileEntity(x, y, z);
AspectList aspects = ((ItemJarFilled) ConfigItems.itemJarFilled).getAspects(stack);
if(aspects != null) {
tile.aspect = aspects.getAspects()[0];
tile.amount = aspects.getAmount(tile.aspect);
}
if(!world.isRemote) {
tile.networkId = NBTHelper.getUUID(stack.getTagCompound(), "networkId");
tile.markForUpdate();
}
}
return placed;
}
示例6: CrucibleRecipe
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
public CrucibleRecipe(String researchKey, ItemStack result, Object cat, AspectList tags)
{
recipeOutput = result;
this.aspects = tags;
this.key = researchKey;
this.catalyst = cat;
if(cat instanceof String)
{
this.catalyst = OreDictionary.getOres((String) cat);
}
String hc = researchKey + result.toString();
for(Aspect tag : tags.getAspects())
{
hc += tag.getTag() + tags.getAmount(tag);
}
if(cat instanceof ItemStack)
{
hc += ((ItemStack) cat).toString();
}
else if(cat instanceof ArrayList && ((ArrayList<ItemStack>) catalyst).size() > 0)
{
for(ItemStack is : (ArrayList<ItemStack>) catalyst)
{
hc += is.toString();
}
}
hash = hc.hashCode();
}
示例7: GuiResearchRecipeAuraEffects
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
public GuiResearchRecipeAuraEffects(ResearchItem research, int page, double x, double y) {
super(research, page, x, y);
Injector inj = new Injector(this, GuiResearchRecipe.class);
ResearchPage[] additionalPages = ResearchPageAuraAspects.createAllAuraPagesFor(Minecraft.getMinecraft().thePlayer);
ResearchPage[] pages = inj.getField("pages");
ResearchPage[] newPages = new ResearchPage[pages.length + additionalPages.length];
System.arraycopy(pages, 0, newPages, 0, pages.length);
System.arraycopy(additionalPages, 0, newPages, pages.length, additionalPages.length);
inj.setField("pages", newPages);
inj.setField("maxPages", newPages.length);
List<String> list = Thaumcraft.proxy.getScannedObjects().get(Minecraft.getMinecraft().thePlayer.getCommandSenderName());
if ((list != null) && (list.size() > 0)) {
for (String s : list) {
try {
String s2 = s.substring(1);
ItemStack is = getFromCache(Integer.parseInt(s2));
if (is != null) {
AspectList tags = ThaumcraftCraftingManager.getObjectTags(is);
tags = ThaumcraftCraftingManager.getBonusTags(is, tags);
if ((tags != null) && (tags.size() > 0)) {
for (Aspect a : tags.getAspects()) {
ArrayList<ItemStack> items = itemMap.get(a.getTag());
if (items == null) {
items = new ArrayList<ItemStack>();
}
ItemStack is2 = is.copy();
is2.stackSize = tags.getAmount(a);
items.add(is2);
itemMap.put(a.getTag(), items);
}
}
}
} catch (NumberFormatException e) {}
}
}
}
示例8: add
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@Override
public AspectList add(Aspect aspect, int amount) {
AspectList al = new AspectList();
al.add(aspect, amount);
al = ResearchManager.reduceToPrimals(al);
for(Aspect a : al.getAspects()) {
super.add(a, al.getAmount(a));
}
return this;
}
示例9: doesContainerContain
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
public boolean doesContainerContain(AspectList ot) {
for (Aspect tt : ot.getAspects()) {
if (this.aspects.getAmount(tt) < ot.getAmount(tt)) {
return false;
}
}
return true;
}
示例10: doesContainerContain
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@Override
public boolean doesContainerContain(AspectList list) {
if (!isInputTile()) return false;
if (holdingAspect == null) return false;
for (Aspect a : list.getAspects()) if ((this.amount > 0) && (a == holdingAspect)) return true;
return false;
}
示例11: doEntityEffect
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@Override
public void doEntityEffect(ChunkCoordinates originTile, Entity e) {
EntityPlayer player = (EntityPlayer) e;
if(player.getHeldItem() != null && player.getHeldItem().getItem() != null && player.getHeldItem().getItem() instanceof ItemWandCasting) {
ItemStack wand = player.getHeldItem();
ItemWandCasting wandCasting = (ItemWandCasting) wand.getItem();
AspectList al = wandCasting.getAspectsWithRoom(wand);
for(Aspect a : al.getAspects()) {
if(a != null) wandCasting.addRealVis(wand, a, 4, true);
}
}
}