use of forestry.api.apiculture.IBeeRoot in project ForestryMC by ForestryMC.
the class ItemInventoryImprinter method getSelectedBee.
public IBee getSelectedBee() {
IBeeRoot beeRoot = BeeManager.beeRoot;
List<IBee> individualTemplates = beeRoot.getIndividualTemplates();
Map<String, IAllele[]> genomeTemplates = beeRoot.getGenomeTemplates();
IAllele[] templateActive = genomeTemplates.get(individualTemplates.get(primaryIndex).getIdent());
IAllele[] templateInactive = genomeTemplates.get(individualTemplates.get(secondaryIndex).getIdent());
IBeeGenome genome = beeRoot.templateAsGenome(templateActive, templateInactive);
return new Bee(genome);
}
use of forestry.api.apiculture.IBeeRoot in project Binnie by ForestryMC.
the class AlvearyLogicHatchery method updateServer.
@Override
public void updateServer(TileEntityExtraBeesAlvearyPart tile) {
if (tile.getWorldObj().rand.nextInt(2400) == 0) {
final IBeeHousing house = tile.getMultiblockLogic().getController();
if (!house.getErrorLogic().hasErrors()) {
final ItemStack queenStack = house.getBeeInventory().getQueen();
IBeeRoot beeRoot = Utils.getBeeRoot();
final IBee queen = (queenStack.isEmpty()) ? null : beeRoot.getMember(queenStack);
if (queen != null) {
ItemStack larvae = beeRoot.getMemberStack(beeRoot.getBee(queen.getGenome()), EnumBeeType.LARVAE);
for (int i = 0; i < 5; i++) {
if (inv.insertItem(i, larvae, false).isEmpty()) {
return;
}
}
}
}
}
}
use of forestry.api.apiculture.IBeeRoot in project Binnie by ForestryMC.
the class AlvearyLogicFrameHousing method wearOutEquipment.
@Override
public void wearOutEquipment(final int amount) {
IHiveFrame hiveFrame = this.getHiveFrame();
if (hiveFrame != null) {
IBeeRoot beeRoot = Utils.getBeeRoot();
IMultiblockLogicAlveary multiblockLogic = tile.getMultiblockLogic();
IAlvearyController alvearyController = multiblockLogic.getController();
ItemStack queenStack = alvearyController.getBeeInventory().getQueen();
IBee queen = beeRoot.getMember(queenStack);
if (queen != null) {
final int wear = Math.round(amount * 5 * beeRoot.getBeekeepingMode(tile.getWorldObj()).getWearModifier());
ItemStack frame = inv.getStackInSlot(0);
ItemStack frameUsed = hiveFrame.frameUsed(alvearyController, frame, queen, wear);
inv.setStackInSlot(0, frameUsed);
}
}
}
Aggregations