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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
package binnie.extrabees.gui.database;
import binnie.Binnie;
import binnie.core.BinnieCore;
import binnie.core.genetics.ManagerGenetics;
import binnie.core.proxy.BinnieProxy;
import binnie.craftgui.controls.core.Control;
import binnie.craftgui.core.Attribute;
import binnie.craftgui.core.CraftGUI;
import binnie.craftgui.core.ITooltip;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.core.Tooltip;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.core.renderer.Renderer;
import binnie.craftgui.resource.minecraft.CraftGUITexture;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeRoot;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.world.biome.BiomeGenBase;
public class ControlBiomes
extends Control
implements ITooltip
{
public ControlBiomes(IWidget parent, int x, int y, int width, int height)
{
super(parent, x, y, width * 16, height * 16);
addAttribute(Attribute.MouseOver);
}
List<Integer> tolerated = new ArrayList();
public void getTooltip(Tooltip list)
{
if (this.tolerated.isEmpty()) {
return;
}
int x = (int)(getRelativeMousePosition().x() / 16.0F);
int y = (int)(getRelativeMousePosition().y() / 16.0F);
int i = x + y * 8;
if (i < this.tolerated.size()) {
list.add(BiomeGenBase.getBiome(((Integer)this.tolerated.get(i)).intValue()).biomeName);
}
}
public void onRenderForeground()
{
for (int i = 0; i < this.tolerated.size(); i++)
{
int x = i % 8 * 16;
int y = i / 8 * 16;
if (BiomeGenBase.getBiome(i) != null) {
CraftGUI.Render.colour(BiomeGenBase.getBiome(i).color);
}
CraftGUI.Render.texture(CraftGUITexture.Button, new IArea(x, y, 16.0F, 16.0F));
}
}
public void setSpecies(IAlleleBeeSpecies species)
{
this.tolerated.clear();
if (species == null) {
return;
}
IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome);
}
}
|