本文整理汇总了Java中forestry.api.genetics.AlleleManager类的典型用法代码示例。如果您正苦于以下问题:Java AlleleManager类的具体用法?Java AlleleManager怎么用?Java AlleleManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AlleleManager类属于forestry.api.genetics包,在下文中一共展示了AlleleManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: same
import forestry.api.genetics.AlleleManager; //导入依赖的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: getBeeParents
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
@ScriptCallable(returnTypes = ReturnType.TABLE, description = "Get possible mutations that results in given bee")
public List<Map<String, Object>> getBeeParents(IBeeHousing housing, @Arg(name = "childType", description = "The type of bee you want the parents for") String childType) {
ISpeciesRoot beeRoot = AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
if (beeRoot == null) return null;
List<Map<String, Object>> result = Lists.newArrayList();
childType = childType.toLowerCase(Locale.ENGLISH);
for (IMutation mutation : beeRoot.getMutations(false)) {
if (mutation.isSecret() && !Config.showHiddenMutations) continue;
final IAlleleSpecies species = getOffspringSpecies(mutation);
if (alleleNameMatches(species, childType)) {
result.add(serializeMutation(mutation, false));
}
}
return result;
}
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:19,代码来源:AdapterBeeHousing.java
示例3: getBeeChildren
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
@ScriptCallable(returnTypes = ReturnType.TABLE, description = "Get possible mutations that can be created with given bee")
public List<Map<String, Object>> getBeeChildren(IBeeHousing housing, @Arg(name = "parentYpe", description = "The type of bee you want the children for") String childType) {
ISpeciesRoot beeRoot = AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
if (beeRoot == null) return null;
List<Map<String, Object>> result = Lists.newArrayList();
childType = childType.toLowerCase(Locale.ENGLISH);
for (IMutation mutation : beeRoot.getMutations(false)) {
if (mutation.isSecret() && !Config.showHiddenMutations) continue;
if (alleleNameMatches(mutation.getAllele0(), childType) || alleleNameMatches(mutation.getAllele1(), childType)) {
result.add(serializeMutation(mutation, true));
}
}
return result;
}
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:18,代码来源:AdapterBeeHousing.java
示例4: readFromNBT
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
super.readFromNBT(nbttagcompound);
for (int i = 0; i < typeFilter.length; i++) {
typeFilter[i] = EnumFilterType.values()[nbttagcompound.getByte("TypeFilter" + i)];
}
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 3; j++) {
if (nbttagcompound.hasKey("GenomeFilterS" + i + "-" + j + "-" + 0)) {
genomeFilter[i][j][0] = AlleleManager.alleleRegistry.getAllele(nbttagcompound.getString("GenomeFilterS" + i + "-" + j + "-" + 0));
}
if (nbttagcompound.hasKey("GenomeFilterS" + i + "-" + j + "-" + 1)) {
genomeFilter[i][j][1] = AlleleManager.alleleRegistry.getAllele(nbttagcompound.getString("GenomeFilterS" + i + "-" + j + "-" + 1));
}
}
}
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:20,代码来源:PipeLogicPropolis.java
示例5: getBeeSpeciesCount
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
@Override
public int getBeeSpeciesCount() {
if (beeSpeciesCount < 0) {
beeSpeciesCount = 0;
Iterator it = AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet().iterator();
while (it.hasNext()) {
Entry<String, IAllele> entry = (Entry<String, IAllele>) it.next();
if (entry.getValue() instanceof IAlleleBeeSpecies)
if (((IAlleleBeeSpecies) entry.getValue()).isCounted()) {
beeSpeciesCount++;
}
}
}
return beeSpeciesCount;
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:17,代码来源:BreedingManager.java
示例6: readFromNBT
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
// Legacy
if (nbttagcompound.hasKey("PrimaryId")) {
primary = ((ILegacyHandler) AlleleManager.alleleRegistry).getFromLegacyMap(nbttagcompound.getInteger("PrimaryId"));
secondary = ((ILegacyHandler) AlleleManager.alleleRegistry).getFromLegacyMap(nbttagcompound.getInteger("SecondaryId"));
if (primary == null || secondary == null)
throw new RuntimeException("Legacy conversion of chromosome failed. Did one of your bee addons not update? No legacy mapping for ids: "
+ nbttagcompound.getInteger("PrimaryId") + " - " + nbttagcompound.getInteger("SecondaryId"));
return;
}
primary = AlleleManager.alleleRegistry.getAllele(nbttagcompound.getString(UID0_TAG));
secondary = AlleleManager.alleleRegistry.getAllele(nbttagcompound.getString(UID1_TAG));
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:19,代码来源:Chromosome.java
示例7: setItem
import forestry.api.genetics.AlleleManager; //导入依赖的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
示例8: registerDeprecatedAlleleReplacements
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
public static void registerDeprecatedAlleleReplacements() {
IAlleleRegistry registry = AlleleManager.alleleRegistry;
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeAttract", effectNodeEmpower);
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", effectNodeConversionPure);
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", effectNodeConversionTaint);
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", effectNodeEmpower);
registry.registerDeprecatedAlleleReplacement("magicbees.speciesTCAttractive", BeeSpecies.TC_EMPOWERING.getSpecies());
registry.registerDeprecatedAlleleReplacement("magicbees.speciesBMBloodyBMBloody", BeeSpecies.EARTHY.getSpecies());
registry.registerDeprecatedAlleleReplacement("magicbees.speciesBMBloodyBMBound", BeeSpecies.ARCANE.getSpecies());
}
开发者ID:MagicBees,项目名称:MagicBees,代码行数:12,代码来源:Allele.java
示例9: getBeeBreedingData
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
@Asynchronous
@ScriptCallable(returnTypes = ReturnType.TABLE, description = "Get the full breeding list thingy. Experimental!")
public List<Map<String, Object>> getBeeBreedingData(IBeeHousing housing) {
ISpeciesRoot beeRoot = AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
if (beeRoot == null) return null;
List<Map<String, Object>> result = Lists.newArrayList();
for (IMutation mutation : beeRoot.getMutations(false)) {
if (mutation.isSecret() && !Config.showHiddenMutations) continue;
final Map<String, Object> mutationMap = Maps.newHashMap();
try {
IAlleleSpecies allele1 = mutation.getAllele0();
if (allele1 != null) mutationMap.put(ALLELE_1, allele1.getName());
IAlleleSpecies allele2 = mutation.getAllele1();
if (allele2 != null) mutationMap.put(ALLELE_2, allele2.getName());
final IAlleleSpecies offspringSpecies = getOffspringSpecies(mutation);
mutationMap.put(MUTATION_RESULT, offspringSpecies.getName());
mutationMap.put(MUTATION_CHANCE, mutation.getBaseChance());
mutationMap.put(MUTATION_CONDITIONS, mutation.getSpecialConditions());
result.add(mutationMap);
} catch (Exception e) {
throw new RuntimeException(String.format("Failed to get bee breeding information from %s, collected data: %s", mutation, mutationMap), e);
}
}
return result;
}
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:31,代码来源:AdapterBeeHousing.java
示例10: listAllSpecies
import forestry.api.genetics.AlleleManager; //导入依赖的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
示例11: getMeta
import forestry.api.genetics.AlleleManager; //导入依赖的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
示例12: handleGenomeFilterChange
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
public void handleGenomeFilterChange(PacketPayload payload) {
if (!payload.stringPayload[0].equals("NULL")) {
genomeFilter[payload.intPayload[0]][payload.intPayload[1]][payload.intPayload[2]] = AlleleManager.alleleRegistry
.getAllele(payload.stringPayload[0]);
} else {
genomeFilter[payload.intPayload[0]][payload.intPayload[1]][payload.intPayload[2]] = null;
}
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:9,代码来源:PipeLogicPropolis.java
示例13: registerErsatzGenomes
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
private void registerErsatzGenomes() {
AlleleManager.ersatzSpecimen.put(new ItemStack(Block.leaves.blockID, 1, 0), new Tree(TreeTemplates.templateAsGenome(TreeTemplates.getOakTemplate())));
AlleleManager.ersatzSpecimen.put(new ItemStack(Block.leaves.blockID, 1, 1), new Tree(TreeTemplates.templateAsGenome(TreeTemplates.getSpruceTemplate())));
AlleleManager.ersatzSpecimen.put(new ItemStack(Block.leaves.blockID, 1, 2), new Tree(TreeTemplates.templateAsGenome(TreeTemplates.getBirchTemplate())));
AlleleManager.ersatzSpecimen.put(new ItemStack(Block.leaves.blockID, 1, 3), new Tree(TreeTemplates.templateAsGenome(TreeTemplates.getJungleTemplate())));
AlleleManager.ersatzSaplings.put(new ItemStack(Block.sapling.blockID, 1, 0), new Tree(TreeTemplates.templateAsGenome(TreeTemplates.getOakTemplate())));
AlleleManager.ersatzSaplings.put(new ItemStack(Block.sapling.blockID, 1, 1), new Tree(TreeTemplates.templateAsGenome(TreeTemplates.getSpruceTemplate())));
AlleleManager.ersatzSaplings.put(new ItemStack(Block.sapling.blockID, 1, 2), new Tree(TreeTemplates.templateAsGenome(TreeTemplates.getBirchTemplate())));
AlleleManager.ersatzSaplings.put(new ItemStack(Block.sapling.blockID, 1, 3), new Tree(TreeTemplates.templateAsGenome(TreeTemplates.getJungleTemplate())));
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:12,代码来源:PluginForestryArboriculture.java
示例14: registerBeeMutation
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
@Override
public void registerBeeMutation(IBeeMutation mutation) {
if(AlleleManager.alleleRegistry.isBlacklisted(mutation.getTemplate()[0].getUID()))
return;
if(AlleleManager.alleleRegistry.isBlacklisted(mutation.getAllele0().getUID()))
return;
if(AlleleManager.alleleRegistry.isBlacklisted(mutation.getAllele1().getUID()))
return;
beeMutations.add(mutation);
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:12,代码来源:BreedingManager.java
示例15: getSpecies
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
protected String[] getSpecies() {
List<String> species = new ArrayList<String>();
for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) {
if (allele instanceof IAlleleBeeSpecies) {
species.add(((IAlleleSpecies) allele).getName());
}
}
return species.toArray(new String[] {});
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:12,代码来源:CommandGiveBee.java
示例16: generateSpeciesListEntry
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
private String generateSpeciesListEntry(IAlleleBeeSpecies species, IApiaristTracker tracker) {
String discovered = "[ ]";
if(tracker.isDiscovered(species))
discovered = "[ X ]";
String blacklisted = "[ ]";
if(AlleleManager.alleleRegistry.isBlacklisted(species.getUID()))
blacklisted = "[ BL ]";
String notcounted = "[ ]";
if(!species.isCounted())
notcounted = "[ NC ]";
return String.format("%s %s %s\t%-40s %-20s %-20s", discovered, blacklisted, notcounted, species.getUID(), species.getName(), species.getAuthority());
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:14,代码来源:CommandBeekeepingMode.java
示例17: parseBeeBlacklist
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
private void parseBeeBlacklist(String list) {
String[] items = list.split("[;]+");
for (String item : items) {
if (item.isEmpty()) {
continue;
}
FMLCommonHandler.instance().getFMLLogger().finer("Blacklisting bee species identified by " + item);
AlleleManager.alleleRegistry.blacklistAllele(item);
}
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:13,代码来源:PluginForestryApiculture.java
示例18: postInit
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
@Override
public void postInit() {
try {
eeBlock1 = new ItemStack((Block) Class.forName("ee.EEBlock").getField("eeStone").get(null), 1, 8);
eeBlock2 = new ItemStack((Block) Class.forName("ee.EEBlock").getField("eeStone").get(null), 1, 9);
eeRelay2Class = Class.forName("ee.TileRelay2");
eeRelay2EMCField = eeRelay2Class.getField("scaledEnergy");
eeRelay3Class = Class.forName("ee.TileRelay3");
eeRelay3EMCField = eeRelay3Class.getField("scaledEnergy");
} catch (Exception ex) {
Proxies.log.fine("Necessary block/classes from EE were not found");
return;
}
IJubilanceProvider jubilanceProviderDarkened = new JubilanceReqRes(eeBlock1);
IJubilanceProvider jubilanceProviderReddened = new JubilanceReqRes(eeBlock2);
((AlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.speciesDarkened")).jubilanceProvider = jubilanceProviderDarkened;
((AlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.speciesReddened")).jubilanceProvider = jubilanceProviderReddened;
((AlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.speciesOmega")).jubilanceProvider = jubilanceProviderReddened;
darkenedA = new MutationEMC(Allele.speciesModest, Allele.speciesWintry, BeeTemplates.getDarkenedTemplate(), 100, eeBlock1, eeRelay2Class,
eeRelay2EMCField, 139264);
reddenedA = new MutationEMC(Allele.speciesDarkened, Allele.speciesTropical, BeeTemplates.getReddenedTemplate(), 100, eeBlock2, eeRelay3Class,
eeRelay3EMCField, 466944);
omegaA = new MutationEMC(Allele.speciesDarkened, Allele.speciesReddened, BeeTemplates.getOmegaTemplate(), 100, eeBlock2, eeRelay3Class,
eeRelay3EMCField, 933888).restrictBiome(BiomeGenBase.hell.biomeID).restrictBiome(BiomeGenBase.desert.biomeID);
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:33,代码来源:PluginEE.java
示例19: AlleleSpecies
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
public AlleleSpecies(String uid, boolean isDominant, String name, IClassification branch, String binomial, int primaryColor, int secondaryColor) {
super(uid, isDominant, true);
this.branch = branch;
this.name = name;
this.binomial = binomial;
this.primaryColor = primaryColor;
this.secondaryColor = secondaryColor;
if(Localization.instance.hasMapping("description." + uid))
description = StringUtil.localize("description." + uid);
AlleleManager.alleleRegistry.registerAllele(this);
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:15,代码来源:AlleleSpecies.java
示例20: Allele
import forestry.api.genetics.AlleleManager; //导入依赖的package包/类
protected Allele(String uid, boolean isDominant, boolean skipRegister) {
this.uid = uid;
this.isDominant = isDominant;
if (!skipRegister) {
AlleleManager.alleleRegistry.registerAllele(this);
}
}
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:9,代码来源:Allele.java
注:本文中的forestry.api.genetics.AlleleManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论