* Creates the succeeding princess and between one and three drones.
*/
private void spawnOffspring(IBee queen) {
Stack<ItemStack> offspring = new Stack<ItemStack>();
IApiaristTracker breedingTracker = PluginApiculture.beeInterface.getBreedingTracker(housing.getWorld(), housing.getOwnerName());
housing.onQueenDeath(getQueen());
// Princess
IBee heiress = queen.spawnPrincess(housing);
if (heiress != null) {
ItemStack princess = PluginApiculture.beeInterface.getMemberStack(heiress, EnumBeeType.PRINCESS.ordinal());
breedingTracker.registerPrincess(heiress);
offspring.push(princess);
}
// Drones
IBee[] larvae = queen.spawnDrones(housing);
for (IBee larva : larvae) {
ItemStack drone = PluginApiculture.beeInterface.getMemberStack(larva, EnumBeeType.DRONE.ordinal());
breedingTracker.registerDrone(larva);
offspring.push(drone);
}
while (!offspring.isEmpty()) {
ItemStack spawned = offspring.pop();