当前位置: 首页>>代码示例>>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;未经允许,请勿转载。