use of binnie.genetics.api.ITreeBreedingSystem in project Binnie by ForestryMC.
the class PageWood method onValueChanged.
@Override
public void onValueChanged(final ItemStack species) {
this.deleteAllChildren();
final WindowAbstractDatabase database = Window.get(this);
new ControlText(this, new Area(0, 0, this.getSize().xPos(), 24), this.getValue().toString(), TextJustification.MIDDLE_CENTER);
ITreeBreedingSystem breedingSystem = (ITreeBreedingSystem) database.getBreedingSystem();
final Collection<IAlleleSpecies> trees = breedingSystem.getTreesThatHaveWood(species, database.isMaster(), database.getWorld(), database.getUsername());
new ControlSpeciesBox(this, 4, 24, this.getSize().xPos() - 8, this.getSize().yPos() - 4 - 24).setOptions(trees);
}
use of binnie.genetics.api.ITreeBreedingSystem in project Binnie by ForestryMC.
the class PageFruit method onValueChanged.
@Override
public void onValueChanged(final ItemStack species) {
this.deleteAllChildren();
final WindowAbstractDatabase database = Window.get(this);
new ControlText(this, new Area(0, 0, this.getSize().xPos(), 24), I18N.localise("extratrees.gui.database.tab.fruit." + (this.treesThatBearFruit ? "natural" : "potential")), TextJustification.MIDDLE_CENTER);
ITreeBreedingSystem breedingSystem = (ITreeBreedingSystem) database.getBreedingSystem();
final Collection<IAlleleSpecies> trees;
if (this.treesThatBearFruit) {
trees = breedingSystem.getTreesThatBearFruit(species, database.isMaster(), database.getWorld(), database.getUsername());
} else {
trees = breedingSystem.getTreesThatCanBearFruit(species, database.isMaster(), database.getWorld(), database.getUsername());
}
new ControlSpeciesBox(this, 4, 24, this.getSize().xPos() - 8, this.getSize().yPos() - 4 - 24).setOptions(trees);
}
use of binnie.genetics.api.ITreeBreedingSystem in project Binnie by ForestryMC.
the class WindowArboristDatabase method addTabs.
@Override
@SideOnly(Side.CLIENT)
protected void addTabs() {
new PageSpeciesOverview(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.overview"));
new PageSpeciesTreeGenome(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.genome"));
new PageSpeciesClassification(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.classification"));
new PageSpeciesResultant(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.resultant"));
new PageSpeciesMutations(this.getInfoPages(Mode.SPECIES), new DatabaseTab(ExtraTrees.instance, "species.further"));
new PageBranchOverview(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraTrees.instance, "branches.overview"));
new PageBranchSpecies(this.getInfoPages(Mode.BRANCHES), new DatabaseTab(ExtraTrees.instance, "branches.species"));
new PageBreeder(this.getInfoPages(Mode.BREEDER), this.getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder"));
this.createMode(TreeMode.FRUIT, new ModeWidgets(TreeMode.FRUIT, this, (area, modePage) -> {
ControlListBox<ItemStack> controlListBox = new ModeControlListBox(modePage, area);
ITreeBreedingSystem breedingSystem = this.getBreedingSystem();
controlListBox.setOptions(breedingSystem.getAllFruits());
return controlListBox;
}));
this.createMode(TreeMode.WOOD, new ModeWidgets(TreeMode.WOOD, this, (area, modePage) -> {
ControlListBox<ItemStack> controlListBox = new ModeControlListBox(modePage, area);
ITreeBreedingSystem breedingSystem = this.getBreedingSystem();
controlListBox.setOptions(breedingSystem.getAllWoods());
return controlListBox;
}));
this.createMode(TreeMode.PLANKS, new ModeWidgets(TreeMode.PLANKS, this, (area, modePage) -> {
ControlListBox<ItemStack> controlListBox = new ModeControlListBox(modePage, area);
List<ItemStack> planks = WoodManager.getAllPlankTypes().stream().map(IDesignMaterial::getStack).collect(Collectors.toList());
controlListBox.setOptions(planks);
return controlListBox;
}));
new PageFruit(this.getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.natural"), true);
new PageFruit(this.getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.potential"), false);
new PageWood(this.getInfoPages(TreeMode.WOOD), new DatabaseTab(ExtraTrees.instance, "wood.natural"));
new PagePlanksOverview(this.getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.overview"));
new PagePlanksTrees(this.getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.natural"));
}
Aggregations