当前位置: 首页>>代码示例>>Java>>正文


Java AspectList.size方法代码示例

本文整理汇总了Java中thaumcraft.api.aspects.AspectList.size方法的典型用法代码示例。如果您正苦于以下问题:Java AspectList.size方法的具体用法?Java AspectList.size怎么用?Java AspectList.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thaumcraft.api.aspects.AspectList的用法示例。


在下文中一共展示了AspectList.size方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addInformation

import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@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);
}
 
开发者ID:J3FF97,项目名称:Steel-Industries,代码行数:17,代码来源:ItemFocusBasic.java

示例2: addInformation

import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
    String desc = "§9" + StatCollector.translateToLocal("nodetype." + getNodeType(stack) + ".name");
    if(getExtendedNodeType(stack) != null) {
        desc = desc + ", " + StatCollector.translateToLocal("gadomancy.nodes." + getExtendedNodeType(stack));
    }
    if (getNodeModifier(stack) != null) {
        desc = desc + ", " + StatCollector.translateToLocal("nodemod." + getNodeModifier(stack) + ".name");
    }
    list.add(desc);
    AspectList aspects = getAspects(stack);
    if ((aspects != null) && (aspects.size() > 0)) {
        for (Aspect tag : aspects.getAspectsSorted()) {
            if (Thaumcraft.proxy.playerKnowledge.hasDiscoveredAspect(player.getCommandSenderName(), tag)) {
                list.add(tag.getName() + " x " + aspects.getAmount(tag));
            } else {
                list.add(StatCollector.translateToLocal("tc.aspect.unknown"));
            }
        }
    }
    super.addInformation(stack, player, list, par4);
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:23,代码来源:ItemExtendedNodeJar.java

示例3: addInformation

import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@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);
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:14,代码来源:ItemFocusBasic.java

示例4: addInformation

import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@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);
}
 
开发者ID:Brandomine,项目名称:Augury,代码行数:14,代码来源:ItemFocusBasic.java

示例5: 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) {}
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:40,代码来源:GuiResearchRecipeAuraEffects.java

示例6: readCustomNBT

import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
public void readCustomNBT(NBTTagCompound nbttagcompound) {
    this.aspects.readFromNBT(nbttagcompound);
    this.id = nbttagcompound.getString("nodeId");

    AspectList al = new AspectList();
    NBTTagList tlist = nbttagcompound.getTagList("AspectsBase", 10);
    for (int j = 0; j < tlist.tagCount(); j++) {
        NBTTagCompound rs = tlist.getCompoundTagAt(j);
        if (rs.hasKey("key")) {
            al.add(Aspect.getAspect(rs.getString("key")), rs.getInteger("amount"));
        }
    }
    Short oldBase = nbttagcompound.getShort("nodeVisBase");
    this.aspectsBase = new AspectList();
    if ((oldBase > 0) && (al.size() == 0)) {
        for (Aspect a : this.aspects.getAspects()) {
            this.aspectsBase.merge(a, oldBase);
        }
    } else {
        this.aspectsBase = al.copy();
    }
    setNodeType(NodeType.values()[nbttagcompound.getByte("type")]);
    byte mod = nbttagcompound.getByte("modifier");
    if(mod >= 0) setNodeModifier(NodeModifier.values()[mod]); else setNodeModifier(null);
    byte exType = nbttagcompound.getByte("extendedNodeType");
    if(exType >= 0) setExtendedNodeType(ExtendedNodeType.values()[exType]); else setExtendedNodeType(null);
    if(nbttagcompound.hasKey("Behavior")) {
        behaviorSnapshot = nbttagcompound.getCompoundTag("Behavior");
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:31,代码来源:TileExtendedNodeJar.java

示例7: getAspects

import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@Override
public AspectList getAspects(ItemStack itemstack) {
    if (itemstack.hasTagCompound()) {
        AspectList aspects = new AspectList();
        aspects.readFromNBT(itemstack.getTagCompound());
        return aspects.size() > 0 ? aspects : null;
    }
    return null;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:10,代码来源:ItemExtendedNodeJar.java

示例8: renderPlayerAspects

import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
public void renderPlayerAspects(GuiScreen gui, int mouseX, int mouseY) {
    GL11.glPushMatrix();
    GL11.glColor4f(1f, 1f, 1f, 1f);
    GL11.glPushAttrib(1048575);
    GL11.glDisable(GL11.GL_LIGHTING);
    int shiftX = Thaumcraft.instance.aspectShift ? -16 : -8;
    int shiftY = Thaumcraft.instance.aspectShift ? -16 : -8;
    int x = mouseX + 17;
    int y = mouseY + 7 - 33;
    EntityPlayer entityPlayer = FMLClientHandler.instance().getClientPlayerEntity();
    AspectList aspectList = ScanManager.generateEntityAspects(entityPlayer);
    if (aspectList != null) {
        GL11.glDisable(GL11.GL_DEPTH_TEST);
        if (aspectList.size() > 0) {
            Aspect[] sortedAspects = aspectList.getAspectsSortedAmount();
            for (Aspect aspect : sortedAspects) {
                if (aspect != null) {
                    x += 18;
                    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.glTranslatef(x + shiftX - 2, y + shiftY - 2, 0f);
                    GL11.glScalef(1.25f, 1.25f, 0f);
                    UtilsFX.drawTexturedQuadFull(0, 0, UtilsFX.getGuiZLevel(gui));
                    GL11.glDisable(GL11.GL_BLEND);
                    GL11.glPopMatrix();
                    if (Thaumcraft.proxy.playerKnowledge.hasDiscoveredAspect(entityPlayer.getCommandSenderName(), aspect)) {
                        UtilsFX.drawTag(x + shiftX, y + shiftY, aspect, aspectList.getAmount(aspect), 0, UtilsFX.getGuiZLevel(gui));
                    } 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.glTranslatef(x + shiftX, y + shiftY, 0f);
                        UtilsFX.drawTexturedQuadFull(0, 0, UtilsFX.getGuiZLevel(gui));
                        GL11.glDisable(GL11.GL_BLEND);
                        GL11.glPopMatrix();
                    }
                }
            }
        }
        GL11.glEnable(GL11.GL_DEPTH_TEST);
    }
    GL11.glPopAttrib();
    GL11.glPopMatrix();
}
 
开发者ID:blay09,项目名称:TCInventoryScanning,代码行数:48,代码来源:ClientProxy.java


注:本文中的thaumcraft.api.aspects.AspectList.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。