use of forestry.api.apiculture.IBee in project ForestryMC by ForestryMC.
the class Bee method spawnDrones.
@Override
public List<IBee> spawnDrones(IBeeHousing housing) {
World world = housing.getWorldObj();
// We need a mated queen to produce offspring.
if (mate == null) {
return Collections.emptyList();
}
List<IBee> bees = new ArrayList<>();
BlockPos housingPos = housing.getCoordinates();
int toCreate = BeeManager.beeRoot.getBeekeepingMode(world).getFinalFertility(this, world, housingPos);
if (toCreate <= 0) {
toCreate = 1;
}
for (int i = 0; i < toCreate; i++) {
IBee offspring = createOffspring(housing, mate, 0);
offspring.setIsNatural(true);
bees.add(offspring);
}
return bees;
}
use of forestry.api.apiculture.IBee in project ForestryMC by ForestryMC.
the class BeeAlyzerPlugin method drawAnalyticsPage3.
@SideOnly(Side.CLIENT)
@Override
public void drawAnalyticsPage3(GuiScreen gui, ItemStack itemStack) {
if (gui instanceof GuiAlyzer) {
GuiAlyzer guiAlyzer = (GuiAlyzer) gui;
IBee bee = BeeManager.beeRoot.getMember(itemStack);
if (bee == null) {
return;
}
TextLayoutHelper textLayout = guiAlyzer.getTextLayout();
WidgetManager widgetManager = guiAlyzer.getWidgetManager();
textLayout.startPage(GuiAlyzer.COLUMN_0, GuiAlyzer.COLUMN_1, GuiAlyzer.COLUMN_2);
textLayout.drawLine(Translator.translateToLocal("for.gui.beealyzer.produce") + ":", GuiAlyzer.COLUMN_0);
textLayout.newLine();
int x = GuiAlyzer.COLUMN_0;
for (ItemStack stack : bee.getProduceList()) {
widgetManager.add(new ItemStackWidget(widgetManager, x, textLayout.getLineY(), stack));
x += 18;
if (x > 148) {
x = GuiAlyzer.COLUMN_0;
textLayout.newLine();
}
}
textLayout.newLine();
textLayout.newLine();
textLayout.newLine();
textLayout.newLine();
textLayout.drawLine(Translator.translateToLocal("for.gui.beealyzer.specialty") + ":", GuiAlyzer.COLUMN_0);
textLayout.newLine();
x = GuiAlyzer.COLUMN_0;
for (ItemStack stack : bee.getSpecialtyList()) {
widgetManager.add(new ItemStackWidget(widgetManager, x, textLayout.getLineY(), stack));
x += 18;
if (x > 148) {
x = GuiAlyzer.COLUMN_0;
textLayout.newLine();
}
}
textLayout.endPage();
}
}
use of forestry.api.apiculture.IBee in project ForestryMC by ForestryMC.
the class BeeRoot method registerTemplate.
@Override
public void registerTemplate(String identifier, IAllele[] template) {
IBeeGenome beeGenome = BeeManager.beeRoot.templateAsGenome(template);
IBee bee = new Bee(beeGenome);
beeTemplates.add(bee);
speciesTemplates.put(identifier, template);
}
use of forestry.api.apiculture.IBee in project ForestryMC by ForestryMC.
the class WorldgenBeekeepingLogic method doBeeFX.
@Override
@SideOnly(Side.CLIENT)
public void doBeeFX() {
IBee queen = housing.getContainedBee();
queen.doFX(effectData, housing);
}
use of forestry.api.apiculture.IBee in project ForestryMC by ForestryMC.
the class Bee method mate.
@Override
public void mate(IIndividual individual) {
if (!(individual instanceof IBee)) {
return;
}
IBee drone = (IBee) individual;
mate = drone.getGenome();
}
Aggregations