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


Java Aspect类代码示例

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


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

示例1: addAspectsDivSigil

import thaumcraft.api.aspects.Aspect; //导入依赖的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);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:24,代码来源:ThaumcraftHelper.java

示例2: CrucibleRecipe

import thaumcraft.api.aspects.Aspect; //导入依赖的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();
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:23,代码来源:CrucibleRecipe.java

示例3: matches

import thaumcraft.api.aspects.Aspect; //导入依赖的package包/类
public boolean matches(AspectList itags, ItemStack cat) {
	if ( (catalyst instanceof ItemStack) && !ThaumcraftApiHelper.itemMatches((ItemStack) catalyst, cat, false)) {
		return false;
	}
	else if ( (catalyst instanceof ArrayList) && ( ((ArrayList<ItemStack>) catalyst).size() > 0)) {
		ItemStack[] ores = ((ArrayList<ItemStack>) catalyst).toArray(new ItemStack[] {});
		if (!ThaumcraftApiHelper.containsMatch(false, new ItemStack[] {
			cat
		}, ores)) {
			return false;
		}
	}
	if (itags == null) {
		return false;
	}
	for (Aspect tag : aspects.getAspects()) {
		if (itags.getAmount(tag) < aspects.getAmount(tag)) {
			return false;
		}
	}
	return true;
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:23,代码来源:CrucibleRecipe.java

示例4: doEssentiaTrail

import thaumcraft.api.aspects.Aspect; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
private void doEssentiaTrail() {
    if((ticksExisted & 1) == 0) return;
    TileAuraPylon tile = getMasterTile();
    if(tile == null) return;
    TileAuraPylon inputTile = getInputTile();
    if(inputTile == null) return;
    Aspect a = inputTile.getAspectType();
    if(a == null) return;
    if(inputTile.amount <= 0) return;

    int count = 5;
    FXEssentiaTrail essentiaTrail = new FXEssentiaTrail(tile.getWorldObj(), inputTile.xCoord + 0.5, inputTile.yCoord + 0.2, inputTile.zCoord + 0.5, tile.xCoord + 0.5, tile.yCoord + 1.7, tile.zCoord + 0.5, count, a.getColor(), 1);
    essentiaTrail.noClip = true;
    essentiaTrail.motionY = (0.1F + MathHelper.sin(count / 3.0F) * 0.01F);
    essentiaTrail.motionX = (MathHelper.sin(count / 10.0F) * 0.001F + worldObj.rand.nextGaussian() * 0.002000000094994903D);
    essentiaTrail.motionZ = (MathHelper.sin(count / 10.0F) * 0.001F + worldObj.rand.nextGaussian() * 0.002000000094994903D);
    ParticleEngine.instance.addEffect(tile.getWorldObj(), essentiaTrail);
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:20,代码来源:TileAuraPylon.java

示例5: CrucibleRecipe

import thaumcraft.api.aspects.Aspect; //导入依赖的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();
}
 
开发者ID:Brandomine,项目名称:Augury,代码行数:24,代码来源:CrucibleRecipe.java

示例6: equipTick

import thaumcraft.api.aspects.Aspect; //导入依赖的package包/类
public void equipTick(World world, EntityPlayer player, Aspect aspect) {
    if(world.isRemote) return;

    FamiliarData data = new FamiliarData(player.getCommandSenderName(), aspect.getTag());

    IInventory baublesInv = BaublesApi.getBaubles(player);
    if(baublesInv.getStackInSlot(0) == null) {
        handleUnequip(world, player, aspect);
        return;
    }

    if(familiarControllers.get(player) == null || !playersWithFamiliar.contains(data)) {
        handleEquip(world, player, aspect);
    }

    familiarControllers.get(player).tick();
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:18,代码来源:DataFamiliar.java

示例7: getSaturation

import thaumcraft.api.aspects.Aspect; //导入依赖的package包/类
private double getSaturation(AspectType type, Aspect aspect) {
    double mult = 1D;
    switch (type) {
        case WISP:
            mult -= 0.2D; //Growing node doesn't get saturated by wisps that fast.
            break;
        case WISP_ESSENCE:
            mult += 0.2D; //Growing node doesn't like essences all the time..
            break;
        case ASPECT_ORB:
            mult -= 0.3D; //Growing node prefers aspects in their most natural form.
            break;
        case MANA_BEAN:
        case CRYSTAL_ESSENCE:
            mult += 0.4D; //Mana beans are hard to breed but easy to multiply.. thus growing node doesn't like. Same goes for crystallized essentia
    }
    if(lastFedAspect != null) {
        if(lastFedAspect.equals(aspect)) {
            mult += 0.4D;
            lastFedRow++;
        }
    }
    lastFedAspect = aspect;
    double sat = aspect.isPrimal() ? 1.4D : 1D;
    return sat * mult;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:27,代码来源:GrowingNodeBehavior.java

示例8: takeFromContainer

import thaumcraft.api.aspects.Aspect; //导入依赖的package包/类
@Override
public boolean takeFromContainer(Aspect aspect, int i) {
    if (!isInputTile()) return false;
    if (aspect == null || holdingAspect == null) return false;

    if (this.amount >= i && holdingAspect.equals(aspect)) {
        this.amount -= i;
        if (this.amount <= 0) {
            this.holdingAspect = null;
            this.amount = 0;
        }
        this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
        markDirty();
        return true;
    }
    return false;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:18,代码来源:TileAuraPylon.java

示例9: addToContainer

import thaumcraft.api.aspects.Aspect; //导入依赖的package包/类
@Override
public int addToContainer(Aspect aspect, int amount) {
    if (amount == 0) {
        return amount;
    }

    if (aspect == null) return 0;

    if (storedAmount < MAX_AMT) {
        int added = Math.min(amount, MAX_AMT - storedAmount);
        storedAmount += added;
        amount -= added;
        this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
        markDirty();
    }
    return amount;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:18,代码来源:TileAIShutdown.java

示例10: fillJar

import thaumcraft.api.aspects.Aspect; //导入依赖的package包/类
private void fillJar() {
    TileEntity te = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.DOWN);
    if (te != null) {
        IEssentiaTransport ic = (IEssentiaTransport) te;
        if (!ic.canOutputTo(ForgeDirection.UP)) {
            return;
        }
        Aspect ta = null;
        if (this.aspectFilter != null) {
            ta = this.aspectFilter;
        } else if ((this.aspect != null) && (this.amount > 0)) {
            ta = this.aspect;
        } else if ((ic.getEssentiaAmount(ForgeDirection.UP) > 0) &&
                (ic.getSuctionAmount(ForgeDirection.UP) < getSuctionAmount(ForgeDirection.DOWN)) && (getSuctionAmount(ForgeDirection.DOWN) >= ic.getMinimumSuction())) {
            ta = ic.getEssentiaType(ForgeDirection.UP);
        }
        if ((ta != null) && (ic.getSuctionAmount(ForgeDirection.UP) < getSuctionAmount(ForgeDirection.DOWN))) {
            addToContainer(ta, ic.takeEssentia(ta, 1, ForgeDirection.UP));
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:22,代码来源:TileBlockProtector.java

示例11: gemerateOre

import thaumcraft.api.aspects.Aspect; //导入依赖的package包/类
private void gemerateOre(BlockInfusedBlockOre block, World world, Random random, int chunkX, int chunkZ, int count,
		int chancesToSpawn, int minHeight, int maxHeight) {
	if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight)
		throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator");

	int heightDiff = maxHeight - minHeight + 1;
	for (int i = 0; i < chancesToSpawn; i++) {
		int x = chunkX * 16 + random.nextInt(16);
		int y = minHeight + random.nextInt(heightDiff);
		int z = chunkZ * 16 + random.nextInt(16);

		int md = random.nextInt(6);
		if (random.nextInt(3) == 0) {
			Aspect tag = BiomeHandler.getRandomBiomeTag(world.getBiomeGenForCoords(x, z).biomeID, random);
			if (tag == null) {
				md = random.nextInt(6);
			} else if (tag == Aspect.AIR)
				md = 0;
			else if (tag == Aspect.FIRE)
				md = 1;
			else if (tag == Aspect.WATER)
				md = 2;
			else if (tag == Aspect.EARTH)
				md = 3;
			else if (tag == Aspect.ORDER)
				md = 4;
			else if (tag == Aspect.ENTROPY)
				md = 5;
		}
		new WorldGenMinable(block, md, count, block.getBaseBlock()).generate(world, random, x, y, z);
	}
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:33,代码来源:InfusedOreGeneration.java

示例12: addInfusedOreAspect

import thaumcraft.api.aspects.Aspect; //导入依赖的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);
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:10,代码来源:TOThaum.java

示例13: executionCondition

import thaumcraft.api.aspects.Aspect; //导入依赖的package包/类
@Override
public boolean executionCondition(World world, ItemStack wand, EntityPlayer player, int x, int y, int z, int side,
		int event) {
	int meta = world.getBlockMetadata(x, y, z);
	return player.isSneaking()
			? ThaumUtils.isComplete(player, TOThaum.riRawCluster)
					&& ThaumcraftApiHelper.consumeVisFromWand(wand, player,
							new AspectList().add(primals[meta], TOConfig.generalWandVisCountPrimal * 100)
									.add(Aspect.ORDER, TOConfig.generalWandVisCountPrimal * 100),
							true, false)
			: ThaumcraftApiHelper.consumeVisFromWand(wand, player,
					new AspectList().add(Aspect.ENTROPY, TOConfig.generalWandVisCount * 100), true, false);
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:14,代码来源:TOInfusedOreWandTrigger.java

示例14: getResearchPrimaryTag

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

示例15: getAllAspects

import thaumcraft.api.aspects.Aspect; //导入依赖的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);
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:11,代码来源:ThaumcraftApiHelper.java


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