aboutsummaryrefslogtreecommitdiff
path: root/src/Java/binnie/craftgui/extratrees/dictionary/PageWood.java
blob: e7e80a1456875bce1339ef1037e1130b5b8e4b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package binnie.craftgui.extratrees.dictionary;

import binnie.core.genetics.TreeBreedingSystem;
import binnie.craftgui.controls.ControlText;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.core.geometry.TextJustification;
import binnie.craftgui.mod.database.ControlSpeciesBox;
import binnie.craftgui.mod.database.DatabaseTab;
import binnie.craftgui.mod.database.PageAbstract;
import binnie.craftgui.mod.database.WindowAbstractDatabase;
import forestry.api.genetics.IAlleleSpecies;
import java.util.Collection;
import net.minecraft.item.ItemStack;

public class PageWood
  extends PageAbstract<ItemStack>
{
  public PageWood(IWidget parent, DatabaseTab tab)
  {
    super(parent, tab);
  }
  
  public void onValueChanged(ItemStack species)
  {
    deleteAllChildren();
    WindowAbstractDatabase database = (WindowAbstractDatabase)WindowAbstractDatabase.get(this);
    new ControlText(this, new IArea(0.0F, 0.0F, size().x(), 24.0F), ((DatabaseTab)getValue()).toString(), TextJustification.MiddleCenter);
    


    Collection<IAlleleSpecies> trees = ((TreeBreedingSystem)database.getBreedingSystem()).getTreesThatHaveWood(species, database.isNEI(), database.getWorld(), database.getUsername());
    



    new ControlSpeciesBox(this, 4.0F, 24.0F, size().x() - 8.0F, size().y() - 4.0F - 24.0F).setOptions(trees);
  }
}