當前位置: 首頁>>代碼示例>>Java>>正文


Java AspectList類代碼示例

本文整理匯總了Java中thaumcraft.api.aspects.AspectList的典型用法代碼示例。如果您正苦於以下問題:Java AspectList類的具體用法?Java AspectList怎麽用?Java AspectList使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AspectList類屬於thaumcraft.api.aspects包,在下文中一共展示了AspectList類的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);
}
 
開發者ID:sameer,項目名稱:ExtraUtilities,代碼行數:24,代碼來源:ThaumcraftHelper.java

示例2: ResearchItem

import thaumcraft.api.aspects.AspectList; //導入依賴的package包/類
public ResearchItem(String key, String category, AspectList tags, int col, int row, int complex, ResourceLocation icon) {
	this.key = key;
	this.category = category;
	this.tags = tags;
	this.icon_resource = icon;
	this.icon_item = null;
	this.displayColumn = col;
	this.displayRow = row;
	this.complexity = complex;
	if (complexity < 1) {
		this.complexity = 1;
	}
	if (complexity > 3) {
		this.complexity = 3;
	}
}
 
開發者ID:PrincessRTFM,項目名稱:TweakCraft,代碼行數:17,代碼來源:ResearchItem.java

示例3: exists

import thaumcraft.api.aspects.AspectList; //導入依賴的package包/類
/**
 * Checks to see if the passed item/block already has aspects associated with it.
 * 
 * @param id
 * @param meta
 * @return
 */
public static boolean exists(Item item, int meta) {
	AspectList tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, meta));
	if (tmp == null) {
		tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, OreDictionary.WILDCARD_VALUE));
		if ( (meta == OreDictionary.WILDCARD_VALUE) && (tmp == null)) {
			int index = 0;
			do {
				tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, index));
				index++ ;
			}
			while ( (index < 16) && (tmp == null));
		}
		if (tmp == null) {
			return false;
		}
	}
	return true;
}
 
開發者ID:PrincessRTFM,項目名稱:TweakCraft,代碼行數:26,代碼來源:ThaumcraftApi.java

示例4: 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();
}
 
開發者ID:PrincessRTFM,項目名稱:TweakCraft,代碼行數:23,代碼來源:CrucibleRecipe.java

示例5: matches

import thaumcraft.api.aspects.AspectList; //導入依賴的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

示例6: FocusUpgradeType

import thaumcraft.api.aspects.AspectList; //導入依賴的package包/類
public FocusUpgradeType(int id, ResourceLocation icon, String name, String text, AspectList aspects) {
	this.id = (short) id;
	this.icon = icon;
	this.name = name;
	this.text = text;
	this.aspects = aspects;
	if ( (id < types.length) && (types[id] != null)) {
		LogManager.getLogger("THAUMCRAFT").fatal("Focus Upgrade id " + id + " already occupied. Ignoring.");
		return;
	}
	// allocate space
	if (id >= types.length) {
		FocusUpgradeType[] temp = new FocusUpgradeType[id + 1];
		System.arraycopy(types, 0, temp, 0, types.length);
		types = temp;
	}
	types[id] = this;
}
 
開發者ID:PrincessRTFM,項目名稱:TweakCraft,代碼行數:19,代碼來源:FocusUpgradeType.java

示例7: 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;
}
 
開發者ID:makeoo,項目名稱:Gadomancy,代碼行數:20,代碼來源:ItemBlockRemoteJar.java

示例8: 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();
}
 
開發者ID:Magicnation,項目名稱:Arcane-Biennial,代碼行數:24,代碼來源:CrucibleRecipe.java

示例9: exists

import thaumcraft.api.aspects.AspectList; //導入依賴的package包/類
/**
 * Checks to see if the passed item/block already has aspects associated with it.
 * @param id
 * @param meta
 * @return 
 */
public static boolean exists(Item item, int meta) {
	AspectList tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item,meta));
	if (tmp==null) {
		tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item,OreDictionary.WILDCARD_VALUE));
		if (meta==OreDictionary.WILDCARD_VALUE && tmp==null) {
			int index=0;
			do {
				tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item,index));
				index++;
			} while (index<16 && tmp==null);
		}
		if (tmp==null) return false;
	}
	
	return true;
}
 
