• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IIndividual类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: same

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
protected boolean same(ItemStack stack1, ItemStack stack2) {
	ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(stack1);
	if (root == null || !root.isMember(stack2)) {
		return false;
	}

	if (type == PrecisionModes.Type.MATCH) {
		if (root.getType(stack1) != root.getType(stack2)) {
			return false;
		}
	}

	IIndividual individual1 = root.getMember(stack1);
	IIndividual individual2 = root.getMember(stack2);

	try {
		return same(individual1, individual2);
	} catch (NullPointerException e) {
		return false;
	}
}
 
开发者ID:Vexatos,项目名称:BeeSpecific,代码行数:23,代码来源:SpeciesSpecificPrecisionType.java


示例2: callMethod

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws LuaException, InterruptedException {
	if (!Config.enableAnalyzers)
		throw new LuaException("Analyzers have been disabled");
	switch (method) {
		case 0:
			ISpeciesRoot root = getRoot();
			ItemStack stack = getStackInSlot(0);
			if (stack == null || !root.isMember(stack))
				return new Object[] {false};
			IIndividual individual = root.getMember(stack);
			if (!individual.isAnalyzed())
				return new Object[] {null};
			HashMap<String, Object> ret = new HashMap<String, Object>();
			addGenome(stack, individual.getGenome(), ret);
			return new Object[] {ret};
		case 1:
			ItemStack specimen = getStackInSlot(0);
			if (specimen == null || !getRoot().isMember(specimen))
				return new Object[] {false};
			return new Object[] {true};
	}
	return new Object[]{};
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:25,代码来源:TileEntityAnalyzer.java


示例3: setItem

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Nonnull
private ItemStack setItem(int slot, @Nonnull ItemStack itemStack) {
  if (slot < 0 || slot >= items.size()) {
    return ItemStack.EMPTY;
  }

  ItemStack prevStack = items.get(slot);
  if (!prevStack.isEmpty()) {
    this.primarySpeciesUids[slot] = null;
    this.secondarySpeciesUids[slot] = null;
  }

  items.set(slot, itemStack);

  ISpeciesRoot speciesRoot = AlleleManager.alleleRegistry.getSpeciesRoot(itemStack);
  if (speciesRoot != null) {
    IIndividual member = speciesRoot.getMember(itemStack);
    if (member != null) {
      IGenome genome = member.getGenome();
      primarySpeciesUids[slot] = genome.getPrimary().getUID();
      secondarySpeciesUids[slot] = genome.getSecondary().getUID();
    }
  }

  return prevStack;
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:27,代码来源:SpeciesItemFilter.java


示例4: listAllSpecies

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@ScriptCallable(returnTypes = ReturnType.TABLE, description = "Get all known bees species")
public List<Map<String, String>> listAllSpecies(IBeeHousing housing) {
	ISpeciesRoot beeRoot = AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
	if (beeRoot == null) return null;

	final Set<IAlleleSpecies> allSpecies = Sets.newTreeSet(alleleCompatator);

	// approach 1: parents and children of all mutations
	for (IMutation mutation : beeRoot.getMutations(false)) {
		allSpecies.add(mutation.getAllele0());
		allSpecies.add(mutation.getAllele1());
		allSpecies.add(getOffspringSpecies(mutation));
	}

	// approach 2: template bees
	for (IIndividual individual : beeRoot.getIndividualTemplates()) {
		final IGenome genome = individual.getGenome();
		allSpecies.add(genome.getPrimary()); // secondary is same as primary
	}

	// TODO approach 3
	// beeRoot.getRegisteredAlleles(EnumBeeChromosome.SPECIES) (Forestry 4.2 API)

	final List<Map<String, String>> result = Lists.newArrayList();

	for (IAlleleSpecies allele : allSpecies)
		if (!allele.isSecret() || Config.showHiddenBees) result.add(serializeAllele(allele));

	return result;
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:31,代码来源:AdapterBeeHousing.java


示例5: getMeta

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
public Object getMeta(Item target, ItemStack stack) {
	if (AlleleManager.alleleRegistry != null) {
		IIndividual ind = AlleleManager.alleleRegistry.getIndividual(stack);
		if (ind != null) return ConverterIIndividual.describeIndividual(ind);
	}

	return null;
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:10,代码来源:IndividualMetaProvider.java


示例6: canMateWith

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
public boolean canMateWith(IIndividual individual) {
	if(getTree() == null)
		return false;
	if(getTree().getMate() != null)
		return false;

	return !getTree().getGenome().isGeneticEqual(individual.getGenome());
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:10,代码来源:TileLeaves.java


示例7: mateWith

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
public void mateWith(IIndividual individual) {
	if(getTree() == null)
		return;
	
	getTree().mate((ITree)individual);
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:8,代码来源:TileLeaves.java


示例8: hasEffect

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
public boolean hasEffect(ItemStack itemstack) {
	if(!itemstack.hasTagCompound())
		return false;
	
	IIndividual individual = new Tree(itemstack.getTagCompound());
	if (individual.hasEffect())
		return true;
	else
		return false;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:11,代码来源:ItemGermlingGE.java


示例9: getItemDisplayName

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
public String getItemDisplayName(ItemStack itemstack) {
	if (!itemstack.hasTagCompound())
		return "Unknown";
	IIndividual individual = new Tree(itemstack.getTagCompound());
	return individual.getDisplayName() + " " + type.getName();
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:8,代码来源:ItemGermlingGE.java


示例10: addCreativeItems

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
public void addCreativeItems(List itemList, boolean hideSecrets) {
	for (IIndividual individual : BreedingManager.treeTemplates) {
		// Don't show secrets unless ordered to.
		if (hideSecrets && individual.isSecret() && !Defaults.DEBUG) {
			continue;
		}

		NBTTagCompound nbttagcompound = new NBTTagCompound();
		ItemStack someStack = new ItemStack(this);
		individual.writeToNBT(nbttagcompound);
		someStack.setTagCompound(nbttagcompound);
		itemList.add(someStack);
	}
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:15,代码来源:ItemGermlingGE.java


示例11: registerPrincess

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
public void registerPrincess(IIndividual bee) {

	princessesTotal++;
	IAlleleSpecies primary = bee.getGenome().getPrimary();
	IAlleleSpecies secondary = bee.getGenome().getSecondary();

	registerSpecies(primary);
	registerSpecies(secondary);
	markDirty();
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:12,代码来源:ApiaristTracker.java


示例12: registerDrone

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
public void registerDrone(IIndividual bee) {
	dronesTotal++;
	IAlleleSpecies primary = bee.getGenome().getPrimary();
	IAlleleSpecies secondary = bee.getGenome().getSecondary();

	registerSpecies(primary);
	registerSpecies(secondary);
	markDirty();
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:11,代码来源:ApiaristTracker.java


示例13: hasEffect

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
public boolean hasEffect(ItemStack itemstack) {
	IIndividual individual = new Bee(itemstack.getTagCompound());
	if (individual.hasEffect())
		return true;
	else
		return false;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:9,代码来源:ItemBeeGE.java


示例14: addCreativeItems

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
public void addCreativeItems(List itemList, boolean hideSecrets) {

		for (IIndividual individual : BreedingManager.beeTemplates) {
			// Don't show secret bees unless ordered to.
			if (hideSecrets && individual.isSecret() && !Defaults.DEBUG) {
				continue;
			}

			NBTTagCompound nbttagcompound = new NBTTagCompound();
			ItemStack someStack = new ItemStack(this);
			individual.writeToNBT(nbttagcompound);
			someStack.setTagCompound(nbttagcompound);
			itemList.add(someStack);
		}
	}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:16,代码来源:ItemBeeGE.java


示例15: addInformation

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) {

	if (itemstack.getTagCompound() == null)
		return;

	IIndividual individual = new Bee(itemstack.getTagCompound());
	individual.addTooltip(list);
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:10,代码来源:ItemBeeGE.java


示例16: isGeneticEqual

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
public boolean isGeneticEqual(IIndividual other) {
	if(!(other instanceof ITree))
		return false;
	
	ITree tree = (ITree)other;
	return getGenome().isGeneticEqual(tree.getGenome());
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:9,代码来源:Individual.java


示例17: getIndividual

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
public IIndividual getIndividual(ItemStack stack) {
	IIndividual individual = null;
	if(BeeManager.beeInterface != null)
		individual = BeeManager.beeInterface.getBee(stack);
	if(individual == null && TreeManager.treeInterface != null)
		individual = TreeManager.treeInterface.getTree(stack);
	
	return individual;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:10,代码来源:AlleleRegistry.java


示例18: drawRow

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
protected final void drawRow(String text0, String text1, String text2, IIndividual individual, Enum chromosome) {
	drawRow(
			text0, text1, text2,
			fontColor.get("gui.screen"),
			getColorCoding(individual.getGenome().getActiveAllele(chromosome.ordinal()).isDominant()),
			getColorCoding(individual.getGenome().getInactiveAllele(chromosome.ordinal()).isDominant())
			);
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:9,代码来源:GuiAlyzer.java


示例19: affectProducts

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
	return products;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:5,代码来源:FlowerProviderThaumcraftFlower.java


示例20: growFlower

import forestry.api.genetics.IIndividual; //导入依赖的package包/类
@Override
@Deprecated
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
	return growFlower(world, x, y, z);
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:6,代码来源:FlowerProviderThaumcraftFlower.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TenantContext类代码示例发布时间:2022-05-22
下一篇:
Java ResourceStatusTypeProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap