本文整理汇总了Java中thaumcraft.api.aspects.AspectList.add方法的典型用法代码示例。如果您正苦于以下问题:Java AspectList.add方法的具体用法?Java AspectList.add怎么用?Java AspectList.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thaumcraft.api.aspects.AspectList
的用法示例。
在下文中一共展示了AspectList.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addAspectsDivSigil
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
private static void addAspectsDivSigil() {
if (ExtraUtils.divisionSigil == null) {
return;
}
final ArrayList<Aspect> a = new ArrayList<Aspect>();
a.add(Aspect.AURA);
a.add(Aspect.EXCHANGE);
a.add(Aspect.TOOL);
a.add(Aspect.CRAFT);
a.add(Aspect.ELDRITCH);
a.add(Aspect.SOUL);
Collections.sort(a, new Comparator<Aspect>() {
@Override
public int compare(final Aspect o1, final Aspect o2) {
return o1.getTag().compareTo(o2.getTag());
}
});
final AspectList b = new AspectList();
for (int i = 0; i < a.size(); ++i) {
b.add((Aspect)a.get(i), ThaumcraftHelper.pi[i]);
}
ThaumcraftApi.registerObjectTag(new ItemStack(ExtraUtils.divisionSigil, 1, 32767), b);
}
示例2: readCustomNBT
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@Override
public void readCustomNBT(NBTTagCompound compound) {
super.readCustomNBT(compound);
this.multiblockYIndex = compound.getInteger("multiblockYIndex");
this.isMasterTile = compound.getBoolean("isMasterTile");
this.multiblockId = compound.getInteger("multiblockId");
this.isMultiblockPresent = compound.getBoolean("multiblockPresent");
this.incSize = compound.getInteger("sizeInc");
AspectList al = new AspectList();
NBTTagCompound cmp = compound.getCompoundTag("aspects");
for (Object tag : cmp.func_150296_c()) {
String strTag = (String) tag;
int amt = cmp.getInteger(strTag);
al.add(Aspect.getAspect(strTag), amt);
}
this.al = al;
}
示例3: createAuraCoreRecipes
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
private static List[] createAuraCoreRecipes() {
List[] recipes = new List[7];
for(int i = 0; i < 7; i++) {
AspectList cost = new AspectList();
switch (i) {
case 0: cost.add(Aspect.AIR, 84); break;
case 1: cost.add(Aspect.FIRE, 84); break;
case 2: cost.add(Aspect.WATER, 84); break;
case 3: cost.add(Aspect.EARTH, 84); break;
case 4: cost.add(Aspect.ORDER, 84); break;
case 5: cost.add(Aspect.ENTROPY, 84); break;
case 6: cost.add(Aspect.AIR, 14).add(Aspect.FIRE, 14).add(Aspect.WATER, 14)
.add(Aspect.EARTH, 14).add(Aspect.ORDER, 14).add(Aspect.ENTROPY, 14);
}
ItemWandCasting item = (ItemWandCasting) ConfigItems.itemWandCasting;
ItemStack wand = new ItemStack(item);
item.setRod(wand, ConfigItems.WAND_ROD_GREATWOOD);
item.setCap(wand, ConfigItems.WAND_CAP_GOLD);
recipes[i] = Arrays.asList(cost, 3, 2, 3,
Arrays.asList(
null, null, null, null, wand, null, null, null, null,
null, null, null, null, new ItemStack(ConfigBlocks.blockCrystal, 1, i),
new ItemStack(RegisteredItems.itemAuraCore), null, null, null
));
}
return recipes;
}
示例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: addInfusedOreAspect
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
/** Add aspects to infused ore */
private static void addInfusedOreAspect(BlockInfusedBlockOre ore, Aspect aspect, int... metas) {
Block baseBlock = ore.getBaseBlock();
int baseMeta = ore.getBaseMeta();
AspectList baseAspects = ThaumcraftApiHelper.getObjectAspects(new ItemStack(baseBlock, 1, baseMeta));
AspectList oreAspects = new AspectList().add(aspect, TOConfig.generalAspectCount);
oreAspects.add(baseAspects);
ThaumcraftApi.registerObjectTag(new ItemStack(ore), metas, oreAspects);
}
示例6: getAllAspects
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
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);
}
示例7: getAllCompoundAspects
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
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);
}
示例8: growNodeInRange
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
public static boolean growNodeInRange(List<Chunk> chunks, World world, int xCoord, int yCoord, int zCoord, int range) {
Collections.shuffle(chunks);
int attemptedNodes = 0;
for (Chunk chunk : chunks) {
for (INode node : findNodesInChunkWithinRange(chunk, xCoord, yCoord, zCoord, range)) {
if (node != null) {
++attemptedNodes;
AspectList aspectsBase = node.getAspectsBase();
int randBase = Math.max(aspectsBase.visSize(), 1);
if (world.rand.nextInt(randBase) < 120) {
Aspect aspectToAdd;
int rollAttempts = 0;
do {
aspectToAdd = getWeightedRandomAspect(world.rand);
++rollAttempts;
}
while (aspectsBase.getAmount(aspectToAdd) < 255 && 20 < rollAttempts);
if (20 <= rollAttempts) {
return false;
}
short amount = (short)(1 + world.rand.nextInt(2));
aspectsBase.add(aspectToAdd, amount);
node.getAspects().add(aspectToAdd, amount);
updateNode(node, world);
return true;
}
}
}
}
return attemptedNodes < 10;
}
示例9: getAllAspects
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
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);
}
示例10: getAllCompoundAspects
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
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);
}
示例11: getAllAspects
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
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);
}
示例12: getAllCompoundAspects
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
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);
}
示例13: onItemUse
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
ForgeDirection dir = ForgeDirection.getOrientation(side);
x += dir.offsetX;
y += dir.offsetY;
z += dir.offsetZ;
if(placeRandomNode(world, x, y, z)) {
int metadata = stack.getItemDamage();
TileNode node = (TileNode) world.getTileEntity(x, y, z);
if(metadata == 0) {
node.setNodeType(NodeType.NORMAL);
node.setNodeModifier(NodeModifier.BRIGHT);
AspectList aspects = new AspectList();
for(Aspect primal : Aspect.getPrimalAspects()) {
aspects.add(primal, 500);
}
node.setAspects(aspects);
node.markDirty();
world.markBlockForUpdate(x, y, z);
} else {
node.setNodeType(NodeType.values()[metadata]);
}
return true;
}
return false;
}
示例14: 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;
}
示例15: getAspectList
import thaumcraft.api.aspects.AspectList; //导入方法依赖的package包/类
public static AspectList getAspectList(NBTTagCompound compound, String tag, AspectList defaultValue) {
if(!compound.hasKey(tag)) return defaultValue;
NBTTagCompound cmp = compound.getCompoundTag(tag);
AspectList out = new AspectList();
for (Object key : cmp.func_150296_c()) {
String strKey = (String) key;
Aspect a = Aspect.getAspect(strKey);
if(a != null) {
out.add(a, cmp.getInteger(strKey));
}
}
return out;
}