開發者ID:Brandomine,項目名稱:Augury,代碼行數:23,代碼來源:ThaumcraftApi.java

示例10: FocusUpgradeType

import thaumcraft.api.aspects.AspectList; //導入依賴的package包/類
public FocusUpgradeType(int id, ResourceLocation icon, String name, String text, AspectList aspects) {
	this.id = (short) id;	
	this.icon = icon;
	this.name = name;
	this.text = text;
	this.aspects = aspects;
	
	if (id<types.length && types[id]!=null) {
		LogManager.getLogger("THAUMCRAFT").fatal("Focus Upgrade id "+id+" already occupied. Ignoring.");
		return;
	}
	
	// allocate space
	if (id>=types.length) {
		FocusUpgradeType[] temp = new FocusUpgradeType[id+1];
		System.arraycopy(types, 0, temp, 0, id);
		types = temp;
	}
	
	types[id] = this;
}
 
開發者ID:Magicnation,項目名稱:Arcane-Biennial,代碼行數:22,代碼來源:FocusUpgradeType.java

示例11: FocusUpgradeType

import thaumcraft.api.aspects.AspectList; //導入依賴的package包/類
public FocusUpgradeType(int id, ResourceLocation icon, String name, String text, AspectList aspects)
{
    this.id = (short) id;
    this.icon = icon;
    this.name = name;
    this.text = text;
    this.aspects = aspects;

    if(id < types.length && types[id] != null)
    {
        LogManager.getLogger("THAUMCRAFT").fatal("Focus Upgrade id " + id + " already occupied. Ignoring.");
        return;
    }

    // allocate space
    if(id >= types.length)
    {
        FocusUpgradeType[] temp = new FocusUpgradeType[id + 1];
        System.arraycopy(types, 0, temp, 0, types.length);
        types = temp;
    }

    types[id] = this;
}
 
開發者ID:J3FF97,項目名稱:Steel-Industries,代碼行數:25,代碼來源:FocusUpgradeType.java

示例12: scheduleManipulation

import thaumcraft.api.aspects.AspectList; //導入依賴的package包/類
private void scheduleManipulation() {
    float overSized = calcOversize(NODE_MANIPULATION_POSSIBLE_WORK_START);

    workTick = 0;
    isWorking = false;
    workAspectList = new AspectList();

    TileEntity te = worldObj.getTileEntity(xCoord, yCoord + 2, zCoord);
    if(te == null || !(te instanceof INode)) return;
    INode node = (INode) te;
    int areaRange = NODE_MANIPULATION_WORK_ASPECT_CAP - NODE_MANIPULATION_POSSIBLE_WORK_START;
    int percChanceForBetter = 0;
    if(areaRange > 0) {
        percChanceForBetter = (int) ((overSized / ((float) areaRange)) * 100);
    }
    NodeManipulatorResult result;
    do {
        result = NodeManipulatorResultHandler.getRandomResult(worldObj, node, percChanceForBetter);
    } while (!result.affect(worldObj, node));
    PacketStartAnimation packet = new PacketStartAnimation(PacketStartAnimation.ID_SPARKLE_SPREAD, xCoord, yCoord + 2, zCoord);
    PacketHandler.INSTANCE.sendToAllAround(packet, getTargetPoint(32));
    worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
    worldObj.markBlockForUpdate(xCoord, yCoord + 2, zCoord);
    markDirty();
    ((TileEntity) node).markDirty();
}
 
開發者ID:makeoo,項目名稱:Gadomancy,代碼行數:27,代碼來源:TileNodeManipulator.java

示例13: 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);
}
 
開發者ID:MJaroslav,項目名稱:ThaumOres,代碼行數:10,代碼來源:TOThaum.java

示例14: executionCondition

import thaumcraft.api.aspects.AspectList; //導入依賴的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

示例15: 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);
}
 
開發者ID:PrincessRTFM,項目名稱:TweakCraft,代碼行數:11,代碼來源:ThaumcraftApiHelper.java


注:本文中的thaumcraft.api.aspects.AspectList類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。