mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 19:59:49 +00:00
port to forestry 4.2
This commit is contained in:
1 parent
dbc5c1a564
commit
f969f63b66
3697 files changed
+78372
No files matched your search
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.genetics.gui;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import binnie.craftgui.core.Tooltip;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.ITooltip;
|
||||
import binnie.craftgui.minecraft.control.ControlItemDisplay;
|
||||
|
||||
public class ControlIndividualDisplay extends ControlItemDisplay implements ITooltip
|
||||
{
|
||||
public ControlIndividualDisplay(final IWidget parent, final float x, final float y, final IIndividual ind) {
|
||||
this(parent, x, y, 16.0f, ind);
|
||||
}
|
||||
|
||||
public ControlIndividualDisplay(final IWidget parent, final float x, final float y, final float size, final IIndividual ind) {
|
||||
super(parent, x, y, size);
|
||||
final BreedingSystem system = Binnie.Genetics.getSystem(ind.getGenome().getSpeciesRoot());
|
||||
this.setItemStack(system.getSpeciesRoot().getMemberStack(ind, system.getDefaultType()));
|
||||
this.setTooltip();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
final ItemStack stack = this.getItemStack();
|
||||
if (stack == null) {
|
||||
return;
|
||||
}
|
||||
final IIndividual ind = AlleleManager.alleleRegistry.getIndividual(stack);
|
||||
if (ind == null) {
|
||||
return;
|
||||
}
|
||||
tooltip.add(ind.getGenome().getPrimary().getName());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user