out.put("chance", mutation.getBaseChance()); IChromosomeType[] karyotype = mutation.getRoot().getKaryotype(); Map<String, Object> results = Maps.newHashMapWithExpectedSize(karyotype.length);
@Nullable public IElementGroup createMutation(int x, int y, int width, int height, IMutation mutation, IAllele species, IBreedingTracker breedingTracker) { if (breedingTracker.isDiscovered(mutation)) { PaneLayout element = new PaneLayout(x, y, width, height); ISpeciesRoot speciesRoot = mutation.getRoot(); int speciesIndex = speciesRoot.getSpeciesChromosomeType().ordinal(); IDatabasePlugin plugin = mutation.getRoot().getSpeciesPlugin(); Map<String, ItemStack> iconStacks = plugin.getIndividualStacks(); ItemStack partner = iconStacks.get(mutation.getPartner(species).getUID()); IAllele resultAllele = mutation.getTemplate()[speciesIndex]; ItemStack result = iconStacks.get(resultAllele.getUID()); element.add(new ItemElement(0, 0, partner), new ItemElement(33, 0, result)); createProbabilityArrow(element, mutation, 18, 4, breedingTracker); return element; } // Do not display secret undiscovered mutations. if (mutation.isSecret()) { return null; } return createUnknownMutationGroup(x, y, width, height, mutation, breedingTracker); }
@Nullable public IElementGroup createMutationResultant(int x, int y, int width, int height, IMutation mutation, IBreedingTracker breedingTracker) { if (breedingTracker.isDiscovered(mutation)) { IElementGroup element = new PaneLayout(x, y, width, height); IAlyzerPlugin plugin = mutation.getRoot().getAlyzerPlugin(); Map<String, ItemStack> iconStacks = plugin.getIconStacks(); ItemStack firstPartner = iconStacks.get(mutation.getAllele0().getUID()); ItemStack secondPartner = iconStacks.get(mutation.getAllele1().getUID()); element.add(new ItemElement(0, 0, firstPartner), createProbabilityAdd(mutation, 21, 4), new ItemElement(33, 0, secondPartner)); return element; } // Do not display secret undiscovered mutations. if (mutation.isSecret()) { return null; } return createUnknownMutationGroup(x, y, width, height, mutation); }
public void drawMutationInfo(IMutation combination, IAllele species, int x, IBreedingTracker breedingTracker) { Map<String, ItemStack> iconStacks = combination.getRoot().getAlyzerPlugin().getIconStacks(); ItemStack partnerBee = iconStacks.get(combination.getPartner(species).getUID()); widgetManager.add(new ItemStackWidget(widgetManager, x, textLayout.getLineY(), partnerBee)); drawProbabilityArrow(combination, guiLeft + x + 18, guiTop + textLayout.getLineY() + 4, breedingTracker); IAllele result = combination.getTemplate()[EnumBeeChromosome.SPECIES.ordinal()]; ItemStack resultBee = iconStacks.get(result.getUID()); widgetManager.add(new ItemStackWidget(widgetManager, x + 33, textLayout.getLineY(), resultBee)); }
@Override protected void onIndexUpdate(int index, IMutation mutation) { ISpeciesRoot root = mutation.getRoot(); // Collection<String> conditions = mutation.getSpecialConditions(); String conditionText; if (!conditions.isEmpty()) { conditionText = String.format("[%.0f%%]", mutation.getBaseChance()); } else { conditionText = String.format("%.0f%%", mutation.getBaseChance()); } selectedElement.label(conditionText, 58, 0, -1, 12, GuiElementAlignment.TOP_LEFT, GuiConstants.BLACK_STYLE).addTooltip(conditions); selectedElement.drawable(62, 6, MUTATION_ARROW).addTooltip(conditions); // selectedElement.item(1, 1, root.getMemberStack(mutation.getAllele0(), root.getTypeForMutation(0))); selectedElement.item(40, 1, root.getMemberStack(mutation.getAllele1(), root.getTypeForMutation(1))); selectedElement.item(85, 1, root.getMemberStack(mutation.getTemplate(), root.getTypeForMutation(2))); } }
public static ResearchNote createMutationNote(GameProfile researcher, IMutation mutation) { NBTTagCompound compound = new NBTTagCompound(); compound.setString("ROT", mutation.getRoot().getUID()); compound.setString("AL0", mutation.getAllele0().getUID()); compound.setString("AL1", mutation.getAllele1().getUID()); compound.setString("RST", mutation.getTemplate()[0].getUID()); return new ResearchNote(researcher, MUTATION, compound); }
IBreedingTracker tracker = encoded.getRoot().getBreedingTracker(world, player.getGameProfile()); if (tracker.isResearched(encoded)) { player.sendMessage(new TextComponentTranslation("for.chat.cannotmemorizeagain"));