當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。